Lines Matching full:flex
3 @setfilename flex.info
4 @settitle Flex - a scanner generator
19 * Flex: (flex). A fast scanner generator.
39 This file documents Flex.
78 @title Flex, version @value{VERSION}
116 @top flex
120 This manual documents @code{flex}. It covers release @value{VERSION}.
156 flex - fast lexical analyzer generator
162 flex [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]
169 This manual describes @code{flex}, a tool for generating programs
182 the extended regular expressions used by flex
191 details regarding the scanner that flex produces;
212 connecting flex scanners together with yacc parsers
215 flex command-line options, and the "%option"
226 how flex differs from AT&T lex and the POSIX lex
230 those error messages produced by flex (or scanners
234 files used by flex
237 known problems with flex
249 @code{flex} is a tool for generating @dfn{scanners}: programs which
250 recognized lexical patterns in text. @code{flex} reads the given
254 and C code, called @dfn{rules}. @code{flex} generates as output a C
266 uses @code{flex}. The following @code{flex} input specifies a scanner
275 By default, any text not matched by a @code{flex} scanner is
376 The @code{flex} input file consists of three sections, separated
431 The @var{rules} section of the @code{flex} input contains a series of
537 (There are some combinations of @samp{@var{r}/@var{s}} that @code{flex}
548 Note that flex's notion of "newline" is exactly
549 whatever the C compiler used to compile flex
625 Some systems don't provide @samp{isblank()}, so flex defines
709 @code{flex} input file is chosen.
722 @code{flex} input is:
733 You can control which definition @code{flex} uses by including
735 first (definitions) section of your flex input. The
761 in the first section of your @code{flex} input. As mentioned
807 multiple lines. @code{flex} knows about C strings and comments and
852 originally chosen rule but came later in the @code{flex}
946 flex input file, not from other source files.
1040 The output of @code{flex} is the file @file{lex.yy.c}, which contains
1082 @code{flex}, and because it can be used to switch input files in the
1149 @code{flex} provides a mechanism for conditionally activating
1187 independent of any of the other rules in the @code{flex} input.
1371 Flex provides @code{YYSTATE} as an alias for @code{YY_START} (since that
1441 start condition(s). Flex makes this a little easier and
1507 @code{flex} scanners do a large amount of buffering, one cannot
1515 To negotiate these sorts of problems, @code{flex} provides a
1689 versions of flex, after doing the assignment you
1833 @samp{FILE *yyin} is the file which by default @code{flex} reads
1837 scanning will have unexpected results since @code{flex}
1870 One of the main uses of @code{flex} is as a companion to the @code{yacc}
1875 use @code{flex} with @code{yacc}, one specifies the @samp{-d} option to @code{yacc} to
1878 This file is then included in the @code{flex} scanner. For
1894 @code{flex} has the following options:
1926 that was fed to flex). Messages are also generated
1940 generates a "help" summary of @code{flex's} options to
1945 instructs @code{flex} to generate a @emph{case-insensitive}
1946 scanner. The case of letters given in the @code{flex} input
1971 the @code{flex} input file which will cause a serious loss
1992 instructs @code{flex} to write the scanner it generates to
1996 specifies that @code{flex} should write to @code{stderr} a
1999 the casual @code{flex} user, but the first line identifies
2000 the version of @code{flex} (same as reported by @samp{-V}), and
2008 instructs @code{flex} to generate a @emph{batch} scanner, the
2046 instructs @code{flex} to generate an @emph{interactive} scanner.
2060 @code{Flex} scanners default to @emph{interactive} unless you use
2064 options, so if you didn't, @code{flex} assumes you'd
2075 instructs @code{flex} not to generate @samp{#line} directives.
2076 Without this option, @code{flex} peppers the generated
2079 to either the original @code{flex} input file (if the
2081 @file{lex.yy.c} (if the errors are @code{flex's} fault -- you
2086 makes @code{flex} run in @code{trace} mode. It will generate a
2090 mostly for use in maintaining @code{flex}.
2097 instructs @code{flex} to generate a 7-bit scanner, i.e.,
2110 portable. @code{Flex's} default behavior is to generate
2112 which case @code{flex} defaults to generating 7-bit
2115 with non-USA sites). You can tell whether flex
2122 classes as discussed see below), flex still
2129 instructs @code{flex} to generate an 8-bit scanner, i.e.,
2132 @samp{-Cf} or @samp{-CF}, as otherwise flex defaults to
2135 See the discussion of @samp{-7} above for flex's default
2140 specifies that you want flex to generate a C++
2149 @samp{-Ca} ("align") instructs flex to trade off larger
2158 @samp{-Ce} directs @code{flex} to construct @dfn{equivalence classes},
2161 of digits in the @code{flex} input is in the character
2171 be generated - @code{flex} should not compress the tables
2180 @samp{-Cm} directs @code{flex} to construct @dfn{meta-equivalence
2215 @code{flex} should generate equivalence classes and
2242 directs flex to write the scanner to the file @samp{out-}
2249 changes the default @samp{yy} prefix used by @code{flex} for all
2281 @code{flex} programs into the same executable. Note,
2290 overrides the default skeleton file from which @code{flex}
2292 option unless you are doing @code{flex} maintenance or
2296 @code{flex} also provides a mechanism for controlling options
2298 the flex command-line. This is done by including @samp{%option}
2302 section of your flex input file. Most options are given
2305 A number are equivalent to flex flags or their negation:
2344 instructs flex to generate a scanner which always
2353 directs flex to provide a default @samp{main()} program
2358 instructs flex to generate a scanner which never
2373 directs @code{flex} to generate a scanner that maintains the number
2385 @code{flex} scans your rule actions to determine whether you use
2417 informs @code{flex} that you have derived @samp{foo} as a subclass of
2418 @code{yyFlexLexer} so @code{flex} will place your actions in the member
2444 The main design goal of @code{flex} is that it generate
2570 accidentally match a valid token. A possible future @code{flex}
2714 stream other than letters or newlines, @code{flex} can't figure
2742 @code{flex} scanner to go for this particular problem.
2744 A final note: @code{flex} is slow when matching NUL's,
2761 @code{flex} provides two different ways to generate scanners for
2763 scanner generated by @code{flex} using a C++ compiler instead of a C
2772 You can also use @code{flex} to generate a C++ scanner class, using
2774 is automatically specified if the name of the flex executable ends
2775 in a @samp{+}, such as @code{flex++}. When using this option, flex
2826 flex scanners: it scans the input stream, consuming
2834 to inform @code{flex}
2837 @code{flex} generates @samp{@var{S}::yylex()}
2894 // An example of using the flex C++ scanner class.
2980 @code{flex} is a rewrite of the AT&T Unix @code{lex} tool (the two
2984 either implementation. Flex is fully compliant with the
2990 incompatibility between flex, AT&T lex, and the POSIX
2993 @code{flex's} @samp{-l} option turns on maximum compatibility with the
2999 @code{flex} is fully compatible with @code{lex} with the following
3021 The @code{flex} restriction that @samp{input()} cannot be
3032 @code{flex} scanners are not as reentrant as @code{lex} scanners.
3039 fatal flex scanner internal error--end of buffer missed
3052 Also note that flex C++ scanner classes @emph{are}
3069 When definitions are expanded, @code{flex} encloses them
3082 '?' is associated with "[A-Z0-9]*". With @code{flex}, the
3091 @code{flex} definition.
3109 @code{flex} does not support this feature.
3127 @code{flex} interprets it as "match 'ab' followed by one,
3135 @code{flex} interprets it as "match either 'foo' or 'bar'
3141 supported by @code{lex} are not required by @code{flex} scanners;
3142 @code{flex} ignores them.
3146 be written for use with either @code{flex} or @code{lex}.
3149 @code{flex} generated the scanner (for example, for the
3154 The following @code{flex} features are not included in @code{lex} or the
3180 plus almost all of the flex flags. The last feature in
3181 the list refers to the fact that with @code{flex} you can put
3196 @code{flex} does not truncate the action. Actions that are not
3229 uses @code{REJECT} or @samp{yymore()} but that @code{flex} failed to notice the
3230 fact, meaning that @code{flex} scanned the first two sections
3234 to indicate to flex that you really do use these features.
3236 @item flex scanner jammed
3247 your @code{flex} input.
3257 @item flex scanner push-back overflow
3269 @item fatal flex scanner internal error--end of buffer missed
3304 @item flex.skl
3306 building flex, not when flex executes.
3354 example, @samp{getchar()}, with @code{flex} rules and expect it to work.
3365 The @code{flex} internal algorithms need documentation.
3379 Describes the pattern-matching techniques used by @code{flex}
3390 Thanks to the many @code{flex} beta-testers, feedbackers, and