At 15:57 21/10/2008, Shaun Bogan wrote:
>squarecall
> : (SQUARELEFT (statementnocolon (',' statementnocolon)*)?
>SQUARERIGHT)-> statementnocolon*
> ;
If the problem really is in this rule, then try:
squarecall
: SQUARELEFT (a+=statementnocolon
(',' a+=statementnocolon)*)? SQUARERIGHT
-> $a*
;
(I can never remember if that $ is supposed to be there or not,
though.)
However I think it's much more likely that the problem is not with
this rule itself but rather with the rule that calls this. I bet
you're doing something like this:
... squarecall ... -> ... squarecall ...
Since squarecall can produce an empty tree, you need to use this
instead:
... squarecall ... -> ... squarecall? ...
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---