mirror of https://github.com/CrimsonTome/tldr.git
18 lines
416 B
Markdown
18 lines
416 B
Markdown
# 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}}`
|