%token statement declares a terminal symbol (a token)
which is not a keyword.
Respectively declare one token with an optional type, and a match value, or several tokens with the optional same type, and no match value.
- Is an optional symbol, enclosed between
>, that specifies (and implicitly declares) a type for this token (see type Decl). If omitted the token has no type.
- Is the terminal symbol used in grammar rules to represent this token.
- Is an optional string. Depending on type-name properties, it will be interpreted as an ordinary string, a regular expression, or have a more elaborate meaning. If omitted the match value will be
nil, which means that this token will be considered as the default token of its type (see type Decl for more information).
In the generated library, token definitions are stored in the table of declared types (see type Decl).