Lex (software)

Lex is a computer program that generates lexical analyzers ("scanners" or "lexers").

[6][7] In the following years, Lex became standard lexical analyzer generator on many Unix and Unix-like systems.

One popular open-source version of Lex, called flex, or the "fast lexical analyzer", is not derived from proprietary coding.

For example, given the input: the program will print: Lex, as with other lexical analyzers, limits rules to those which can be described by regular expressions.

Due to this, Lex can be implemented by a finite-state automata as shown by the Chomsky hierarchy of languages.