2017-12-30 16:16:30 +00:00
|
|
|
# flex
|
|
|
|
|
2018-01-01 11:58:25 +00:00
|
|
|
> Lexical analyser generator. Based on `lex`.
|
2017-12-30 16:16:30 +00:00
|
|
|
> Given the specification for a lexical analyser, generates C code implementing it.
|
|
|
|
|
|
|
|
- Generate an analyser from a flex file:
|
|
|
|
|
2018-01-01 10:52:18 +00:00
|
|
|
`flex {{analyser.l}}`
|
2017-12-30 16:16:30 +00:00
|
|
|
|
|
|
|
- Specify the output file:
|
|
|
|
|
2020-07-17 18:41:30 +01:00
|
|
|
`flex --outfile {{analyser.c}} {{analyser.l}}`
|
2017-12-30 16:16:30 +00:00
|
|
|
|
|
|
|
- Compile a C file generated by flex:
|
|
|
|
|
|
|
|
`cc {{path/to/lex.yy.c}} --output {{executable}}`
|