http://invisible-island.net/
Copyright © 2008-2022,2024 by Thomas E. Dickey


Synopsis

This is a variant of the flex fast lexical scanner.

History

Flex was written in the early 1990s by Verne Paxson.

Originally written in K&R C, I have modified it to conform to ANSI C, and made other improvements, but kept it compatible with Paxson's 2.5.4 release (as well as POSIX lex).

Changes

See the "NEWS" file for details:

Documentation


Download

Packages

Other implementations

New flex

There is of course another variation, which I've not found to be compatible with either flex 2.5.4 or POSIX lex. More specifically:

Furthermore, irritants such as compiler warnings remained unfixed after more than ten years. That is just one aspect of the K&R relics which still remain in that version (including one which causes it to mishandle locales).

However—keeping in mind that it is more well-known, this version by default installs as reflex. I have some ideas for extended relocalization (hence the choice of name), and needed an up-to-date version of flex to use as a basis.

RE/flex

Other programs may use the name flex, but be even less compatible. One (see this) ignores the POSIX description of lex

The lex utility shall generate C programs to be used in lexical processing of character input, and that can be used as an interface to yacc. The C programs shall be generated from lex source code and conform to the ISO C standard, without depending on any undefined, unspecified, or implementation-defined behavior, except in cases where the code is copied directly from the supplied source, or in cases that are documented by the implementation.

by generating C++ programs, while its documentation claims

IEEE POSIX P1003.2 standard compliant (like Lex and Flex);

Additionally, because it fails to parse several of the lexers for vile, that claim about POSIX is demonstrably untrue.