13.7.3 Flex – a better Lex
flex
is a fast lexical analyzer generator.
References for flex
:
-
info flex (tutorial)
-
flex(1)
You need to provide your own main()
and yywrap()
, or
your program.l
should look like this to compile without a library
(yywrap
is a macro; %option main turns on
%option noyywrap implicitly):
%option main
%%
.|\n ECHO ;
%%
Alternatively, you may compile with the -lfl linker option at the
end of your cc
command line (like AT&T-Lex with
-ll). No %option is needed in this case.