[antlr-interest] A postmortem of my use of antler

Guntis Ozols guntiso at latnet.lv
Tue Mar 11 15:13:48 PDT 2008


> >> how could ANTLR *possibly* know the structure of the AST to build
> >> except for, perhaps, expressions? parse tree, yes. AST, no.
> > How about have the AST just match the parse tree by default?
>
> Because then you add one ^ or -> rewrite and what should it do?  Give
> you a hybrid?  That just wouldn't be useful.  If you want a parse tree
> use it.
>
> Ter

How about enabling ^ on the left side?

^rule : stuff;

could be very nice shortcut for

tokens {
  RULE;
}

rule : stuff -> ^(RULE stuff);



More information about the antlr-interest mailing list