public override void VisitAdd(ASTAdd n) { SetupOperands(n); //pop 2 numbers, add, push result _gen.Emit(OpCodes.Add); }
/// <summary> /// Binary operators are not supported for classes, only primatives. /// </summary> /// <param name="n"></param> public override void VisitAdd(ASTAdd n) { CFlatType lhs = CheckSubTree(n.Left); CFlatType rhs = CheckSubTree(n.Right); if (lhs.IsNumeric && rhs.IsNumeric) { _lastSeenType = n.CFlatType = Supertype(lhs, rhs); } else { ReportError(n.Location, "Invalid operands for addition. Got types '{0}' and '{1}'.", TypeToFriendlyName(lhs), TypeToFriendlyName(rhs)); } }
protected override bool Visit(ASTAdd node) => EmitBinary <CAdd>(node);
protected override bool Visit(ASTAdd node) => VisitArethetic(node);
public bool Visit(ASTAdd node) { throw new NotImplementedException(); }
protected abstract bool Visit(ASTAdd node);