package Analysis.SSJava;
import IR.ClassDescriptor;
+import IR.TypeExtension;
-public class Location {
+public class Location implements TypeExtension {
public static final int TOP = 1;
public static final int NORMAL = 2;
public static final int BOTTOM = 3;
+ public static final int DELTA = 4;
int type;
ClassDescriptor cd;
if (loc.getClassDescriptor().equals(getClassDescriptor())) {
if (loc.getLocIdentifier() == null || getLocIdentifier() == null) {
- if (loc.getType() == getType()) {
- return true;
- }
+ if (loc.getType() == getType()) {
+ return true;
+ }
} else {
- if (loc.getLocIdentifier().equals(getLocIdentifier())) {
- return true;
- }
+ if (loc.getLocIdentifier().equals(getLocIdentifier())) {
+ return true;
+ }
}
}
return "Loc[" + cd.getSymbol() + "." + loc + "]";
}
+ public static Location createTopLocation(ClassDescriptor cd) {
+ Location topLoc = new Location(cd);
+ topLoc.setType(TOP);
+ topLoc.loc = "_top_";
+ return topLoc;
+ }
+
+ public static Location createBottomLocation(ClassDescriptor cd) {
+ Location bottomLoc = new Location(cd);
+ bottomLoc.setType(BOTTOM);
+ bottomLoc.loc = "_bottom_";
+ return bottomLoc;
+ }
+
+ public boolean isTop() {
+ return type==TOP;
+ }
+
}