2017-12-11 13:57:43 +00:00
|
|
|
# lex
|
|
|
|
|
|
|
|
> Lexical analyser generator.
|
|
|
|
> Given a lexical analyser, generates C code implementing it.
|
|
|
|
|
2017-12-11 14:07:57 +00:00
|
|
|
- Generate analyser from Lex file:
|
2017-12-11 13:57:43 +00:00
|
|
|
|
2017-12-11 21:28:07 +00:00
|
|
|
`lex {{analyser.l}}`
|
2017-12-11 13:57:43 +00:00
|
|
|
|
2017-12-11 21:30:23 +00:00
|
|
|
- Specify the output file:
|
|
|
|
|
2017-12-11 21:36:10 +00:00
|
|
|
`lex {{analyser.l}} --outfile {{analyser.c}}`
|
2017-12-11 21:30:23 +00:00
|
|
|
|
2017-12-11 14:07:57 +00:00
|
|
|
- Compile a C file generated by lex:
|
2017-12-11 13:57:43 +00:00
|
|
|
|
2017-12-11 21:28:07 +00:00
|
|
|
`cc {{path/to/lex.yy.c}} --output {{executable}}`
|