1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-03 01:55:23 +02:00
tldr/pages/common/lex.md
Managor 5305776d45
*: capitalize the first letter after "Note:" (#16226)
Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com>
2025-05-04 05:15:17 +03:00

484 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.

  • 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}}