1 19 20 package soot.dava.internal.javaRep; 21 22 import soot.*; 23 import soot.grimp.*; 24 import soot.jimple.*; 25 import soot.jimple.internal.*; 26 27 public class DLengthExpr extends AbstractLengthExpr implements Precedence 28 { 29 public DLengthExpr(Value op) 30 { 31 super(Grimp.v().newObjExprBox(op)); 32 } 33 34 public int getPrecedence() { return 950; } 35 36 public Object clone() 37 { 38 return new DLengthExpr(Grimp.cloneIfNecessary(getOp())); 39 } 40 41 public void toString( UnitPrinter up ) { 42 if( PrecedenceTest.needsBrackets( getOpBox(), this ) ) up.literal("("); 43 getOpBox().toString(up); 44 if( PrecedenceTest.needsBrackets( getOpBox(), this ) ) up.literal(")"); 45 up.literal("."); 46 up.literal("length"); 47 } 48 49 public String toString() 50 { 51 StringBuffer b = new StringBuffer (); 52 if( PrecedenceTest.needsBrackets( getOpBox(), this ) ) b.append("("); 53 b.append(getOpBox().getValue().toString()); 54 if( PrecedenceTest.needsBrackets( getOpBox(), this ) ) b.append(")"); 55 b.append(".length"); 56 57 return b.toString(); 58 } 59 } 60 | Popular Tags |