Syntax

A Quex input file is divided into several ‘top-level’ sections. Every top-level section is identified by its section name followed by content in curly braces, as shown in the scheme below.

section-name {
    ...
}

This chapter the three aspects of lexical analyzer definition in terms of these top-level sections, namely:

  • Behavior Mandatory specification of behavior.

The behavior of a lexical analyzer defines how events in the input stream produce tokens as output. It is the essential part of a lexical analyzer specification. The remaining two sections discuss optional adaptions.

As an introduction, section syntax-number-format describes the number format which is used in many locations. These categories circumscribe the top-level sections in a Quex source file. In the following, abbreviations are used for generated classes and types. LEXATOM shall represent the type which carries a lexatom. LEXER shall represent the generated lexical analyzer class. MODE is the base class of all generated modes. SIZE is the type used to represent sizes (e.g. size_t in C99).