[antlr-interest] How to walk a tree with an imaginary root

Jörg Rathlev joerg at jrsoftware.de
Fri Jun 16 06:22:27 PDT 2006


Hi,

> In tree walker,
> 
> ruleAlt
>     :     
>     RULE_ALT graph 
>     ;

I think you have to write:

ruleAlt
    :
    #(RULE_ALT graph)
    ;

because graph is a child of RULE_ALT, not a sibling.

If RULE_ALT really does not have any children, there might be an
additional bug in your "graph" rule or in the tree construction.


Regards,
Joerg



More information about the antlr-interest mailing list