1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 21:22:09 +02:00
tldr/pages/common/flex.md
2022-06-27 07:23:12 -03:00

416 B

flex

Lexical analyzer generator. Based on lex. Given the specification for a lexical analyzer, generates C code implementing it. More information: https://manned.org/flex.

  • Generate an analyzer from a flex file:

flex {{analyzer.l}}

  • Specify the output file:

flex --outfile {{analyzer.c}} {{analyzer.l}}

  • Compile a C file generated by flex:

cc {{path/to/lex.yy.c}} --output {{executable}}