On Sat, 2008-11-22 at 20:31 -0600, Su Zhang wrote:

> HI everyone,
> 
> the problem is, I want to return a string which includes a regular
> express, like  i1=id1'(' i2=id1 ( ',' i3=id1)* ')', on the left of
> equals are label variables which are not included in the return
> string, and I use the method {String k=','+$i3.text;
> $p=$i1.text+'('+$i2.text + k*+')';} to assemble the return value p,
> but it won't work, it says that the * cannot be applied in this kind
> of express, so does everyone know a method to handle this kind of
> problem?


That's because it can't be applied like that ;-). * means zero or more
instances, so you want to put the action for $i3 within the * construct:

returns [String retStr]
... ( ',' i3=id1  { $retStr += $i3.text; } )* ...

Jim



--~--~---------~--~----~------------~-------~--~----~
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:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address

Reply via email to