use of org.jgrapht.traverse.DepthFirstIterator in project jop by jop-devel.
the class CallGraph method getReachableImplementationsSet.
/**
* Retrieve non-abstract methods reachable from the given call graph node.
* All callgraph nodes reachable from nodes representing the given a method are collected
* @param cgNode where to start
* @return a list of all reachable implementations, sorted in DFS order
*/
public Set<MethodInfo> getReachableImplementationsSet(ExecutionContext cgNode) {
Set<MethodInfo> implemented = new LinkedHashSet<MethodInfo>();
DepthFirstIterator<ExecutionContext, ContextEdge> ti = new DepthFirstIterator<ExecutionContext, ContextEdge>(callGraph, cgNode);
ti.setCrossComponentTraversal(false);
while (ti.hasNext()) {
MethodInfo m = ti.next().getMethodInfo();
if (m == null)
throw new AssertionError("Abstract method in callgraph");
implemented.add(m);
}
return implemented;
}
use of org.jgrapht.traverse.DepthFirstIterator in project jop by jop-devel.
the class CallGraph method getReachableImplementationsSet.
/**
* Retrieve non-abstract methods reachable from the given method.
* All callgraph nodes reachable from nodes representing the given a method are collected
*
* @param rootMethod start method
* @return a list of all reachable methods, sorted in topological order
*/
public Set<MethodInfo> getReachableImplementationsSet(MethodInfo rootMethod) {
Set<MethodInfo> implemented = new LinkedHashSet<MethodInfo>();
for (ExecutionContext cgNode : methodNodes.get(rootMethod).getInstances()) {
DepthFirstIterator<ExecutionContext, ContextEdge> ti = new DepthFirstIterator<ExecutionContext, ContextEdge>(callGraph, cgNode);
ti.setCrossComponentTraversal(false);
while (ti.hasNext()) {
MethodInfo m = ti.next().getMethodInfo();
if (m == null)
throw new AssertionError("Abstract method in callgraph");
implemented.add(m);
}
}
return implemented;
}
use of org.jgrapht.traverse.DepthFirstIterator in project candle-decompiler by bradsdavis.
the class InstructionToIntermediateEnhancer method process.
@Override
public void process() {
GraphIterator<InstructionHandle, IntermediateEdge> iterator = new DepthFirstIterator<InstructionHandle, IntermediateEdge>(igc.getGraph());
iterator.addTraversalListener(new InstructionTransversalListener(igc, intermediateContext));
while (iterator.hasNext()) {
iterator.next();
}
}
Aggregations