| 1 |
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. |
| 2 |
.TH FLEX "1" "January 2026" "The Flex Project" "Programming" |
| 3 |
.SH NAME |
| 4 |
flex \- the fast lexical analyser generator |
| 5 |
.SH SYNOPSIS |
| 6 |
.B flex |
| 7 |
[\fI\,OPTIONS\/\fR] [\fI\,FILE\/\fR]... |
| 8 |
.SH DESCRIPTION |
| 9 |
Generates programs that perform pattern\-matching on text. |
| 10 |
.SS "Table Compression:" |
| 11 |
.TP |
| 12 |
\fB\-Ca\fR, \fB\-\-align\fR |
| 13 |
trade off larger tables for better memory alignment |
| 14 |
.TP |
| 15 |
\fB\-Ce\fR, \fB\-\-ecs\fR |
| 16 |
construct equivalence classes |
| 17 |
.TP |
| 18 |
\fB\-Cf\fR |
| 19 |
do not compress tables; use \fB\-f\fR representation |
| 20 |
.TP |
| 21 |
\fB\-CF\fR |
| 22 |
do not compress tables; use \fB\-F\fR representation |
| 23 |
.TP |
| 24 |
\fB\-Cm\fR, \fB\-\-meta\-ecs\fR |
| 25 |
construct meta\-equivalence classes |
| 26 |
.TP |
| 27 |
\fB\-Cr\fR, \fB\-\-read\fR |
| 28 |
use read() instead of stdio for scanner input |
| 29 |
.TP |
| 30 |
\fB\-f\fR, \fB\-\-full\fR |
| 31 |
generate fast, large scanner. Same as \fB\-Cfr\fR |
| 32 |
.TP |
| 33 |
\fB\-F\fR, \fB\-\-fast\fR |
| 34 |
use alternate table representation. Same as \fB\-CFr\fR |
| 35 |
.TP |
| 36 |
\fB\-Cem\fR |
| 37 |
default compression (same as \fB\-\-ecs\fR \fB\-\-meta\-ecs\fR) |
| 38 |
.SS "Debugging:" |
| 39 |
.TP |
| 40 |
\fB\-d\fR, \fB\-\-debug\fR |
| 41 |
enable debug mode in scanner |
| 42 |
.TP |
| 43 |
\fB\-b\fR, \fB\-\-backup\fR |
| 44 |
write backing\-up information to lex.backup |
| 45 |
.TP |
| 46 |
\fB\-p\fR, \fB\-\-perf\-report\fR |
| 47 |
write performance report to stderr |
| 48 |
.TP |
| 49 |
\fB\-s\fR, \fB\-\-nodefault\fR |
| 50 |
suppress default rule to ECHO unmatched text |
| 51 |
.TP |
| 52 |
\fB\-T\fR, \fB\-\-trace\fR |
| 53 |
flex should run in trace mode |
| 54 |
.TP |
| 55 |
\fB\-w\fR, \fB\-\-nowarn\fR |
| 56 |
do not generate warnings |
| 57 |
.TP |
| 58 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 59 |
write summary of scanner statistics to stdout |
| 60 |
.TP |
| 61 |
\fB\-\-hex\fR |
| 62 |
use hexadecimal numbers instead of octal in debug outputs |
| 63 |
.SH FILES |
| 64 |
.TP |
| 65 |
\fB\-o\fR, \fB\-\-outfile\fR=\fI\,FILE\/\fR |
| 66 |
specify output filename |
| 67 |
.TP |
| 68 |
\fB\-S\fR, \fB\-\-skel\fR=\fI\,FILE\/\fR |
| 69 |
specify skeleton file |
| 70 |
.TP |
| 71 |
\fB\-t\fR, \fB\-\-stdout\fR |
| 72 |
write scanner on stdout instead of lex.yy.c |
| 73 |
.TP |
| 74 |
\fB\-\-yyclass\fR=\fI\,NAME\/\fR |
| 75 |
name of C++ class |
| 76 |
.TP |
| 77 |
\fB\-\-header\-file\fR=\fI\,FILE\/\fR |
| 78 |
create a C header file in addition to the scanner |
| 79 |
.HP |
| 80 |
\fB\-\-tables\-file\fR[=\fI\,FILE\/\fR] write tables to FILE |
| 81 |
.TP |
| 82 |
\fB\-\-backup\-file\fR=\fI\,FILE\/\fR |
| 83 |
write backing\-up information to FILE |
| 84 |
.SS "Scanner behavior:" |
| 85 |
.TP |
| 86 |
\fB\-7\fR, \fB\-\-7bit\fR |
| 87 |
generate 7\-bit scanner |
| 88 |
.TP |
| 89 |
\fB\-8\fR, \fB\-\-8bit\fR |
| 90 |
generate 8\-bit scanner |
| 91 |
.TP |
| 92 |
\fB\-B\fR, \fB\-\-batch\fR |
| 93 |
generate batch scanner (opposite of \fB\-I\fR) |
| 94 |
.TP |
| 95 |
\fB\-i\fR, \fB\-\-case\-insensitive\fR |
| 96 |
ignore case in patterns |
| 97 |
.TP |
| 98 |
\fB\-l\fR, \fB\-\-lex\-compat\fR |
| 99 |
maximal compatibility with original lex |
| 100 |
.TP |
| 101 |
\fB\-X\fR, \fB\-\-posix\-compat\fR |
| 102 |
maximal compatibility with POSIX lex |
| 103 |
.TP |
| 104 |
\fB\-I\fR, \fB\-\-interactive\fR |
| 105 |
generate interactive scanner (opposite of \fB\-B\fR) |
| 106 |
.TP |
| 107 |
\fB\-\-yylineno\fR |
| 108 |
track line count in yylineno |
| 109 |
.SS "Generated code:" |
| 110 |
.TP |
| 111 |
\-+, \fB\-\-c\fR++ |
| 112 |
generate C++ scanner class |
| 113 |
.TP |
| 114 |
\fB\-Dmacro\fR[=\fI\,defn\/\fR] |
| 115 |
#define macro defn (default defn is '1') |
| 116 |
.TP |
| 117 |
\fB\-L\fR, \fB\-\-noline\fR |
| 118 |
suppress #line directives in scanner |
| 119 |
.TP |
| 120 |
\fB\-P\fR, \fB\-\-prefix\fR=\fI\,STRING\/\fR |
| 121 |
use STRING as prefix instead of "yy" |
| 122 |
.TP |
| 123 |
\fB\-R\fR, \fB\-\-reentrant\fR |
| 124 |
generate a reentrant C scanner |
| 125 |
.TP |
| 126 |
\fB\-\-bison\-bridge\fR |
| 127 |
scanner for bison pure parser. |
| 128 |
.TP |
| 129 |
\fB\-\-bison\-locations\fR |
| 130 |
include yylloc support. |
| 131 |
.TP |
| 132 |
\fB\-\-stdinit\fR |
| 133 |
initialize yyin/yyout to stdin/stdout |
| 134 |
.TP |
| 135 |
\fB\-\-nounistd\fR |
| 136 |
do not include <unistd.h> |
| 137 |
.TP |
| 138 |
\fB\-\-noFUNCTION\fR |
| 139 |
do not generate a particular FUNCTION |
| 140 |
.SS "Miscellaneous:" |
| 141 |
.TP |
| 142 |
\fB\-c\fR |
| 143 |
do\-nothing POSIX option |
| 144 |
.TP |
| 145 |
\fB\-n\fR |
| 146 |
do\-nothing POSIX option |
| 147 |
.HP |
| 148 |
\-? |
| 149 |
.TP |
| 150 |
\fB\-h\fR, \fB\-\-help\fR |
| 151 |
produce this help message |
| 152 |
.TP |
| 153 |
\fB\-V\fR, \fB\-\-version\fR |
| 154 |
report flex version |
| 155 |
.SH "SEE ALSO" |
| 156 |
The full documentation for |
| 157 |
.B flex |
| 158 |
is maintained as a Texinfo manual. If the |
| 159 |
.B info |
| 160 |
and |
| 161 |
.B flex |
| 162 |
programs are properly installed at your site, the command |
| 163 |
.IP |
| 164 |
.B info flex |
| 165 |
.PP |
| 166 |
should give you access to the complete manual. |