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 abstract class BitwiseExpr extends Binary implements Cloneable {
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
}
public void flushCollectionCache() {
super.flushCollectionCache();
}
@SuppressWarnings({"unchecked", "cast"}) public BitwiseExpr clone() throws CloneNotSupportedException {
BitwiseExpr node = (BitwiseExpr)super.clone();
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
// Declared in TypeCheck.jrag at line 192
// 15.22
public void typeCheck() {
TypeDecl left = getLeftOperand().type();
TypeDecl right = getRightOperand().type();
if(left.isIntegralType() && right.isIntegralType())
return;
else if(left.isBoolean() && right.isBoolean())
return;
else
error(left.typeName() + " is not compatible with " + right.typeName());
}
// Declared in java.ast at line 3
// Declared in java.ast line 169
public BitwiseExpr() {
super();
}
// Declared in java.ast at line 10
// Declared in java.ast line 169
public BitwiseExpr(Expr p0, Expr p1) {
setChild(p0, 0);
setChild(p1, 1);
}
// Declared in java.ast at line 15
protected int numChildren() {
return 2;
}
// Declared in java.ast at line 18
public boolean mayHaveRewrite() {
return false;
}
// Declared in java.ast at line 2
// Declared in java.ast line 153
public void setLeftOperand(Expr node) {
setChild(node, 0);
}
// Declared in java.ast at line 5
public Expr getLeftOperand() {
return (Expr)getChild(0);
}
// Declared in java.ast at line 9
public Expr getLeftOperandNoTransform() {
return (Expr)getChildNoTransform(0);
}
// Declared in java.ast at line 2
// Declared in java.ast line 153
public void setRightOperand(Expr node) {
setChild(node, 1);
}
// Declared in java.ast at line 5
public Expr getRightOperand() {
return (Expr)getChild(1);
}
// Declared in java.ast at line 9
public Expr getRightOperandNoTransform() {
return (Expr)getChildNoTransform(1);
}
protected boolean type_computed = false;
protected TypeDecl type_value;
// Declared in TypeAnalysis.jrag at line 350
@SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed)
type_computed = true;
return type_value;
}
private TypeDecl type_compute() {
if(getLeftOperand().type().isIntegralType() && getRightOperand().type().isIntegralType())
// 15.22.1
return getLeftOperand().type().binaryNumericPromotion(getRightOperand().type());
else if(getLeftOperand().type().isBoolean() && getRightOperand().type().isBoolean())
// 15.22.2
return typeBoolean();
return unknownType();
}
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}