The scanners generated by the Flex tool, which shouldn’t be confused with a non-GNU free implementation of Lex, are actually programs that can recognize lexical patterns in text, also known as applications that perform pattern-matching on text.
Flex has been designed in such a way that it can generate a C source file called "lex.yy.c" which can define the yylex() function. The software is a command-line tool, so you can use it via any terminal emulator.
The program’s command-line options are organized in categories like table compression, debugging, files, scanner behavior, generated code and miscellaneous. To see them at a glance, run the ‘flex --help’ command after installing the software on your system.
Among the table compression command-line options, we can mention the ability to construct equivalence and/or meta-equivalence classes, to use an alternate table representation, to use default compression, to generate a large and fast scanner, as well as to not compress tables.
Debugging command-line options include support for enabling debug mode in scanner, support for writing summary of scanner statistics to stdout, support for running Flex in trace mode, as well as support for writing backing-up information to a specific file and a performance report to stderr.
The scanner behavior can also be customized via command-line options, which include support for generating 7-bit or 8-bit scanners, support for generating a batch scanner, support for generating an interactive scanner, as well as support for tracking line count in yylineno.
Supports 32-bit/64-bit Linux and BSD platforms
The software has been written entirely in the C and C++ programming language and it is known to work well on both Linux and FreeBSD operating systems. Currently, it can be installed on computers supporting either of the 64-bit or 32-bit instruction set architectures.
Reviewed by Marius Nestor, last updated on December 5th, 2014
Application descriptionFlex is a portable, small, open source, cross-platform and very fast lexical analyzer written in the C/C++ progra...