flex

Lexical analyser generator. Based on `lex`. Given the specification for a lexical analyser, generates C code implementing it.

Install

All systems
curl cmd.cat/flex.sh
Debian Debian
apt-get install flex
Ubuntu
apt-get install flex
Alpine
apk add flex
Arch Arch Linux
pacman -S flex
image/svg+xml Kali Linux
apt-get install flex
CentOS
yum install flex
Fedora
dnf install flex
OS X
brew install flex
Raspbian
apt-get install flex
Docker
docker run cmd.cat/flex flex powered by Commando

Lexical analyser generator. Based on `lex`. Given the specification for a lexical analyser, generates C code implementing it.

  • Generate an analyser from a flex file:
    flex analyser.l
  • Specify the output file:
    flex analyser.l --outfile analyser.c
  • Compile a C file generated by flex:
    cc path/to/lex.yy.c --output executable

© tl;dr; authors and contributors