public int Visit(InstanceOfExpression expression) { _writer.Write("("); expression.Left.Accept(this); _writer.Write(" instanceof "); var typeName = expression.Type.ToString(); switch (typeName) { case "int": typeName = "Integer"; break; case "float": typeName = "Float"; break; case "boolean": typeName = "Boolean"; break; } _writer.Write(typeName); _writer.Write(")"); return(0); }
protected void addCast(InstanceOfExpression cast) { if (this.castCounts.length() > 0) { cast.implicitCasts = new List <CastExpression>(); this.casts.push(cast); var last = this.castCounts.length() - 1; this.castCounts.set(last, this.castCounts.get(last) + 1); } }
public object VisitInstanceOf(InstanceOfExpression node) { var value = node.Target.Accept(this); if (value is null && node.TypeSyntax is RefTypeSyntax refType && refType.Name.Equals("null")) { return(Boolean.True); } var type = node.TypeSyntax.ResolveType(TypeContext); var valueType = value.GetType(); if (TypeUtils.AreReferenceAssignable(type, valueType)) { return(Boolean.True); } return(Boolean.False); }
public Expression VisitInstanceOf(InstanceOfExpression node) { node.Target.Accept(this); return(node); }
public override void Visit(InstanceOfExpression node) { Visit((BinaryExpression)node); }
public override void Visit(InstanceOfExpression node) { unfinishedClone = new InstanceOfExpression(GetCloneOf(node.Left), GetCloneOf(node.Right)); base.Visit(node); }
public override void Visit(InstanceOfExpression node) { UpdateType(node, TypeCalculator.GetType(node)); }
public override void Visit(InstanceOfExpression node) { AssignToImplicitReturn(node); }