This is G o o g l e's cache of
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
To link to or bookmark this page, use the following url:

Google is not affiliated with the authors of this page nor responsible for its content.

Flex Directives

Noeud:Flex Directives, Noeud «Next»:, Noeud «Up»:Using Flex

Flex Directives

Flex supports several directives, only a few of them being presented below, see (FIXME: cite Flex documentation.), for more information. Most of them have command line option equivalent, but in typical uses it is better to embed them within the file.

%option debug
Produce a scanner which can be traced. This introduce a variable, yy_flex_debug, which, when set to a non zero value, triggers tracing messages on the standard error output.

You are encouraged to use this option, in particular when developing your scanner, and to have some option to set yy_flex_debug. In particular, never write printf-like tracing code in your scanner: that's an absolute waste of time.

%option nodefault
Die with an error message on unmatched characters instead of echoing them. We advise you not to rely on the default rule for sake of completeness, therefore, you should always use it to find holes in your rules.
%option nounput
%option noyywrap
Specify your scanner does not use unput and/or yywrap. These two functions are beyond the scope of this book and won't be detailed. Nevertheless we present these options so that (i) we no longer need the Flex library (which provides a default yywrap), and (ii) our scanners compile without triggering warning: `yyunput' defined but not used.
%option outfile="file"
Save the scanner in file.
%option prefix="prefix"
Replaces the default yy prefix with prefix. It also changes the default output file from lex.yy.c to lex.prefix.c.