[antlr-interest] rewrite rule translation to tree grammar

Terence Parr parrt at cs.usfca.edu
Fri Dec 14 12:52:37 PST 2007


hi. that seems incorrect to me.  You can't have a tree as a root  
node.  Imagine creating $qualified_identifier as tree in first subrule  
then making root in (...)*.  Probably not right.
Ter
On Dec 14, 2007, at 12:24 PM, Johannes Luber wrote:

> Hi,
>
> I have the following rule:
>
> qualified_identifier
>   :   (i1=IDENTIFIER -> ^(QUALIFIED_IDENTIFIER $i1))
>       (DOT i2=IDENTIFIER -> ^($qualified_identifier DOT $i2))*
>   ;
>
> But I haven't found an example in TDAR which explains the equivalent
> rule for a tree grammar. Can someone help?
>
> Johannes



More information about the antlr-interest mailing list