flex
linux
Lexical analyzer generator. Given the specification for a lexical analyzer, generates C code implementing it.
More info →Options (3)
-t, --stdoutbooleanWrite analyzer to `stdout`
Example:
flex {{[-t|--stdout]}} {{analyzer.l}}-o, --outfilebooleanSpecify the output file
Example:
flex {{analyzer.l}} {{[-o|--outfile]}} {{analyzer.c}}-B, --batchbooleanGenerate a batch scanner instead of an interactive scanner
Example:
flex {{[-B|--batch]}} {{analyzer.l}}Examples (5)
Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`
flex analyzer.lWrite analyzer to `stdout`
flex [-t|--stdout] analyzer.lSpecify the output file
flex analyzer.l [-o|--outfile] analyzer.cGenerate a batch scanner instead of an interactive scanner
flex [-B|--batch] analyzer.lCompile a C file generated by Lex
cc path/to/lex.yy.c -o executablemade by @shridhargupta | data from tldr-pages