public override Node VisitBinaryOperation(TParser.BinaryOperationContext context) { var left = context.expression(0); var right = context.expression(1); var op = context.children[1].GetText(); return(new BinaryOperation(Visit(left), op, Visit(right), context.Start)); }
/// <summary> /// Visit a parse tree produced by the <c>BinaryOperation</c> /// labeled alternative in <see cref="TParser.expression"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitBinaryOperation([NotNull] TParser.BinaryOperationContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by the <c>BinaryOperation</c> /// labeled alternative in <see cref="TParser.expression"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitBinaryOperation([NotNull] TParser.BinaryOperationContext context) { }