1 19 20 package soot.javaToJimple.jj.ast; 21 22 import polyglot.ast.*; 23 import polyglot.visit.*; 24 import polyglot.ext.jl.ast.*; 25 import polyglot.types.*; 26 import polyglot.util.*; 27 28 public class JjCast_c extends Cast_c { 29 30 public JjCast_c(Position pos, TypeNode castType, Expr expr){ 31 super(pos, castType, expr); 32 } 33 34 public Type childExpectedType(Expr child, AscriptionVisitor av){ 35 TypeSystem ts = av.typeSystem(); 36 37 if (child == expr) { 38 if (castType.type().isReference()) { 39 return ts.Object(); 40 } 41 else if (castType.type().isNumeric()) { 42 return castType.type(); 43 } 45 else if (castType.type().isBoolean()) { 46 return ts.Boolean(); 47 } 48 } 49 50 return child.type(); 51 52 53 } 54 } 55 | Popular Tags |