DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Lexical analysis with lex

Miscellaneous

Recognition of expressions in an input text is performed by a deterministic finite automaton generated by lex. The -v option prints out for you 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 a large number of rules or the rules are very complex, this default value may be too small. You can enlarge the value by placing another entry in the definitions section of your lex source as follows:

   %n 700

This entry tells lex to make the table large enough to handle as many as 700 states. (The -v option will indicate how large a number you should choose.) If you have need to increase the maximum number of state transitions beyond 2000, the designated parameter is a, thus:

   %a 2800


Next topic: Summary of source format
Previous topic: Using lex with yacc

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004