-Changes between release 2.5.0.2 (28Dec94) and release 2.4.7:
+Changes between release 2.5.0.4 (09Jan95) and release 2.4.7:
- A new concept of "start condition" scope has been introduced.
A start condition scope is begun with:
<ESC>"\\f" return '\f';
<ESC>"\\0" return '\0';
+ As indicated in this example, rules inside start condition scopes
+ (and any rule, actually, other than the first) can be indented,
+ to better show the extent of the scope.
+
Start condition scopes may be nested.
- The new %option directive can be used in the first section of
- Scanners generated using -l lex compatibility now have the symbol
YY_FLEX_LEX_COMPAT #define'd.
+ - You can now use "#line" directives in the first section of your
+ scanner specification.
+
- Improved support for MS-DOS.
- Documentation now clarifies that start conditions persist across
switches to new input files or different input buffers. If you
want to e.g., return to INITIAL, you must explicitly do so.
+ - Documented the "yy_act" variable, which when YY_USER_ACTION is
+ invoked holds the number of the matched rule, and added an
+ example of using yy_act to profile how often each rule is matched.
+
- Documentation now clarifies that you can pass a nil FILE* pointer
to yy_create_buffer() or yyrestart() if you've arrange YY_INPUT
to not need yyin.
flex \- fast lexical analyzer generator
.SH SYNOPSIS
.B flex
-.B [\-bcdfhilnpstvwBFILTV78+ \-C[aefFmr] \-ooutput \-Pprefix \-Sskeleton]
+.B [\-bcdfhilnpstvwBFILTV78+? \-C[aefFmr] \-ooutput \-Pprefix \-Sskeleton]
+.B [\-\-help \-\-version]
.I [filename ...]
.SH OVERVIEW
This manual describes
.fi
.SH MISCELLANEOUS MACROS
The macro
-.bd
-YY_USER_ACTION
+.B YY_USER_ACTION
can be defined to provide an action
which is always executed prior to the matched rule's action. For example,
it could be #define'd to call a routine to convert yytext to lower-case.
+When
+.B YY_USER_ACTION
+is invoked, the variable
+.I yy_act
+gives the number of the matched rule (rules are numbered starting with 1).
+Suppose you want to profile how often each of your rules is matched. The
+following would do the trick:
+.nf
+
+ #define YY_USER_ACTION ++ctr[yy_act]
+
+.fi
+where
+.I ctr
+is an array to hold the counts for the different rules.
.PP
The macro
.B YY_USER_INIT
options to
.I stderr
and then exits.
+.B \-?
+and
+.B \-\-help
+are synonyms for
+.B \-h.
.TP
.B \-i
instructs
prints the version number to
.I stderr
and exits.
+.B \-\-version
+is a synonym for
+.B \-V.
.TP
.B \-7
instructs
.PP
M. E. Lesk and E. Schmidt,
.I LEX \- Lexical Analyzer Generator
+.PP
+Alfred Aho, Ravi Sethi and Jeffrey Ullman,
+.I Compilers: Principles, Techniques and Tools,
+Addison-Wesley (1986). Describes the pattern-matching techniques used by
+.I flex
+(deterministic finite automata).
.SH AUTHOR
Vern Paxson, with the help of many ideas and much inspiration from
Van Jacobson. Original version by Jef Poskanzer. The fast table
Jason Coughlin, Bill Cox, Dave Curtis, Scott David
Daniels, Chris G. Demetriou, Theo Deraadt,
Mike Donahue, Chuck Doucette, Tom Epperly, Leo Eskin,
-Chris Faylor, Jon Forrest, Kaveh R. Ghazi,
+Chris Faylor, Chris Flatters, Jon Forrest, Kaveh R. Ghazi,
Eric Goldman, Christopher M. Gould, Ulrich Grepel, Peer Griebel,
Jan Hajic, Charles Hemphill, NORO Hideo,
Jarkko Hietaniemi, Scott Hofmann,