Class ControlFlowGraph

java.lang.Object
org.sonar.plugins.php.api.cfg.ControlFlowGraph

public class ControlFlowGraph extends Object
The Control Flow Graph for a PHP script or for the body of a function.

Each node of the graph represents a list of elements which are executed sequentially. Each node has:

  • one ore more successor blocks,
  • zero or more predecessor blocks.

A Control Flow Graph has a single start node and a single end node. The end node has no successor and no element. WARNING: This is an experimental API, it may change without notice.

  • Field Details

    • KINDS_WITH_CONTROL_FLOW

      public static final Set<Tree.Kind> KINDS_WITH_CONTROL_FLOW
  • Method Details

    • build

      public static ControlFlowGraph build(BlockTree body)
      WARNING: This is an experimental API, it may change without notice.
    • build

      @CheckForNull public static ControlFlowGraph build(Tree tree, CheckContext context)
      WARNING: This is an experimental API, it may change without notice.
    • start

      public CfgBlock start()
    • end

      public CfgBlock end()
    • blocks

      public Set<CfgBlock> blocks()
      Includes start and end blocks