Okay, I might just be being paranoid, but I wanted to sanity check 
something...

There's a rule "constraint" that matches LPAREN, a potentially unlimited 
number of other things (including nested constraints), then RPAREN. I 
wanted a rule that will match any number of these.

Any LPAREN after a constraint will be the start of another constraint.

So the rule I have is:

constraints : constraint ((LPAREN)=>constraint)* -> ^(CONSTRAINTS 
constraint+) ;

I believe this will match one or more constraints, and make a new 
subtree with each constraint a node under it (potentially being a 
subtree themselvs).

Does this do what I think it does?

NB: constraint+ doesn't work because it can't tell how far to look 
ahead. It has to finish matching one and then see if there's more.

-- 
Sam Barnett-Cormack

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/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
-~----------~----~----~----~------~----~------~--~---

Reply via email to