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>.
Install
- All systems
-
curl cmd.cat/lex.sh
- Debian
-
apt-get install flex - Ubuntu
-
apt-get install flex -
Alpine
-
apk add flex - Arch Linux
-
pacman -S flex - Kali Linux
-
apt-get install flex - CentOS
-
yum install flex - Fedora
-
dnf install flex - Windows (WSL2)
-
sudo apt-get updatesudo apt-get install flex - OS X
-
brew install flex - Raspbian
-
apt-get install flex - Docker
-
docker run cmd.cat/lex lexpowered by Commando
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
© tl;dr; authors and contributors