Collection of unique non-terminals?

Aug 26, 2013 at 2:09 PM
Hi All,

Is there a way to construct a collection of non-terminals such that each terminal can appear in any order but can only appear once?

Aug 26, 2013 at 6:08 PM
there's no such facility out of the box, but I admit I'been thinking it might be useful. But what's stopping me there is the consideration that often this 'unique' constraint is paired with resrtictions on order - like in c# 'partial' should be the last attr, immediately before 'class' keyword; plus some attrs are mutually incompatible - so it would be nice to come up with some way of specifying all such restrictions in grammar, without adding custom code.
And with custom code - you can hook to Reduced event of non-terminal and run validation routine