Interface CAstControlFlowMap

All Known Implementing Classes:
CAstControlFlowRecorder

public interface CAstControlFlowMap
The control flow information for the CAPA AST of a particular entity. An ast may contain various nodes that pertain to control flow---such as gotos, branches, exceptions and so on---and this map denotes the target ast nodes of ast nodes that are control flow instructions. The label is fairly arbitrary---it will depend on the language, producers and consumers of the tree---but is generally expected to be things like case labels, exception types, conditional outcomes and so on.
Author:
Julian Dolby (dolby@us.ibm.com)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final CAstNode
    A distinguished target that means this control flow is the target of an uncaught exception.
    static final Object
    A distinguished label that means this control flow is the default target of a switch (or case) statement as found in many procedural languages.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an iterator of all CAstNodes for which this map contains control flow mapping information.
    Return a collection of control-flow ast nodes that have this one as a possible target.
    getTarget(CAstNode from, Object label)
    Return the target ast node of the control-flow instruction denoted by from with respect to the given label.
    Return a collection of all labels for which the control-flow ast node from has a target.
  • Field Details

    • SWITCH_DEFAULT

      static final Object SWITCH_DEFAULT
      A distinguished label that means this control flow is the default target of a switch (or case) statement as found in many procedural languages.
    • EXCEPTION_TO_EXIT

      static final CAstNode EXCEPTION_TO_EXIT
      A distinguished target that means this control flow is the target of an uncaught exception.
  • Method Details

    • getTarget

      CAstNode getTarget(CAstNode from, Object label)
      Return the target ast node of the control-flow instruction denoted by from with respect to the given label.
    • getTargetLabels

      Collection<Object> getTargetLabels(CAstNode from)
      Return a collection of all labels for which the control-flow ast node from has a target.
    • getSourceNodes

      Collection<Object> getSourceNodes(CAstNode to)
      Return a collection of control-flow ast nodes that have this one as a possible target.
    • getMappedNodes

      Collection<CAstNode> getMappedNodes()
      Returns an iterator of all CAstNodes for which this map contains control flow mapping information.