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