1. A method for converting a context-free grammar to a finite-state automaton representing the context-free grammar, the context-free grammar having non-terminal symbols and terminal symbols and having a set of rules, the method comprising: generating a first finite-state automaton from the set of rules; and generating, from the first finite-state automaton, at least one second finite-state automaton, each second finite state automaton defining a delayed acceptor for a plurality of the non-terminal symbols of the context free grammar.