LEX(1) UNIX Programmer's Manual LEX(1)
lex - generator of lexical analysis programs
S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
l
\ble
\bex
\bx [ -
\b-t
\btv
\bvf
\bfn
\bn ] [ file ] ...
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
_
\bL_
\be_
\bx generates programs to be used in simple lexical analyis
of text. The input _
\bf_
\bi_
\bl_
\be_
\bs (standard input default) contain
regular expressions to be searched for, and actions written
in C to be executed when expressions are found.
A C source program, 'lex.yy.c' is generated, to be compiled
This program, when run, copies unrecognized portions of the
input to the output, and executes the associated C action
for each regular expression that is recognized.
The options have the following meanings.
-
\b-t
\bt Place the result on the standard output instead of in
-
\b-v
\bv Print a one-line summary of statistics of the generated
-
\b-n
\bn Opposite of -
\b-v
\bv; -
\b-n
\bn is default.
-
\b-f
\bf "Faster" compilation: don't bother to pack the result-
ing tables; limited to small programs.
E
\bEX
\bXA
\bAM
\bMP
\bPL
\bLE
\bE
would draw _
\bl_
\be_
\bx instructions from the file _
\bl_
\be_
\bx_
\bc_
\bo_
\bm_
\bm_
\ba_
\bn_
\bd_
\bs, and
place the output in _
\bl_
\be_
\bx._
\by_
\by._
\bc
[A-Z] putchar(yytext[0]+'a'-'A');
is an example of a _
\bl_
\be_
\bx program that would be put into a _
\bl_
\be_
\bx
command file. This program converts upper case to lower,
removes blanks at the end of lines, and replaces multiple
Printed 7/9/88 April 14, 1986 1
LEX(1) UNIX Programmer's Manual LEX(1)
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
M. E. Lesk and E. Schmidt, _
\bL_
\bE_
\bX - _
\bL_
\be_
\bx_
\bi_
\bc_
\ba_
\bl _
\bA_
\bn_
\ba_
\bl_
\by_
\bz_
\be_
\br _
\bG_
\be_
\bn_
\be_
\br_
\ba_
\bt_
\bo_
\br
Printed 7/9/88 April 14, 1986 2