package soot.JastAddJ; import java.util.HashSet;import java.util.LinkedHashSet;import java.io.File;import java.util.*;import beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;import java.io.FileNotFoundException;import java.util.Collection;import soot.*;import soot.util.*;import soot.jimple.*;import soot.coffi.ClassFile;import soot.coffi.method_info;import soot.coffi.CONSTANT_Utf8_info;import soot.tagkit.SourceFileTag;import soot.coffi.CoffiMethodSource; public class BooleanType extends PrimitiveType implements Cloneable { public void flushCache() { super.flushCache(); boxed_computed = false; boxed_value = null; jvmName_computed = false; jvmName_value = null; getSootType_computed = false; getSootType_value = null; } public void flushCollectionCache() { super.flushCollectionCache(); } @SuppressWarnings({"unchecked", "cast"}) public BooleanType clone() throws CloneNotSupportedException { BooleanType node = (BooleanType)super.clone(); node.boxed_computed = false; node.boxed_value = null; node.jvmName_computed = false; node.jvmName_value = null; node.getSootType_computed = false; node.getSootType_value = null; node.in$Circle(false); node.is$Final(false); return node; } @SuppressWarnings({"unchecked", "cast"}) public BooleanType copy() { try { BooleanType node = (BooleanType)clone(); if(children != null) node.children = (ASTNode[])children.clone(); return node; } catch (CloneNotSupportedException e) { } System.err.println("Error: Could not clone node of type " + getClass().getName() + "!"); return null; } @SuppressWarnings({"unchecked", "cast"}) public BooleanType fullCopy() { BooleanType res = (BooleanType)copy(); for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode node = getChildNoTransform(i); if(node != null) node = node.fullCopy(); res.setChild(node, i); } return res; } // Declared in PrettyPrint.jadd at line 830 public void toString(StringBuffer s) { s.append("boolean"); } // Declared in Expressions.jrag at line 45 public static soot.Value emitConstant(boolean b) { return soot.jimple.IntConstant.v(b ? 1 : 0); } // Declared in AutoBoxingCodegen.jrag at line 12 // Code generation for Boxing Conversion public soot.Value emitCastTo(Body b, soot.Value v, TypeDecl type, ASTNode location) { if(type == this) return v; else if(type.unboxed() == this || type.isObject()) return boxed().emitBoxingOperation(b, v, location); else return v; } // Declared in java.ast at line 3 // Declared in java.ast line 51 public BooleanType() { super(); setChild(new Opt(), 1); setChild(new List(), 2); } // Declared in java.ast at line 12 // Declared in java.ast line 51 public BooleanType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); } // Declared in java.ast at line 20 // Declared in java.ast line 51 public BooleanType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); } // Declared in java.ast at line 27 protected int numChildren() { return 3; } // Declared in java.ast at line 30 public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 42 public void setModifiers(Modifiers node) { setChild(node, 0); } // Declared in java.ast at line 5 public Modifiers getModifiers() { return (Modifiers)getChild(0); } // Declared in java.ast at line 9 public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } // Declared in java.ast at line 2 // Declared in java.ast line 42 public void setID(String value) { tokenString_ID = value; } // Declared in java.ast at line 5 public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } // Declared in java.ast at line 12 public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } // Declared in java.ast at line 2 // Declared in java.ast line 42 public void setSuperClassAccessOpt(Opt<Access> opt) { setChild(opt, 1); } // Declared in java.ast at line 6 public boolean hasSuperClassAccess() { return getSuperClassAccessOpt().getNumChild() != 0; } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Access getSuperClassAccess() { return (Access)getSuperClassAccessOpt().getChild(0); } // Declared in java.ast at line 14 public void setSuperClassAccess(Access node) { getSuperClassAccessOpt().setChild(node, 0); } // Declared in java.ast at line 17 @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOpt() { return (Opt<Access>)getChild(1); } // Declared in java.ast at line 21 @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOptNoTransform() { return (Opt<Access>)getChildNoTransform(1); } // Declared in java.ast at line 2 // Declared in java.ast line 42 public void setBodyDeclList(List<BodyDecl> list) { setChild(list, 2); } // Declared in java.ast at line 6 public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } // Declared in java.ast at line 14 public void addBodyDecl(BodyDecl node) { List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); list.addChild(node); } // Declared in java.ast at line 19 public void addBodyDeclNoTransform(BodyDecl node) { List<BodyDecl> list = getBodyDeclListNoTransform(); list.addChild(node); } // Declared in java.ast at line 24 public void setBodyDecl(BodyDecl node, int i) { List<BodyDecl> list = getBodyDeclList(); list.setChild(node, i); } // Declared in java.ast at line 28 public List<BodyDecl> getBodyDecls() { return getBodyDeclList(); } // Declared in java.ast at line 31 public List<BodyDecl> getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } // Declared in java.ast at line 35 @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclList() { List<BodyDecl> list = (List<BodyDecl>)getChild(2); list.getNumChild(); return list; } // Declared in java.ast at line 41 @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclListNoTransform() { return (List<BodyDecl>)getChildNoTransform(2); } // Declared in ConstantExpression.jrag at line 317 @SuppressWarnings({"unchecked", "cast"}) public Constant cast(Constant c) { ASTNode$State state = state(); Constant cast_Constant_value = cast_compute(c); return cast_Constant_value; } private Constant cast_compute(Constant c) { return Constant.create(c.booleanValue()); } // Declared in ConstantExpression.jrag at line 418 @SuppressWarnings({"unchecked", "cast"}) public Constant andBitwise(Constant c1, Constant c2) { ASTNode$State state = state(); Constant andBitwise_Constant_Constant_value = andBitwise_compute(c1, c2); return andBitwise_Constant_Constant_value; } private Constant andBitwise_compute(Constant c1, Constant c2) { return Constant.create(c1.booleanValue() & c2.booleanValue()); } // Declared in ConstantExpression.jrag at line 426 @SuppressWarnings({"unchecked", "cast"}) public Constant xorBitwise(Constant c1, Constant c2) { ASTNode$State state = state(); Constant xorBitwise_Constant_Constant_value = xorBitwise_compute(c1, c2); return xorBitwise_Constant_Constant_value; } private Constant xorBitwise_compute(Constant c1, Constant c2) { return Constant.create(c1.booleanValue() ^ c2.booleanValue()); } // Declared in ConstantExpression.jrag at line 434 @SuppressWarnings({"unchecked", "cast"}) public Constant orBitwise(Constant c1, Constant c2) { ASTNode$State state = state(); Constant orBitwise_Constant_Constant_value = orBitwise_compute(c1, c2); return orBitwise_Constant_Constant_value; } private Constant orBitwise_compute(Constant c1, Constant c2) { return Constant.create(c1.booleanValue() | c2.booleanValue()); } // Declared in ConstantExpression.jrag at line 444 @SuppressWarnings({"unchecked", "cast"}) public Constant questionColon(Constant cond, Constant c1, Constant c2) { ASTNode$State state = state(); Constant questionColon_Constant_Constant_Constant_value = questionColon_compute(cond, c1, c2); return questionColon_Constant_Constant_Constant_value; } private Constant questionColon_compute(Constant cond, Constant c1, Constant c2) { return Constant.create(cond.booleanValue() ? c1.booleanValue() : c2.booleanValue()); } // Declared in ConstantExpression.jrag at line 548 @SuppressWarnings({"unchecked", "cast"}) public boolean eqIsTrue(Expr left, Expr right) { ASTNode$State state = state(); boolean eqIsTrue_Expr_Expr_value = eqIsTrue_compute(left, right); return eqIsTrue_Expr_Expr_value; } private boolean eqIsTrue_compute(Expr left, Expr right) { return left.isTrue() && right.isTrue() || left.isFalse() && right.isFalse(); } // Declared in TypeAnalysis.jrag at line 182 @SuppressWarnings({"unchecked", "cast"}) public boolean isBoolean() { ASTNode$State state = state(); boolean isBoolean_value = isBoolean_compute(); return isBoolean_value; } private boolean isBoolean_compute() { return true; } // Declared in AutoBoxing.jrag at line 36 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl boxed() { if(boxed_computed) { return boxed_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boxed_value = boxed_compute(); if(isFinal && num == state().boundariesCrossed) boxed_computed = true; return boxed_value; } private TypeDecl boxed_compute() { return lookupType("java.lang", "Boolean"); } // Declared in Java2Rewrites.jrag at line 42 @SuppressWarnings({"unchecked", "cast"}) public String jvmName() { if(jvmName_computed) { return jvmName_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); jvmName_value = jvmName_compute(); if(isFinal && num == state().boundariesCrossed) jvmName_computed = true; return jvmName_value; } private String jvmName_compute() { return "Z"; } // Declared in Java2Rewrites.jrag at line 54 @SuppressWarnings({"unchecked", "cast"}) public String primitiveClassName() { ASTNode$State state = state(); String primitiveClassName_value = primitiveClassName_compute(); return primitiveClassName_value; } private String primitiveClassName_compute() { return "Boolean"; } // Declared in EmitJimple.jrag at line 47 @SuppressWarnings({"unchecked", "cast"}) public Type getSootType() { if(getSootType_computed) { return getSootType_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getSootType_value = getSootType_compute(); if(isFinal && num == state().boundariesCrossed) getSootType_computed = true; return getSootType_value; } private Type getSootType_compute() { return soot.BooleanType.v(); } public ASTNode rewriteTo() { return super.rewriteTo(); } }