Summary

Table Table 5 summarizes all top-level sections of a source file as input to the lexical analyzer generator.

Table 5 Main sections and their functionality.

Subject

Name

Functionality

Behavior

start = ...;

Defines the initial mode for analysis.

mode { }

Mode definition.

define { }

Pattern definition.

Token

token { }

Definition of token identifiers.

token_type { }

Definition of a token class.

Lexer Class

body { }

Additional content to the lexer’s class.

constructor { }

Additional code to the lexer’s constructor.

reset { }

Additional code to the lexer’s reset function.

destructor { }

Additional code to the lexer’s destructor.

print { }

A print function to print a lexer’s content.

Memento Class

memento { }

Additional content for a lexer’s memento.

memento_pack { }

Code to be executed when a memento is packed.

memento_unpack { }

Code to be executed when a memento is unpacked.

Code

header { }

Code to be pasted at lexer’s file head.

footer { }

Code to be pasted at lexer’s file end.