public override AST_Node VisitSumsub([NotNull] CoolParser.SumsubContext context) { AST_Expresion l = (AST_Expresion)Visit(context.expr(0)); AST_Expresion r = (AST_Expresion)Visit(context.expr(1)); return(new AST_BinaryOp(context, l, r, context.op)); }
public override int VisitSumsub([NotNull] CoolParser.SumsubContext context) { int s = Visit(context.expr(0)); int t = Visit(context.expr(1)); if (context.op.Type == CoolLexer.ADD) { return(s + t); } return(s - t); }