public override Node VisitComp([NotNull] coolgrammarParser.CompContext context) { Expr l = (Expr)Visit(context.expr(0)); Expr r = (Expr)Visit(context.expr(1)); return(new BinaryExpr(l, r, context.op.Text)); }
/// <summary> /// Visit a parse tree produced by the <c>comp</c> /// labeled alternative in <see cref="coolgrammarParser.expr"/>. /// <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 VisitComp([NotNull] coolgrammarParser.CompContext context) { return(VisitChildren(context)); }