1 package polyglot.ext.pao.extension; 2 3 import polyglot.ast.Instanceof; 4 import polyglot.ast.Node; 5 import polyglot.ast.NodeFactory; 6 import polyglot.ext.pao.types.PaoTypeSystem; 7 import polyglot.types.Type; 8 9 13 public class PaoInstanceofExt_c extends PaoExt_c { 14 22 public Node rewrite(PaoTypeSystem ts, NodeFactory nf) { 23 Instanceof n = (Instanceof) node(); 24 Type rtype = n.compareType().type(); 25 26 if (rtype.isPrimitive()) { 27 Type t = ts.boxedType(rtype.toPrimitive()); 28 return n.compareType(nf.CanonicalTypeNode(n.compareType().position(), 29 t)); 30 } 31 32 return n; 33 } 34 } 35 | Popular Tags |