Hi all,

I have a problem when I am doing a function call with unknown number of
parameters.

suppose when I am writing grammar for sum of listed elements(no of elements
not fixed i mean an array of elements)
my code

functionCall :   'sum'  '(' arg=expr {arguments=list();
arguments.append($arg.value); }  (',' e=expr {arguments.append($e.value);})*
 ')' { print  sum(arguments);};

this works fine with               sum(1,2,3)
and also works fine with        sum(1,2,3,)


but the next statemnts(  let sum(2,3,4) .... )are not getting executed
because of the extra comma present in the second function call sum. i mean
interpreter is exiting.
I am not able to find solution.
plz help me

Thanks in Advance
Siva

--

You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to