version 1.6, 1999/05/12 13:26:51 |
version 1.7, 1999/06/05 01:21:30 |
|
|
yyin = fopen( argv[0], "r" ); |
yyin = fopen( argv[0], "r" ); |
else |
else |
yyin = stdin; |
yyin = stdin; |
|
|
yylex(); |
yylex(); |
} |
} |
|
|
|
|
.PP |
.PP |
If the action contains a '{', then the action spans till the balancing '}' |
If the action contains a '{', then the action spans till the balancing '}' |
is found, and the action may cross multiple lines. |
is found, and the action may cross multiple lines. |
.I flex |
.I flex |
knows about C strings and comments and won't be fooled by braces found |
knows about C strings and comments and won't be fooled by braces found |
within them, but also allows actions to begin with |
within them, but also allows actions to begin with |
.B %{ |
.B %{ |
|
|
(see the discussion of the |
(see the discussion of the |
.B \-I |
.B \-I |
flag below). A non-zero value |
flag below). A non-zero value |
in the macro invocation marks the buffer as interactive, a zero |
in the macro invocation marks the buffer as interactive, a zero |
value as non-interactive. Note that use of this macro overrides |
value as non-interactive. Note that use of this macro overrides |
.B %option always-interactive |
.B %option always-interactive |
or |
or |
|
|
generates a "help" summary of |
generates a "help" summary of |
.I flex's |
.I flex's |
options to |
options to |
.I stdout |
.I stdout |
and then exits. |
and then exits. |
.B \-? |
.B \-? |
and |
and |
|
|
specifies that you want flex to generate a C++ |
specifies that you want flex to generate a C++ |
scanner class. See the section on Generating C++ Scanners below for |
scanner class. See the section on Generating C++ Scanners below for |
details. |
details. |
.TP |
.TP |
.B \-C[aefFmr] |
.B \-C[aefFmr] |
controls the degree of table compression and, more generally, trade-offs |
controls the degree of table compression and, more generally, trade-offs |
between small scanners and fast scanners. |
between small scanners and fast scanners. |
|
|
Getting rid of backing up is messy and often may be an enormous |
Getting rid of backing up is messy and often may be an enormous |
amount of work for a complicated scanner. In principal, one begins |
amount of work for a complicated scanner. In principal, one begins |
by using the |
by using the |
.B \-b |
.B \-b |
flag to generate a |
flag to generate a |
.I lex.backup |
.I lex.backup |
file. For example, on the input |
file. For example, on the input |
|
|
Compiled with |
Compiled with |
.B \-Cf, |
.B \-Cf, |
this is about as fast as one can get a |
this is about as fast as one can get a |
.I flex |
.I flex |
scanner to go for this particular problem. |
scanner to go for this particular problem. |
.PP |
.PP |
A final note: |
A final note: |
|
|
.PP |
.PP |
IMPORTANT: the present form of the scanning class is |
IMPORTANT: the present form of the scanning class is |
.I experimental |
.I experimental |
and may change considerably between major releases. |
and may change considerably between major releases. |
.SH INCOMPATIBILITIES WITH LEX AND POSIX |
.SH INCOMPATIBILITIES WITH LEX AND POSIX |
.I flex |
.I flex |
is a rewrite of the AT&T Unix |
is a rewrite of the AT&T Unix |