tldr/pages/common/lex.md
K.B.Dharun Krishna 1de9190d63
pages.*: standardize capitalization in note term (#12195)
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-02-05 12:34:49 +05:30

486 B

lex

Lexical analyzer generator. Given the specification for a lexical analyzer, generates C code implementing it. Note: on most major OSes, this command is an alias for flex. More information: https://manned.org/lex.1.

  • Generate an analyzer from a Lex file, storing it to the file lex.yy.c:

lex {{analyzer.l}}

  • Specify the output file:

lex -t {{analyzer.l}} > {{analyzer.c}}

  • Compile a C file generated by Lex:

c99 {{path/to/lex.yy.c}} -o {{executable}}