[antlr-interest] creating root nodes in rules

Martin Probst mail at martin-probst.com
Wed Jul 27 01:14:04 PDT 2005


Hi,

> I need to create a new node and then make it the root exactly like DOT
> is made root in the previous alternative. Any idead how this can be
> done?

You can use ## or #rule_name to refer to the current AST root (of this
subrule) and assign to it: ## = #[FOO,'bar'];

Martin



More information about the antlr-interest mailing list