[antlr-interest] flat AST tree

Torsten Curdt tcurdt at vafer.org
Sun Aug 24 05:30:31 PDT 2008


On Aug 24, 2008, at 13:45, Gavin Lambert wrote:

> At 23:32 24/08/2008, Torsten Curdt wrote:
> >Well, of course there is an implicit hierarchy
> >
> >  ruleA: ruleB;
> >
> >  ruleB: ruleC;
> >
> >Is basically:
> >
> >  ruleA -> ruleB -> ruleC
> >
> >That is what ANTLRWorks is displaying and that is what I expected
> >the AST to be. That it might not be the desired final structure -
> >but that's a different thing.
>
> That's a parse tree, though, not an AST.  An AST can only be built  
> from tokens, and parser rules aren't tokens.

Hm ...so what is the tree that ANTLRWorks shows when you use the  
interpreter? That tree has the rules and tokens in there.

This time I might actually get away by using action instead of going  
through a dedicated AST. But would be nice to get clarified what the  
tree in ANTLRWorks actually shows.

cheers
--
Torsten


More information about the antlr-interest mailing list