Quex
A Mode Oriented Directly Coded Lexical Analyser Generator
Important: For benchmarking compile with option '-DNDEBUG'. Only then the generated engine runs at full speed!
Abstract:
Quex is a lexical analyzer generator that
produces a directly coded lexical analyzer engine. Those engines are much faster than the table
driven engines of the lex/flex family. For convenience, quex parses regular expressions in the
traditional lex/flex style. This way switching from flex to quex is made very easy. In addition
to the fast analyzer engine, quex provides many advanced features, such a 'lexer modes' that can be inherited and that provide events for mode transitions.
Mode transitions can be allowed and disallowed, one can trigger on indentation events, and many parts
of the generated lexical analyzer class can be adorned with own code. For easier handling of token
sequences a fast token queue is implemented that allows to implement lexical analysis directly
from sequence diagrams. Also, quex is based on a dedicated buffer handling strategy that is
webbed into the lexical analyzer to provide optimal performance. The established tool for
character code conversions 'inconv' can also be included into the buffer handling. This way
many different kinds of coding schemes are supported.
Quex produces a complete C++ environment containing the
lexical analyser engine, token classes and token queues. With the
provided sample applications and documentation it should be possible to
get a lexical analyser running within a couple of hours. In
essence, quex allows complicated lexical analysis to be described very
elegantly. At the same time, simple applications can be written much
faster than with traditional lexical analyser generators.
Dowloads:
Documentation (HTML)
Downloads
Project on Sourceforge