public class ControlFlowGraph
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> |
convertedTreeLookup
Map from AST
Tree s to post-conversion Node s. |
protected SpecialBlock |
entryBlock
The entry block of the control flow graph.
|
protected SpecialBlock |
exceptionalExitBlock
The exceptional exit block of the control flow graph.
|
protected java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.List<com.sun.source.tree.Tree>> |
generatedTreesLookupMap
Map from AST
Tree s to generated Tree s. |
protected SpecialBlock |
regularExitBlock
The regular exit block of the control flow graph.
|
protected java.util.List<ReturnNode> |
returnNodes
All return nodes (if any) encountered.
|
protected java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> |
treeLookup
Maps from AST
Tree s to Node s. |
protected java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> |
unaryAssignNodeLookup
Map from AST
UnaryTree s to corresponding AssignmentNode s. |
protected UnderlyingAST |
underlyingAST
The AST this CFG corresponds to.
|
Constructor and Description |
---|
ControlFlowGraph(SpecialBlock entryBlock,
SpecialBlockImpl regularExitBlock,
SpecialBlockImpl exceptionalExitBlock,
UnderlyingAST underlyingAST,
java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> treeLookup,
java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> convertedTreeLookup,
java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> unaryAssignNodeLookup,
java.util.List<ReturnNode> returnNodes,
java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.List<com.sun.source.tree.Tree>> generatedTreesLookupMap) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<Block> |
getAllBlocks() |
@Nullable com.sun.source.tree.ClassTree |
getContainingClass(com.sun.source.tree.Tree t)
|
@Nullable com.sun.source.tree.MethodTree |
getContainingMethod(com.sun.source.tree.Tree t)
|
java.util.List<Block> |
getDepthFirstOrderedBlocks() |
SpecialBlock |
getEntryBlock() |
SpecialBlock |
getExceptionalExitBlock() |
java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.List<com.sun.source.tree.Tree>> |
getGeneratedTreesLookup() |
Node |
getNodeCorrespondingToTree(com.sun.source.tree.Tree t) |
SpecialBlock |
getRegularExitBlock() |
java.util.List<ReturnNode> |
getReturnNodes() |
java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> |
getTreeLookup() |
java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> |
getUnaryAssignNodeLookup() |
UnderlyingAST |
getUnderlyingAST() |
protected final SpecialBlock entryBlock
protected final SpecialBlock regularExitBlock
protected final SpecialBlock exceptionalExitBlock
protected UnderlyingAST underlyingAST
protected java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> treeLookup
Tree
s to Node
s. Every Tree that produces a value will have at
least one corresponding Node. Trees that undergo conversions, such as boxing or unboxing, can
map to two distinct Nodes. The Node for the pre-conversion value is stored in treeLookup,
while the Node for the post-conversion value is stored in convertedTreeLookup.protected java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> convertedTreeLookup
Tree
s to post-conversion Node
s.protected java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> unaryAssignNodeLookup
UnaryTree
s to corresponding AssignmentNode
s.protected final java.util.List<ReturnNode> returnNodes
protected final java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.List<com.sun.source.tree.Tree>> generatedTreesLookupMap
Tree
s to generated Tree
s.public ControlFlowGraph(SpecialBlock entryBlock, SpecialBlockImpl regularExitBlock, SpecialBlockImpl exceptionalExitBlock, UnderlyingAST underlyingAST, java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> treeLookup, java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> convertedTreeLookup, java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> unaryAssignNodeLookup, java.util.List<ReturnNode> returnNodes, java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.List<com.sun.source.tree.Tree>> generatedTreesLookupMap)
public Node getNodeCorrespondingToTree(com.sun.source.tree.Tree t)
Node
to which the Tree
t
corresponds.public SpecialBlock getEntryBlock()
public java.util.List<ReturnNode> getReturnNodes()
public SpecialBlock getRegularExitBlock()
public SpecialBlock getExceptionalExitBlock()
public UnderlyingAST getUnderlyingAST()
public java.util.Set<Block> getAllBlocks()
public java.util.List<Block> getDepthFirstOrderedBlocks()
Blocks may appear more than once in the sequence.
public java.util.IdentityHashMap<com.sun.source.tree.Tree,Node> getTreeLookup()
public java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> getUnaryAssignNodeLookup()
public java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.List<com.sun.source.tree.Tree>> getGeneratedTreesLookup()
Tree
s from Tree
public @Nullable com.sun.source.tree.MethodTree getContainingMethod(com.sun.source.tree.Tree t)
public @Nullable com.sun.source.tree.ClassTree getContainingClass(com.sun.source.tree.Tree t)