flex

Generate programs for lexical tasks

Syntax:

flex [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput
      -Pprefix -Sskeleton] [--help --version] [file ...]

Runs on:

Linux, Mac, Microsoft Windows

Options:

-+
Generate C++ scanner class.
-7
Generate 7-bit scanner.
-8
Generate 8-bit scanner.
-?
Display a help message.
-B
Generate batch scanner (opposite of -I).
-b
Generate backing-up information to lex.backup.
-C
Specify the degree of table compression (default is -Cem):
  • -Ca — trade off larger tables for better memory alignment.
  • -Ce — construct equivalence classes.
  • -Cf — don't compress scanner tables; use -f representation.
  • -CF — don't compress scanner tables; use -F representation.
  • -Cm — construct meta-equivalence classes.
  • -Cr — use read() instead of standard I/O for scanner input.
-c
Do-nothing POSIX option.
-d
Turn on debug mode in generated scanner.
-F
Use the alternative fast scanner representation.
-f
Generate fast, large scanner.
-h
Display a help message.
-I
Generate an interactive scanner (opposite of -B).
-i
Generate case-insensitive scanner.
-L
Suppress #line directives in scanner.
-l
(“el”) Provide maximal compatibility with original lex.
-n
Do-nothing POSIX option.
-ooutput
Specify the output filename.
-Pprefix
Specify a scanner prefix other than yy.
-p
Generate a performance report to stderr.
-Sskeleton
Specify the skeleton file.
-s
Suppress default rule to ECHO unmatched text.
-T
Run flex in trace mode.
-t
Write the generated scanner on stdout instead of lex.yy.c.
-V
Report the flex version.
-v
Write a summary of scanner statistics.
-w
Don't generate warnings.
--help
Display a help message.
--version
Report the flex version.

Description:

The flex command generates programs for lexical tasks.

We don't provide the flex library (libfl.a). If you wish to generate code that isn't dependent on this library, add the following line as the first line in your lex source file:

%option noyywrap

Otherwise, the undefined yywrap() function will result in a link error.

For more information, see the GNU website at http://www.gnu.org/.

Contributing author:

GNU