[antlr-interest] subtrees in tree grammar

Terence Parr parrt at cs.usfca.edu
Thu Jul 19 09:53:26 PDT 2007


because I forgot to implement that.  Just put parens around the tree;  
i.e., (...)?.  Sorry about that.  I have fixed it in the new  
ANTLRv3.g grammar.

Ter
On Jul 19, 2007, at 8:01 AM, Andy Tripp wrote:

> Why does ANTLR complain when I have something like
>
>            ^(IMPLEMENTS typeList)?
>
>  in a tree grammar rule?
>
> Instead, it seems I have to separate out this "optional subtree"  
> into a separate rule:
>        implementsTypeList?
> ...
> implementsTypeList
>     : ^(IMPLEMENTS typeList)
>     ;
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070719/96e4ff44/attachment.html 


More information about the antlr-interest mailing list