public void ExitExpression(QueryParser.ExpressionContext context) { CompileLeftAssociativeOperator(context.ADD_SUB(), _expressions, (opNode, left, right) => { var op = opNode.Symbol; BinaryOperatorExpression value = null; switch (op.Text) { case "+": value = new AdditionExpression(op.Line, op.Column, left, right); break; case "-": value = new SubtractionExpression(op.Line, op.Column, left, right); break; } Trace.Assert(value != null, "Invalid addition operator " + op.Text); return(value); }); }
/// <summary> /// Exit a parse tree produced by <see cref="QueryParser.expression"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitExpression([NotNull] QueryParser.ExpressionContext context) { }
public void EnterExpression(QueryParser.ExpressionContext context) { }