Flex (lexical analyser generator)

Flex (fast lexical analyzer generator) is a free and open-source software alternative to lex.

[10] Flex was written in C around 1987[1] by Vern Paxson, with the help of many ideas and much inspiration from Van Jacobson.

The fast table representation is a partial implementation of a design done by Van Jacobson.

', ':=', '<', '<=', '<>', '>', '>='; numbers: 0-9 {0-9}; identifiers: a-zA-Z {a-zA-Z0-9} and keywords: begin, call, const, do, end, if, odd, procedure, then, var, while.

These programs perform character parsing and tokenizing via the use of a deterministic finite automaton (DFA).

In this case, the programmer has explicitly told Flex to "go back and try again" after it has already matched some input.

The REJECT feature is not enabled by default, and because of its performance implications its use is discouraged in the Flex manual.

Another issue is the call to isatty (a Unix library function), which can be found in the generated code.

This can be useful in embedded and similar situations where traditional operating system or C runtime facilities may not be available.