@eagleoutice/flowr - v2.15.8
    Preparing search index...

    A read-only view of the ControlFlowGraph.

    interface ReadOnlyControlFlowGraph {
        childrenOf: (id: NodeId) => readonly NodeId[] | undefined;
        dataflow: () => DataflowGraph<DataflowGraphVertexInfo, DfEdge> | undefined;
        decides: (id: NodeId) => readonly NodeId[];
        edges: () => ReadonlyMap<NodeId, ReadonlyMap<NodeId, CfgEdge>>;
        edgesFrom: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge>;
        edgesTo: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge>;
        entryOf: (id: NodeId, idMap?: AstIdMap) => NodeId | undefined;
        exitOf: (id: NodeId) => NodeId;
        getBasicBlock: (elemId: NodeId) => CfgBasicBlockVertex | undefined;
        getVertex: (id: NodeId, includeBlocks?: boolean) => CfgVertex | undefined;
        hasVertex: (id: NodeId, includeBlocks?: boolean) => boolean;
        ingoingEdges: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge> | undefined;
        mayHaveBasicBlocks: () => boolean;
        outgoingEdges: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge> | undefined;
        predecessors: (id: NodeId) => Iterable<NodeId>;
        rootIds: () => ReadonlySet<NodeId>;
        successors: (id: NodeId) => Iterable<NodeId>;
        vertices: (
            includeBasicBlockElements: boolean,
        ) => ReadonlyMap<NodeId, CfgVertex>;
    }

    Implemented by

    Index
    childrenOf: (id: NodeId) => readonly NodeId[] | undefined

    The vertices nested within the given one, which for a function definition is the body it holds. Nothing flows into such a region, so this is the only way a traversal can step into it.

    dataflow: () => DataflowGraph<DataflowGraphVertexInfo, DfEdge> | undefined

    The dataflow graph this control flow graph is a view of, undefined once it holds a copy of its own. It knows the ast as well, so a traversal needs nothing but the control flow to reach either.

    decides: (id: NodeId) => readonly NodeId[]

    The constructs whose outcome this vertex decides, e.g. the if a condition belongs to.

    Since a construct is reached only once its parts have run, standing on the condition is the moment to ask what that condition is for.

    entryOf() - for the way back, from the construct to its condition

    if(u) a else b # decides(u) names the if, so `u` is known to be its condition
    
    edges: () => ReadonlyMap<NodeId, ReadonlyMap<NodeId, CfgEdge>>

    Get all edges in the graph, independent of their sources and targets (see ControlFlowGraph for their order). If you are only interested in the edges of a specific node, please use outgoingEdges() or ingoingEdges(). This is the pendant of edges() on a DataflowGraph.

    edgesFrom: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge>

    The edges leaving the given vertex, i.e. what may be evaluated after it, answering with the shared empty NoEdges rather than with undefined for a vertex that has none. This is the pendant of edgesFrom() on a DataflowGraph.

    edgesTo() - for what may be evaluated before it

    edgesTo: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge>

    The edges leading into the given vertex, i.e. what may be evaluated before it, answering with the shared empty NoEdges rather than with undefined for a vertex that has none. This is the pendant of edgesTo() on a DataflowGraph.

    edgesFrom() - for what may be evaluated after it

    entryOf: (id: NodeId, idMap?: AstIdMap) => NodeId | undefined

    The vertex control flow enters the construct rooted at id at, i.e. the first thing it evaluates. For if(u) a else b that is the condition, for 2 * 3 the left operand, and for a leaf the leaf itself.

    undefined if the construct is not part of the control flow at all.

    Type Declaration

      • (id: NodeId, idMap?: AstIdMap): NodeId | undefined
      • Parameters

        • id: NodeId

          the construct to look at

        • OptionalidMap: AstIdMap

          the AST the graph belongs to; a graph that knows its own (a view on a dataflow graph) may omit it

        Returns NodeId | undefined

    exitOf() - for where it is over

    exitOf: (id: NodeId) => NodeId

    The vertex a construct is over at, i.e. where its branches join and control flow continues past it.

    The control flow is modeled in post-order: everything a construct is made of is evaluated before the construct itself, so an if is over on the if vertex, a loop on its loop vertex, and 2 * 3 on the * vertex. There is no separate marker to look for — reaching the vertex is the construct ending.

    entryOf() - for where it begins instead

    getBasicBlock: (elemId: NodeId) => CfgBasicBlockVertex | undefined

    Obtain the basic block associated with the given element id (i.e. if this is an element within a basic block, return the blockit belongs to).

    getVertex: (id: NodeId, includeBlocks?: boolean) => CfgVertex | undefined

    Retrieve a vertex by its id.

    Type Declaration

      • (id: NodeId, includeBlocks?: boolean): CfgVertex | undefined
      • Parameters

        • id: NodeId

          the id of the vertex to retrieve

        • OptionalincludeBlocks: boolean

          if true, the elements of basic block elements are included in the result, otherwise this will only the basic blocks themselves

                           This is the pendant of <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html#getvertex" class="tsd-kind-method">getVertex()</a> on a <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html" class="tsd-kind-class">DataflowGraph</a>.
          

        Returns CfgVertex | undefined

    hasVertex: (id: NodeId, includeBlocks?: boolean) => boolean

    Check if a vertex with the given id exists in the graph.

    Type Declaration

      • (id: NodeId, includeBlocks?: boolean): boolean
      • Parameters

        • id: NodeId

          the id of the vertex to check

        • OptionalincludeBlocks: boolean

          if true, the elements of basic block elements are included in the check, otherwise this will only check the basic blocks themselves

                           This is the pendant of <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html#hasvertex" class="tsd-kind-method">hasVertex()</a> on a <a href="../classes/src_dataflow_graph_graph.DataflowGraph.html" class="tsd-kind-class">DataflowGraph</a>.
          

        Returns boolean

    ingoingEdges: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge> | undefined

    The edges leading into the given vertex, i.e. what may be evaluated before it.

    mayHaveBasicBlocks: () => boolean

    Returns true if the graph may contain basic blocks and false if we know that it does not. This can be used for optimizations.

    outgoingEdges: (id: NodeId) => ReadonlyMap<NodeId, CfgEdge> | undefined

    The edges leaving the given vertex, i.e. what may be evaluated after it.

    predecessors: (id: NodeId) => Iterable<NodeId>

    The vertices control flow may come from to reach id, i.e. what may have been evaluated before.

    successors() - for the other direction

    rootIds: () => ReadonlySet<NodeId>

    Get all ids of the root vertices — vertices that are not part of any function definition or basic block and hence part of the "top-level" control flow.

    This is the pendant of rootIds() on a DataflowGraph.

    • vertices() - for a way to get all vertices in the graph.
    • getVertex() - for a way to get a specific vertex by its id.
    • edges() - for a way to get all edges in the graph.
    successors: (id: NodeId) => Iterable<NodeId>

    The vertices control flow may reach directly from id, i.e. what may be evaluated next.

    Prefer this over walking the edges by hand: a graph that is a view on another structure (see ControlFlowGraph) may answer it without projecting itself at all.

    predecessors() - for the other direction

    vertices: (includeBasicBlockElements: boolean) => ReadonlyMap<NodeId, CfgVertex>

    Provide a view of all vertices in the graph.

    Type Declaration

      • (includeBasicBlockElements: boolean): ReadonlyMap<NodeId, CfgVertex>
      • Parameters

        • includeBasicBlockElements: boolean

          if true, the elements of basic block elements are included in the result, otherwise only the basic blocks themselves are included

        Returns ReadonlyMap<NodeId, CfgVertex>

    • rootIds() - for a way to get the root vertices of the graph.
    • getVertex() - for a way to get a specific vertex by its id.
    • edges() - for a way to get all edges in the graph.