public class ControlFlowGraph
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.Set<Node>> |
convertedTreeLookup
Map from AST
Tree s to post-conversion sets of Node s. |
protected java.util.List<com.sun.source.tree.ClassTree> |
declaredClasses
Class declarations that have been encountered when building the control-flow graph for a
method.
|
protected java.util.List<com.sun.source.tree.LambdaExpressionTree> |
declaredLambdas
Lambdas encountered when building the control-flow graph for a method, variable initializer,
or initializer.
|
protected SpecialBlock |
entryBlock
The entry block of the control flow graph.
|
protected SpecialBlock |
exceptionalExitBlock
The exceptional exit block of the control flow graph.
|
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,java.util.Set<Node>> |
treeLookup
Maps from AST
Tree s to sets of 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,java.util.Set<Node>> treeLookup,
java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.Set<Node>> convertedTreeLookup,
java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> unaryAssignNodeLookup,
java.util.List<ReturnNode> returnNodes,
java.util.List<com.sun.source.tree.ClassTree> declaredClasses,
java.util.List<com.sun.source.tree.LambdaExpressionTree> declaredLambdas) |
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<com.sun.source.tree.ClassTree> |
getDeclaredClasses() |
java.util.List<com.sun.source.tree.LambdaExpressionTree> |
getDeclaredLambdas() |
java.util.List<Block> |
getDepthFirstOrderedBlocks() |
SpecialBlock |
getEntryBlock() |
SpecialBlock |
getExceptionalExitBlock() |
java.util.Set<Node> |
getNodesCorrespondingToTree(com.sun.source.tree.Tree t) |
SpecialBlock |
getRegularExitBlock() |
java.util.List<ReturnNode> |
getReturnNodes() |
java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.Set<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 final UnderlyingAST underlyingAST
protected final java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.Set<Node>> treeLookup
Tree
s to sets of 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 final java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.Set<Node>> convertedTreeLookup
Tree
s to post-conversion sets of Node
s.protected final 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.List<com.sun.source.tree.ClassTree> declaredClasses
protected final java.util.List<com.sun.source.tree.LambdaExpressionTree> declaredLambdas
public ControlFlowGraph(SpecialBlock entryBlock, SpecialBlockImpl regularExitBlock, SpecialBlockImpl exceptionalExitBlock, UnderlyingAST underlyingAST, java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.Set<Node>> treeLookup, java.util.IdentityHashMap<com.sun.source.tree.Tree,java.util.Set<Node>> convertedTreeLookup, java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> unaryAssignNodeLookup, java.util.List<ReturnNode> returnNodes, java.util.List<com.sun.source.tree.ClassTree> declaredClasses, java.util.List<com.sun.source.tree.LambdaExpressionTree> declaredLambdas)
public java.util.Set<Node> getNodesCorrespondingToTree(com.sun.source.tree.Tree t)
Node
s to which the Tree
t
corresponds. Returns
null for trees that don't produce a value.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,java.util.Set<Node>> getTreeLookup()
public java.util.IdentityHashMap<com.sun.source.tree.UnaryTree,AssignmentNode> getUnaryAssignNodeLookup()
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)
public java.util.List<com.sun.source.tree.ClassTree> getDeclaredClasses()
public java.util.List<com.sun.source.tree.LambdaExpressionTree> getDeclaredLambdas()