1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-28 22:04:55 +02:00
tldr/pages/common/flex.md
2018-01-01 17:28:25 +05:30

16 lines
369 B
Markdown

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