use of soot.util.IterableSet in project soot by Sable.
the class SETNode method find_AbruptEdges.
public void find_AbruptEdges(AbruptEdgeFinder aef) {
Iterator<IterableSet> sbit = subBodies.iterator();
while (sbit.hasNext()) {
IterableSet body = sbit.next();
IterableSet children = body2childChain.get(body);
Iterator cit = children.iterator();
while (cit.hasNext()) ((SETNode) cit.next()).find_AbruptEdges(aef);
aef.find_Continues(this, body, children);
}
sbit = subBodies.iterator();
while (sbit.hasNext()) {
IterableSet children = body2childChain.get(sbit.next());
Iterator cit = children.iterator();
if (cit.hasNext()) {
SETNode cur = (SETNode) cit.next(), prev = null;
while (cit.hasNext()) {
prev = cur;
cur = (SETNode) cit.next();
aef.find_Breaks(prev, cur);
}
}
}
}
use of soot.util.IterableSet in project soot by Sable.
the class SETNode method find_StatementSequences.
public void find_StatementSequences(SequenceFinder sf, DavaBody davaBody) {
Iterator<IterableSet> sbit = subBodies.iterator();
while (sbit.hasNext()) {
IterableSet body = sbit.next();
IterableSet children = body2childChain.get(body);
HashSet<AugmentedStmt> childUnion = new HashSet<AugmentedStmt>();
Iterator cit = children.iterator();
while (cit.hasNext()) {
SETNode child = (SETNode) cit.next();
child.find_StatementSequences(sf, davaBody);
childUnion.addAll(child.get_Body());
}
sf.find_StatementSequences(this, body, childUnion, davaBody);
}
}
use of soot.util.IterableSet in project soot by Sable.
the class SETNode method find_SmallestSETNode.
/*
* Tree traversing utilities.
*/
public void find_SmallestSETNode(AugmentedStmt as) {
Iterator<IterableSet> sbit = subBodies.iterator();
while (sbit.hasNext()) {
Iterator it = body2childChain.get(sbit.next()).iterator();
while (it.hasNext()) {
SETNode child = (SETNode) it.next();
if (child.contains(as)) {
child.find_SmallestSETNode(as);
return;
}
}
}
as.myNode = this;
}
use of soot.util.IterableSet in project soot by Sable.
the class SETNode method nest.
public boolean nest(SETNode other) {
if (other.resolve(this) == false)
return false;
IterableSet otherBody = other.get_Body();
Iterator<IterableSet> sbit = subBodies.iterator();
while (sbit.hasNext()) {
IterableSet subBody = sbit.next();
if (subBody.intersects(otherBody)) {
IterableSet childChain = body2childChain.get(subBody);
Iterator ccit = childChain.snapshotIterator();
while (ccit.hasNext()) {
SETNode curChild = (SETNode) ccit.next();
IterableSet childBody = curChild.get_Body();
if (childBody.intersects(otherBody)) {
if (childBody.isSupersetOf(otherBody))
return curChild.nest(other);
else {
remove_Child(curChild, childChain);
Iterator<IterableSet> osbit = other.subBodies.iterator();
while (osbit.hasNext()) {
IterableSet otherSubBody = osbit.next();
if (otherSubBody.isSupersetOf(childBody)) {
other.add_Child(curChild, other.get_Body2ChildChain().get(otherSubBody));
break;
}
}
}
}
}
add_Child(other, childChain);
}
}
return true;
}
use of soot.util.IterableSet in project soot by Sable.
the class DVariableDeclarationStmt method toString.
public void toString(UnitPrinter up) {
if (declarations.size() == 0)
return;
if (!(up instanceof DavaUnitPrinter))
throw new RuntimeException("DavaBody should always be printed using the DavaUnitPrinter");
else {
DavaUnitPrinter dup = (DavaUnitPrinter) up;
String type = declarationType.toString();
if (type.equals("null_type"))
dup.printString("Object");
else {
IterableSet importSet = davaBody.getImportList();
if (!importSet.contains(type))
davaBody.addToImportList(type);
type = RemoveFullyQualifiedName.getReducedName(davaBody.getImportList(), type, declarationType);
dup.printString(type);
}
dup.printString(" ");
Iterator decIt = declarations.iterator();
while (decIt.hasNext()) {
Local tempDec = (Local) decIt.next();
dup.printString(tempDec.getName());
if (decIt.hasNext())
dup.printString(", ");
}
}
}
Aggregations