Wednesday, January 4, 2006 09:45 AM
I am relatively new to ANTLR but have used several other parser generators. From a syntactic viewpoint I do not know of a solution but recommend the addition of semantic rules.
a : ((x = b) | (y = c) | (z = d))+
Semantic rules to ensure that x, y and z are *not*
null (assuming that they are object references.)
If it is important that there is exactly one instance
of a, b and c then you will, of course, need to add
additional counting and validation code.