What is the best parsing rule for an order-independent series of tokens?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Brian_Sanders
Posted On:   Tuesday, October 1, 2002 01:31 PM

My parser uses several rules expressed in the format


A : (X AND Y AND Z) | (X AND Z AND Y) | (Y AND X AND Z)...

where the general constraint is that tokens X, Y, and Z must exist exactly once, but in any order.


Is there a better way to express this constraint?

Re: What is the best parsing rule for an order-independent series of tokens?

Posted By:   Sam_Walker  
Posted On:   Tuesday, October 8, 2002 07:14 AM

How about this...


A: expr AND expr AND expr ;

expr: X | Y | Z ;


-Sam
About | Sitemap | Contact