flex Command Examples

Lexical analyzer generator. A rewrite of lex with extensions to the POSIX specification. Given the specification for a lexical analyzer, generates C code implementing it. Note: long options don't work on OpenBSD. More information: https://manned.org/flex.

lex {{analyzer.l}}

lex -{{-stdout|t}} {{analyzer.l}}

lex {{analyzer.l}} -o {{analyzer.c}}

lex -B {{analyzer.l}}

cc {{path/to/lex.yy.c}} --output {{executable}}