Name

flex

Synopsis

                  flex [options] [file]

flex (Fast Lexical Analyzer Generator) is a faster variant of lex . It generates a lexical analysis program (named lex.yy.c) based on the regular expressions and C statements contained in one or more input files. See also bison, yacc, and the O’Reilly book lex & yacc.

Options

-b

Generate backup information to lex.backup.

-d

Debug mode.

-f

Use faster compilation (limited to small programs).

-h

Help summary.

-i

Scan case-insensitively.

-l

Maximum lex compatibility.

-o file

Write output to file instead of lex.yy.c.

-p

Print performance report.

-s

Exit if the scanner encounters input that does not match any of its rules.

-t

Print to standard output. (By default, flex prints to lex.yy.c.)

-v

Print a summary of statistics.

-w

Suppress warning messages.

-B

Generate batch (noninteractive) scanner.

-F

Use the fast scanner table representation.

-I

Generate an interactive scanner (default).

-L

Suppress #line directives in lex.yy.c.

-P prefix

Change default yy prefix to prefix for all globally visible variable and function names.

-V

Print version number.

-7

Generate a 7-bit scanner.

-8

Generate an 8-bit scanner (default).

-+

Generate a C++ scanner class.

-C

Compress scanner tables but do not use equivalence classes.

-Ca

Align tables for memory access and computation. This creates larger tables but gives faster performance.

-Ce

Construct equivalence classes. This creates smaller tables and sacrifices little performance (default).

-Cf

Generate full scanner ...

Get Linux in a Nutshell, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.