
In SimpleGrammar.cs of the GettingStarted04d Quickstart, the result of an AstFrom function is assigned to a BinaryOperatorExpression.Operator property. The types are incompatible, and debugging suggests that the assignment simply fails to execute without throwing an exception.
additiveExpression.Production = multiplicativeExpression["leftexp"] + ((@addition | @subtraction).SetLabel("op") + additiveExpression["rightexp"].OnErrorContinue()).Optional() > AstConditional<BinaryOperatorExpression>(AstFrom("leftexp"), AstFrom("rightexp")) .SetProperty(e => e.Operator, AstFrom("op")) .SetProperty(e => e.LeftExpression, AstFrom("leftexp")) .SetProperty(e => e.RightExpression, AstFrom("rightexp"));
I'm trying to figure out how to accomplish this--set the operator property based on the actual operator used (either addition of subtraction) in the binary expression.