16.1 Options for Specifying Filenames
- instructs flex to write a C header to FILE. This file contains
function prototypes, extern variables, and types used by the scanner.
Only the external API is exported by the header file. Many macros that
are usable from within scanner actions are not exported to the header
file. This is due to namespace problems and the goal of a clean
While in the header, the macro
yyIN_HEADER is defined, where ‘yy’
is substituted with the appropriate prefix.
The ‘--header-file’ option is not compatible with the ‘--c++’ option,
since the C++ scanner provides its own header in yyFlexLexer.h.
- ‘-oFILE, --outfile=FILE,
- directs flex to write the scanner to the file FILE instead of
lex.yy.c. If you combine ‘--outfile’ with the ‘--stdout’ option,
then the scanner is written to stdout but its
directives (see the ‘-l’ option above) refer to the file
- ‘-t, --stdout,
flex to write the scanner it generates to standard
output instead of lex.yy.c.
- ‘-SFILE, --skel=FILE’
- overrides the default skeleton file from which
constructs its scanners. You'll never need this option unless you are doing
maintenance or development.
- Write serialized scanner dfa tables to FILE. The generated scanner will not
contain the tables, and requires them to be loaded at runtime.
- This option is for flex development. We document it here in case you stumble
upon it by accident or in case you suspect some inconsistency in the serialized
tables. Flex will serialize the scanner dfa tables but will also generate the
in-code tables as it normally does. At runtime, the scanner will verify that
the serialized tables match the in-code tables, instead of loading them.