Looking at the structure of a production rule in MGrammar (and other grammar grammars such as antlr3 and OMeta), there are (at most) 3 columns: the rule's name, the specification of the rule's production pattern, and the specification of the output/projection.When thinking about all the things a language services programmer wants to encode in a grammar, there is a component missing, and that is a validity rule column, or a verification specification, which would express how to validate the result of the parse in a non-local manner. The most simple example of this is symbol table lookup, though it can even go as complex as type checking. It would be very elegant to be able to express such "hooks", declaratively, directly in the MGrammar. Perhaps as a 3rd column inserted before the projection column. As to how to denote it... perhaps a symbol such as "?>" or "=?"... and as to the syntax of the expression itself... a C# lambda expression Func<bool>, or some mini-language not quite as expressive.Also, such predicates could be placed inline with the rule itself (as rules with success/failure but not necessarily with any meaningful MGraph output), as OMeta does it. for example:syntax Rule1 = ( stuff:Token1+ &?( stuff.Count == 7 ) | stuff:Token1+ &?( stuff[0] == "Hello" );
What distribution are you using?