accrue.analysis.interprocanalysis

## Class PreciseDataFlow.PreciseCFGBuilder<FlowItem extends polyglot.visit.DataFlow.Item>

- java.lang.Object
- - polyglot.visit.CFGBuilder<FlowItem>
  - - accrue.analysis.interprocanalysis.PreciseDataFlow.PreciseCFGBuilder<FlowItem>

- All Implemented Interfaces:
    java.lang.Cloneable, polyglot.util.Copy<polyglot.visit.CFGBuilder<FlowItem>>
  Enclosing class:
    PreciseDataFlow<FlowItem extends polyglot.visit.DataFlow.Item>

      public static class PreciseDataFlow.PreciseCFGBuilder<FlowItem extends polyglot.visit.DataFlow.Item>
      extends polyglot.visit.CFGBuilder<FlowItem>

  A more precise CFG builder that adds Exception edges only for exceptions that might actually be thrown.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class polyglot.visit.CFGBuilder

      `polyglot.visit.CFGBuilder.EdgeKeyTermPair`

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Field Summary

    - ### Fields inherited from class polyglot.visit.CFGBuilder

      `counter, df, errorEdgesToExitNode, exceptionEdgesToFinally, graph, innermostTarget, outer, path_to_finally, skipDeadIfBranches, skipDeadLoopBodies, skipInnermostCatches, trackImplicitErrors, ts`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreciseDataFlow.PreciseCFGBuilder(polyglot.ast.JLang lang, polyglot.types.TypeSystem ts, polyglot.visit.FlowGraph<FlowItem> graph, PreciseDataFlow<FlowItem> df)` Create a new CFG builder

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.util.Collection<ThrowableType>` | `approximateThrown(polyglot.ast.Term a, PreciseDataFlow<FlowItem> pdf)` Approximate the set of exceptions that may be thrown by the term a as precisely as possible
    `PreciseDataFlow.PreciseCFGBuilder<FlowItem>` | `push(java.util.Collection<polyglot.types.ClassType> suppressExceptions, polyglot.ast.Term suppressTarget)` Swap out the exceptions and target
    `void` | `visitThrow(polyglot.ast.Term a)`
    `void` | `visitThrow(polyglot.ast.Term t, int entry, ThrowableType tt)` Create edges for an exception thrown from term `t`.

    - ### Methods inherited from class polyglot.visit.CFGBuilder

      `copy, dataflow, edge, edge, edge, edge, edge, edge, enterFinally, entryPeer, errorEdgesToExitNode, exceptionEdgesToFinally, exitPeer, graph, innermostTarget, lang, outer, push, push, skipDeadIfBranches, skipDeadIfBranches, skipDeadLoopBodies, skipDeadLoopBodies, skipInnermostCatches, trackImplicitErrors, tryFinally, tryFinally, typeSystem, visitBranchTarget, visitCFG, visitCFG, visitCFG, visitCFG, visitCFG, visitCFG, visitCFGList, visitGraph, visitReturn, visitThrow`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PreciseDataFlow.PreciseCFGBuilder

          public PreciseDataFlow.PreciseCFGBuilder(polyglot.ast.JLang lang,
                                           polyglot.types.TypeSystem ts,
                                           polyglot.visit.FlowGraph<FlowItem> graph,
                                           PreciseDataFlow<FlowItem> df)

      Create a new CFG builder
      Parameters:
        `ts` - Polyglot type system
        `graph` - dataflow graph
        `df` - dataflow visitor

  - ### Method Detail

    - #### push

          public PreciseDataFlow.PreciseCFGBuilder<FlowItem> push(java.util.Collection<polyglot.types.ClassType> suppressExceptions,
                                                         polyglot.ast.Term suppressTarget)

      Swap out the exceptions and target
      Parameters:
        `suppressExceptions` - new set of expression types to suppress
        `suppressTarget` - AST node to supress them on
      Returns:
        new `PreciseDataFlow.PreciseCFGBuilder` with the given suppressed exceptions and targets

    - #### visitThrow

          public void visitThrow(polyglot.ast.Term a)

      Overrides:
        `visitThrow` in class `polyglot.visit.CFGBuilder<FlowItem extends polyglot.visit.DataFlow.Item>`

    - #### approximateThrown

          protected java.util.Collection<ThrowableType> approximateThrown(polyglot.ast.Term a,
                                                              PreciseDataFlow<FlowItem> pdf)

      Approximate the set of exceptions that may be thrown by the term a as precisely as possible
      Parameters:
        `a` - AST node to compute the exceptions for
        `pdf` - dataflow

    - #### visitThrow

          public void visitThrow(polyglot.ast.Term t,
                        int entry,
                        ThrowableType tt)

      Create edges for an exception thrown from term `t`.
      Parameters:
        `t` - AST node
        `entry` - 1 if we are looking at the entry of the term
        `tt` - exception type