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 JjUnary_c extends Unary_c { 29 30 public JjUnary_c(Position pos, Unary.Operator op, Expr expr){ 31 super(pos, op, expr); 32 } 33 34 public Type childExpectedType(Expr child, AscriptionVisitor av){ 35 TypeSystem ts = av.typeSystem(); 36 37 if (child == expr) { 38 if (op == POST_INC || op == POST_DEC || 39 op == PRE_INC || op == PRE_DEC) { 40 return child.type(); 44 } 45 else if (op == NEG || op == POS) { 46 return child.type(); 50 } 51 else if (op == BIT_NOT) { 52 return child.type(); 56 } 57 else if (op == NOT) { 58 return ts.Boolean(); 59 } 60 } 61 62 return child.type(); 63 64 65 } 66 } 67 | Popular Tags |