Applications of context-free grammar in speech recognition