From 862719e20ac84acb4e5d0455514744db36ba4db0 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Mon, 9 Jan 1995 12:13:11 +0000 Subject: [PATCH] 2.5.0.4 --- NEWS | 13 ++++++++++++- flex.1 | 37 +++++++++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index fb7b154..d6dfed8 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -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: @@ -24,6 +24,10 @@ Changes between release 2.5.0.2 (28Dec94) and release 2.4.7: "\\f" return '\f'; "\\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 @@ -282,12 +286,19 @@ Changes between release 2.5.0.2 (28Dec94) and release 2.4.7: - 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. diff --git a/flex.1 b/flex.1 index f8eb2a2..7d585b9 100644 --- a/flex.1 +++ b/flex.1 @@ -3,7 +3,8 @@ 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 @@ -1766,11 +1767,25 @@ An example: .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 @@ -2010,6 +2025,11 @@ generates a "help" summary of options to .I stderr and then exits. +.B \-? +and +.B \-\-help +are synonyms for +.B \-h. .TP .B \-i instructs @@ -2232,6 +2252,9 @@ finite automata. This option is mostly for use in maintaining prints the version number to .I stderr and exits. +.B \-\-version +is a synonym for +.B \-V. .TP .B \-7 instructs @@ -3721,6 +3744,12 @@ O'Reilly and Associates. Be sure to get the 2nd edition. .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 @@ -3738,7 +3767,7 @@ Brian Clapper, J.T. Conklin, 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, -- 2.40.0