Programming Utilities Guide

Automaton

Recognition of expressions in an input text is performed by a deterministic finite automaton generated by lex. The -v option prints a small set of statistics describing the finite automaton. (For a detailed account of finite automata and their importance for lex, see the Aho, Sethi, and Ullman text, Compilers: Principles, Techniques, and Tools, Addison-Wesley, 1986.)

lex uses a table to represent its finite automaton. The maximum number of states that the finite automaton allows is set by default to 500. If your lex source has many rules or the rules are very complex, you can enlarge the default value by placing another entry in the definitions section of your lex source:

%n 700

This entry tells lex to make the table large enough to handle as many as 700 states. (The -v option indicates how large a number you should choose.)

To increase the maximum number of state transitions beyond 2000, the designated parameter is a:

%a 2800

Finally, see lex(1) for a list of all the options available with the lex command.