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

    Class DataflowGraph<Vertex, Edge>

    The dataflow graph holds the dataflow information found within the given AST: directed edges (EdgeType) are hoisted into a flat adjacency list, while vertices (DataflowGraphVertexArgument) nest hierarchically (a function-definition vertex contains its subgraph's node ids). After analysis every edge endpoint must be a vertex, though not yet during construction. All methods return the modified graph to allow for chaining. The helper object associated with the DFG is Dataflow.

    Type Parameters

    Hierarchy (View Summary)

    Index
    rootVertices: Set<NodeId> = ...

    Contains the vertices of the root level graph (i.e., included those vertices from the complete graph, that are nested within function definitions)

    • The edges leaving id, i.e. what it depends on, as a map from target to edge. A vertex without any answers with the shared empty NoEdges rather than with undefined, so this can be iterated straight away.

      Parameters

      Returns ReadonlyOutgoingEdges

      DataflowGraph#edgesTo|edgesTo() - for the other direction

      for(const [target, edge] of graph.edgesFrom(id)) { /* ... */ }
      
    • The edges arriving at id, i.e. what depends on it, as a map from source to edge. A vertex without any answers with the shared empty NoEdges rather than with undefined.

      The first call builds the index over every edge of the graph; it is kept until the graph changes.

      Parameters

      Returns ReadonlyIngoingEdges

      DataflowGraph#edgesFrom|edgesFrom() - for the other direction

    • Whether the graph contains a node with id (checking function definitions too if includeDefinedFunctions).

      Parameters

      • id: NodeId
      • includeDefinedFunctions: boolean = true

      Returns boolean

    • Whether id is quoted, i.e. affected by a EdgeType.NonStandardEvaluation edge that keeps it from being evaluated (a loop's own NSE-marked body still is evaluated, so that does not count). withOutgoing also checks whether id itself quotes something.

      Parameters

      • id: NodeId
      • withOutgoing: boolean = false

      Returns boolean

    • Merges otherGraph into this one in-place (the return value is only for convenience); mergeRootVertices = false excludes its root vertices (useful when merging in a function definition).

      consume takes otherGraph's edge tables instead of copying them (perf). Pass it only for a graph that dies with the call.

      Parameters

      Returns this

    • Takes type off the edge fromId -> toId, dropping the edge itself once it states nothing. An edge with no type is no edge: every removal has to go through here so none is left behind.

      Parameters

      Returns this

    • Allows setting the id-map explicitly (which should only be used when, e.g., you plan to compare two dataflow graphs on the same AST-basis)

      Parameters

      Returns void