Files
tldr/pages/common/lex.md
Vitor Henrique c19a39c1d4 lex: add examples and add {Free,Net,Open}BSD pages (#11895)
* lex: add examples and add other BSD

* lex: fix OpenBSD man link

* lex: remove unsupported option from OpenBSD

* lex: apply suggestions from code review

Co-authored-by: Juri Dispan <juri.dispan@posteo.net>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* flex, lex: moving flex options to common/flex.md

* lex: mention `lex` alias to `flex`

* Update pages/linux/lex.md

---------

Co-authored-by: Juri Dispan <juri.dispan@posteo.net>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-01-07 14:44:19 +05:30

19 lines
486 B
Markdown

# lex
> Lexical analyzer generator.
> Given the specification for a lexical analyzer, generates C code implementing it.
> NOTE: on most major OSes, this command is an alias for `flex`.
> More information: <https://manned.org/lex.1>.
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
`lex {{analyzer.l}}`
- Specify the output file:
`lex -t {{analyzer.l}} > {{analyzer.c}}`
- Compile a C file generated by Lex:
`c99 {{path/to/lex.yy.c}} -o {{executable}}`