1. A method comprising: generating a first finite-state automaton from a set of rules associated with a context-free grammar; generating at least one second finite-state automaton from the first finite-state automaton; generating a third finite-state automaton associated with the context-free grammar being applied to an input string of symbols; and modifying, via a processor, the third finite-state automaton based on the at least one second finite-state automaton.