| 1 |
Syntax: bf(%token-path) tt(pathname) |
| 2 |
|
| 3 |
By default the symbolic tokens defined in the grammar specification are |
| 4 |
collected in the enumeration tt(Tokens_) which is defined in the generated |
| 5 |
parser's base class. This is a suboptimal procedure in cases where these |
| 6 |
tokens are also used by other classes. In those cases the tokens should be |
| 7 |
collected in an escalated class which can be accessed by classes that are |
| 8 |
independent of the generated tt(Parser) class. |
| 9 |
|
| 10 |
The directive tt(%token-path) is used for this: it expects a tt(pathname) path |
| 11 |
specification of the file to contain the tt(struct Tokens) defining the |
| 12 |
enumeration tt(Tokens_) containing the symbolic tokens of the generated |
| 13 |
grammar. If this option is specified the tt(ParserBase) class is derived from |
| 14 |
it, thus making the tokens available to the generated parser class. |
| 15 |
|
| 16 |
The name of the tt(struct Tokens) can be altered using the tt(token-class) |
| 17 |
option. By default (if tt(token_path) is not specified) the tokens are defined |
| 18 |
as the tt(enum Tokens_) in the tt(ParserBase) class. The tt(filenames) and |
| 19 |
tt(target-directory) directive specifications are ignored by tt(token-path). |