public class CFGBuilder extends Object
The translation of the AST to the CFG is split into three phases:
CFGBuilder.ExtendedNodes. An extended node can either be
       a Node, or one of several meta elements such as a conditional or unconditional jump
       or a node with additional information about exceptions. Some of the extended nodes contain
       labels (e.g., for the jump target), and phase one additionally creates a mapping from
       labels to extended nodes. Finally, the list of leaders is computed: A leader is an extended
       node which will give rise to a basic block in phase two.
   | Modifier and Type | Class and Description | 
|---|---|
| class  | CFGBuilder.CFGTranslationPhaseOneClass that performs phase one of the translation process. | 
| static class  | CFGBuilder.CFGTranslationPhaseThreeClass that performs phase three of the translation process. | 
| class  | CFGBuilder.CFGTranslationPhaseTwoClass that performs phase two of the translation process. | 
| protected static class  | CFGBuilder.ConditionalJumpAn extended node of type  CFGBuilder.ExtendedNode.ExtendedNodeType.CONDITIONAL_JUMP. | 
| protected static class  | CFGBuilder.ExtendedNodeAn extended node can be one of several things (depending on its  type):
 
   NODE. | 
| protected static class  | CFGBuilder.LabelA label is used to refer to other extended nodes using a mapping from labels to extended
 nodes. | 
| protected static class  | CFGBuilder.NodeHolderAn extended node of type  NODE. | 
| protected static class  | CFGBuilder.NodeWithExceptionsHolderAn extended node of type  EXCEPTION_NODE. | 
| protected static class  | CFGBuilder.PhaseOneResultA wrapper object to pass around the result of phase one. | 
| protected static class  | CFGBuilder.TryCatchFrameA TryCatchFrame contains an ordered list of catch labels that apply to exceptions with
 specific types. | 
| protected static class  | CFGBuilder.TryFinallyFrameA TryFinallyFrame applies to exceptions of any type | 
| protected static interface  | CFGBuilder.TryFrameA TryFrame takes a thrown exception type and maps it to a set of possible control-flow
 successors. | 
| protected static class  | CFGBuilder.TryStackAn exception stack represents the set of all try-catch blocks in effect at a given point in a
 program. | 
| protected static class  | CFGBuilder.Tuple<A,B,C>Tuple class with up to three members. | 
| protected static class  | CFGBuilder.UnconditionalJumpAn extended node of type  CFGBuilder.ExtendedNode.ExtendedNodeType.UNCONDITIONAL_JUMP. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | assumeAssertionsDisabledCan assertions be assumed to be disabled? | 
| protected boolean | assumeAssertionsEnabledCan assertions be assumed to be enabled? | 
| protected List<ClassTree> | declaredClassesClass declarations that have been encountered when building the control-flow graph for a
 method. | 
| protected List<LambdaExpressionTree> | declaredLambdasLambdas encountered when building the control-flow graph for a method, variable initializer,
 or initializer. | 
| protected CFGBuilder.Label | exceptionalExitLabelSpecial label to identify the exceptional exit. | 
| protected CFGBuilder.Label | regularExitLabelSpecial label to identify the regular exit. | 
| Constructor and Description | 
|---|
| CFGBuilder(boolean assumeAssertionsEnabled,
          boolean assumeAssertionsDisabled) | 
| Modifier and Type | Method and Description | 
|---|---|
| static ControlFlowGraph | build(CompilationUnitTree root,
     ProcessingEnvironment env,
     MethodTree tree,
     ClassTree classTree)Build the control flow graph of a method. | 
| static ControlFlowGraph | build(CompilationUnitTree root,
     ProcessingEnvironment env,
     MethodTree tree,
     ClassTree classTree,
     boolean assumeAssertionsEnabled,
     boolean assumeAssertionsDisabled)Build the control flow graph of a method. | 
| static ControlFlowGraph | build(CompilationUnitTree root,
     ProcessingEnvironment env,
     UnderlyingAST underlyingAST)Build the control flow graph of some code. | 
| static ControlFlowGraph | build(CompilationUnitTree root,
     ProcessingEnvironment env,
     UnderlyingAST underlyingAST,
     boolean assumeAssertionsEnabled,
     boolean assumeAssertionsDisabled)Build the control flow graph of some code. | 
| static ControlFlowGraph | build(TreePath bodyPath,
     ProcessingEnvironment env,
     UnderlyingAST underlyingAST,
     boolean assumeAssertionsEnabled,
     boolean assumeAssertionsDisabled)Build the control flow graph of some code (method, initializer block, ...). | 
| List<ClassTree> | getDeclaredClasses() | 
| List<LambdaExpressionTree> | getDeclaredLambdas() | 
| protected static void | printBlocks(Set<Block> blocks)Print a set of  Blocks and the edges between them. | 
| ControlFlowGraph | run(CompilationUnitTree root,
   ProcessingEnvironment env,
   MethodTree tree,
   ClassTree classTree)Build the control flow graph of a method. | 
| ControlFlowGraph | run(CompilationUnitTree root,
   ProcessingEnvironment env,
   UnderlyingAST underlyingAST)Build the control flow graph of some code. | 
| ControlFlowGraph | run(TreePath bodyPath,
   ProcessingEnvironment env,
   UnderlyingAST underlyingAST)Build the control flow graph of some code (method, initializer block, ...). | 
protected final boolean assumeAssertionsDisabled
protected final boolean assumeAssertionsEnabled
protected final List<ClassTree> declaredClasses
protected final List<LambdaExpressionTree> declaredLambdas
protected final CFGBuilder.Label exceptionalExitLabel
protected final CFGBuilder.Label regularExitLabel
public CFGBuilder(boolean assumeAssertionsEnabled,
                  boolean assumeAssertionsDisabled)
public List<LambdaExpressionTree> getDeclaredLambdas()
public static ControlFlowGraph build(CompilationUnitTree root, ProcessingEnvironment env, UnderlyingAST underlyingAST, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled)
public static ControlFlowGraph build(TreePath bodyPath, ProcessingEnvironment env, UnderlyingAST underlyingAST, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled)
public static ControlFlowGraph build(CompilationUnitTree root, ProcessingEnvironment env, MethodTree tree, ClassTree classTree, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled)
public static ControlFlowGraph build(CompilationUnitTree root, ProcessingEnvironment env, UnderlyingAST underlyingAST)
public static ControlFlowGraph build(CompilationUnitTree root, ProcessingEnvironment env, MethodTree tree, ClassTree classTree)
public ControlFlowGraph run(CompilationUnitTree root, ProcessingEnvironment env, UnderlyingAST underlyingAST)
public ControlFlowGraph run(TreePath bodyPath, ProcessingEnvironment env, UnderlyingAST underlyingAST)
public ControlFlowGraph run(CompilationUnitTree root, ProcessingEnvironment env, MethodTree tree, ClassTree classTree)