[antlr-interest] Question regarding "Assignment"

Dennis Brothers brothers at bros.com
Tue Mar 24 05:05:57 PDT 2009


FWIW, I had a similar experience - I expected a=(FOO | BAR | BAZ) to  
assign whichever token matched to a; as you observed there was no  
assignment.  (a=FOO | a=BAR | a=BAZ) did what I wanted.

     - Dennis Brothers

On Mar 24, 2009, at 4:07 AM, Lucien Antlr wrote:

> Hi folks,
>
> Still wrestling with the ins and outs of the tool, I came up with  
> something I expected to work but that didn't.
>
> I expected lab=(EQ expr) to assign the AST to "lab", but rather it  
> always returns a null.
>
> The equivalent  working statement would be either
> 1)    (labA=EQ labB=expr) -> ^($labA $labB)
> or
> 2)  newRule:   EQ expr;
>    (lab=newRule) -> ^($lab)
>
> Is it a bug that grouping through ( ) doesn't work when assigning to  
> a label?
>
> Cheers,
> Luc
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090324/7bff4ded/attachment.html 


More information about the antlr-interest mailing list