[antlr-interest] grammar question

mzukowski at yci.com mzukowski at yci.com
Fri Mar 21 15:12:10 PST 2003


Use (a | b | c)+ and then write an action that checks to make sure that you
have exactly one of each.  There is no real "antlr" way of doing this.

Monty

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam at yahoo.com]
Sent: Friday, March 21, 2003 2:57 PM
To: Antlr List
Subject: [antlr-interest] grammar question


If I have a rule that wants one of each of three
subrules matched, is there any shorthand to require
this without imposing order?  The following would be
the long version, I suppose:

top
  : a b c
  | b c a
  | c a b
  | c b a
  | a c b
  | b a c
  ;

-Matt

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list