[antlr-interest] Beginner question, about syntactic predicates.

Anthony Brenelière abreneliere at telys.com
Wed Feb 5 17:33:34 PST 2003


I have the following rules :

---
entSetAtt
	:	entityComponent (COLON entityComponent)* simpleAttribute
// Alt1
	|	entityComponent (COLON entityComponent)*
// Alt2
;

entityComponent // (supplier WHERE name="Telys")
	:	LPAREN IDENTIFIER CLAUSE RPAREN
	|	IDENTIFIER 
;

simpleAttribute	// .name
	:	DOT IDENTIFIER 
;
---

I have a non-determinism between Alt 1 and Alt2 on the rule entSetAtt.

..but i cannot find a way to predict between alt1 and Alt2, even using
syntactic predictates. The Only difference is the 'simpleAttribute' at
the end of the Alt1.

The following one does not work and i don't know why:
---
entSetAtt
	:	(simpleAttribute)=> entityComponent (COLON
entityComponent)* simpleAttribute
	|	entityComponent (COLON entityComponent)*
;
---

Any answer is welcome,

Cheers,
Anthony!


 

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



More information about the antlr-interest mailing list