High Quality Content by WIKIPEDIA articles! In computer science, lex is
a program that generates lexical analyzers ("scanners" or "lexers"). Lex
is commonly used with the yacc parser generator. Lex, originally written
by Eric Schmidt and Mike Lesk, is the standard lexical analyzer
generator on many Unix systems, and a tool exhibiting its behavior is
specified as part of the POSIX standard. Lex reads an input stream
specifying the lexical analyzer and outputs source code implementing the
lexer in the C programming language. Though traditionally proprietary
software, versions of Lex based on the original AT&T code are
available as open source, as part of systems such as OpenSolaris and
Plan 9 from Bell Labs. Another popular open source version of Lex is
Flex, the "fast lexical analyzer".