[antlr-interest] += Output Option clarification

Terence Parr parrt at cs.usfca.edu
Tue Apr 3 18:29:35 PDT 2007


On Apr 3, 2007, at 9:57 AM, bryce.alcock at sungard.com wrote:

>
> I get the following error in my TreeWalker Grammar file:
>
> error(134): ExprWalker.g:43:14: rule '+=' list labels are not  
> allowed w/o output option: lids

Hi. I decided that += only makes sense to track templates or ASTs.   
If the rule returns ints, for example, should I make an int list or  
text of rule?  As it's ambig, i decided to only have it make sense  
for output option.

Ter

>
> I noticed the release notes state the following:

> Here is what i am trying to do:
>
> compoundExpr returns [int value] :
>         ^(COMPOUND (lids+=condExpr)+ )
>         {
>                              ..........
>                 };

what does condExpr return?


Ter


More information about the antlr-interest mailing list