Update cheatsheets

This commit is contained in:
ivuorinen
2025-03-23 00:20:07 +00:00
parent a49466c200
commit cd59a77dc8
31 changed files with 239 additions and 130 deletions

View File

@@ -5,26 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
---
# lex
> Lexical analyzer generator.
> Given the specification for a lexical analyzer, generates C code implementing it.
> More information: <https://manned.org/lex.1>.
> This command is an alias of `flex`.
- Generate an analyzer from a Lex file, storing it to the file `lex.yy.c`:
- View documentation for the original command:
`lex {{analyzer.l}}`
- Write analyzer to `stdout`:
`lex -{{-stdout|t}} {{analyzer.l}}`
- Specify the output file:
`lex {{analyzer.l}} --outfile {{analyzer.c}}`
- Generate a [B]atch scanner instead of an interactive scanner:
`lex -B {{analyzer.l}}`
- Compile a C file generated by Lex:
`cc {{path/to/lex.yy.c}} --output {{executable}}`
`tldr flex`