[antlr-interest] rule += output option error...

Pady Srinivasan padysrini at hotmail.com
Thu Jan 1 08:30:28 PST 2009


Got around it ( by an idea from another user here...Hendrik Maryns )...

expressionList returns [List exprLst]

@init { $exprLst = new ArrayList(); }

: ( e=expression { $exprLst.add($e.val); } )+

;



Thx



-- pady

----- Original Message ----- 
From: "Pady Srinivasan" <padysrini at hotmail.com>
To: <antlr-interest at antlr.org>
Sent: Thursday, January 01, 2009 10:59 AM
Subject: [antlr-interest] rule += output option error...


>
> I have a simple rule that returns a list...i get an error when 
> compiling...
>
> expressionList returns [ List exprLst ]
>    :   e+=expression+  { $exprLst = $e; }
>    ;
>
> expression returns [int type, String val]
> ..
> error(134): GwfWalker.g:90:9: rule '+=' list labels are not allowed w/o
> output option: e
>
>
>
> Thx
>
> -- pady
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address 



More information about the antlr-interest mailing list