Class ControlFlowGraph<N>

Type Parameters:
N - The instruction type of the control flow graph.
All Implemented Interfaces:
AdjacencyGraph<N,ControlFlowGraph.Branch>, GraphvizGraph

public class ControlFlowGraph<N> extends LinkedDirectedGraph<N,ControlFlowGraph.Branch>
Control flow graph.
  • Method Details

    • getImplicitReturn

      public DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> getImplicitReturn()
      Gets the implicit return node.
      Returns:
      Return node.
    • getEntry

      Gets the entry point of the control flow graph. In general, this should be the beginning of the global script or beginning of a function.
      Returns:
      The entry point.
    • isImplicitReturn

      public boolean isImplicitReturn(DiGraph.DiGraphNode<N,ControlFlowGraph.Branch> node)
      Checks whether node is the implicit return.
      Parameters:
      node - Node.
      Returns:
      True if the node is the implicit return.
    • getOptionalNodeComparator

      public Comparator<DiGraph.DiGraphNode<N,ControlFlowGraph.Branch>> getOptionalNodeComparator(boolean isForward)
      Gets a comparator for the nodes. The default implementation returns null. See getOptionalNodeComparator(boolean).
      Parameters:
      isForward - Whether the comparator sorts the nodes in the direction of the flow.
      Returns:
      a comparator or null (in particular, if not overridden)
    • isEnteringNewCfgNode

      public static boolean isEnteringNewCfgNode(Node n)
      Returns:
      True if n should be represented by a new CFG node in the control flow graph.
    • toString

      public String toString()
      Overrides:
      toString in class Object