1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 17:02:09 +02:00
tldr/pages/common/flex.md
2021-04-19 23:05:51 +01:00

17 lines
416 B
Markdown

# flex
> Lexical analyser generator. Based on `lex`.
> Given the specification for a lexical analyser, generates C code implementing it.
> More information: <https://manned.org/flex>.
- Generate an analyser from a flex file:
`flex {{analyser.l}}`
- Specify the output file:
`flex --outfile {{analyser.c}} {{analyser.l}}`
- Compile a C file generated by flex:
`cc {{path/to/lex.yy.c}} --output {{executable}}`