[antlr-interest] Summing values from "+="

Des Hartman des at deshartman.com
Thu Feb 12 03:22:36 PST 2009


I have a simple function to sum values, where expression is numbers with
operands, etc.

sumStat    :    'SUM' '('  (e+=expression (',' e+=expression)+) ')' ->
^('SUM' $e);

What I need to know is how I write the action statements to add the various
numbers? Just to complicate it I am doing it using Flex ActionScript? If I
understand it correctly += returns a Java List, so what would be returned
with ActionScript?

^('SUM' e=expression) {$value =??????;}

Thanks
Des
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090212/25f43fa1/attachment.html 


More information about the antlr-interest mailing list