OptionalcleanEnv: REnvironmentInformationOptionalidMap: AstIdMapProtectedrootContains the vertices of the root level graph (i.e., included those vertices from the complete graph, that are nested within function definitions)
Retrieves the id-map to the normalized AST attached to the dataflow graph
Retrieves the set of vertices which have side effects that we do not know anything about.
StaticfromConstructs a dataflow graph instance from the given JSON data, e.g. as sent by the flowR server for further analysis.
Adds vertex to the graph, filling in fallbackEnv if it carries no environment. asRoot = false skips
adding it to rootIds|root vertices (mostly useful when constructing graphs for tests); overwrite replaces an existing vertex of the same id.
Adds an argument edge with from as function call, and to as argument.
Adds a argument edge with a query for the from and/or to vertices.
Adds a vertex for a function call (V2).
AST node ID
Function name
Function arguments; may be empty
Optionalinfo: {Additional/optional properties.
should the vertex be part of the root vertex set of the graph (i.e., be a valid entry point), or is it nested (e.g., as part of a function definition)
Adds a call edge with from as caller, and to as callee.
Adds a call edge with a query for the from and/or to vertices.
Adds a vertex for a constant value (V6).
AST node ID
Optionaloptions: { cds?: ControlDependency[] }
Additional/optional properties;
should the vertex be part of the root vertex set of the graph (i.e., be a valid entry point), or is it nested (e.g., as part of a function definition)
Adds a defined-by edge with from as defined variable, and to as a variable/function contributing to its definition.
Adds a defined-by-on-call edge with from as definition, and to as variable.
Adds a defined-by-on-call edge with a query for the from and/or to vertices.
Adds a defined-by edge with a query for the from and/or to vertices.
Adds a vertex for a function definition (V1).
AST node ID
Node IDs for exit point vertices.
Subflow data graph for the defined function.
Optionalinfo: {Additional/optional properties.
should the vertex be part of the root vertex set of the graph (i.e., be a valid entry point), or is it nested (e.g., as part of a function definition)
Adds a defines-on-call edge with from as variable, and to as its definition
Adds a defines-on-call edge with a query for the from and/or to vertices.
Adds a vertex for a variable definition (V4).
AST node ID
Optionalname: string
Variable name
Optionalinfo: { cds?: ControlDependency[]; definedBy?: NodeId[] }
Additional/optional properties.
Should the vertex be part of the root vertex set of the graph (i.e., be a valid entry point), or is it nested (e.g., as part of a function definition)
Ids of all edges in the graph together with their edge information, see DataflowGraph#vertices.
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.
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.
Gets the DataflowGraphVertexInfo attached to id (searching function definitions too if includeDefinedFunctions) and its outgoing edges.
Gets the DataflowGraphVertexInfo attached to id, but only if it is a root-level vertex, see DataflowGraph#getVertex.
Gets the DataflowGraphVertexInfo attached to id, see DataflowGraph#getRootVertex.
Whether the graph contains a node with id (checking function definitions too if includeDefinedFunctions).
The edges arriving at id, building the incoming index on first use.
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.
Returns true if the root level of the graph contains a node with the given id.
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.
Adds a non-standard evaluation edge with from as vertex, and to as vertex.
Adds a non-standard evaluation edge with a query for the from and/or to vertices.
The edges leaving id, the mutable map the graph stores, undefined for a vertex that has none.
explicitly overwrite the root ids of the graph,
this is just an easier variant in case you working with a lot of functions this saves you a lot of false flags.
The cached pkg::fn name of the call id, asking resolve only for a call the cache does not know yet.
The cached pkg::fn name of every call, resolving the calls that are still missing.
Adds a read edge.
NodeId of the source vertex
Either a single or multiple target ids. If you pass multiple this will construct a single edge for each of them.
Adds a read edge with a query for the from and/or to vertices.
Either a node id or a query to find the node id.
Either a node id or a query to find the node id.
The input to search in i.e. the dataflow graph.
Adds a return edge with from as function, and to as exit point.
Adds a return edge with a query for the from and/or to vertices.
Marks the vertex referenced by reference as a definition, with sourceIds as the source vertex ids of the def if known.
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)
Adds a side-effect-on-call edge with from as vertex, and to as vertex.
Adds a side-effect-on-call edge with a query for the from and/or to vertices.
Marks the vertex info.id in the graph to be a function call with the new info.
Adds a vertex for variable use (V5). Intended for creating dataflow graphs as part of function tests.
AST node id
Optionalname: string
Variable name
Optionalinfo: Partial<DataflowGraphVertexUse>
Additional/optional properties; i.e., scope, when, or environment.
should the vertex be part of the root vertex set of the graph (i.e., be a valid entry point) or is it nested (e.g., as part of a function definition)
The ids of DataflowGraph#verticesOfType|verticesOfType, as a fresh array the caller may keep.
Ids of all toplevel vertices (or all, including those nested in function definitions, if includeDefinedFunctions) with their info, see DataflowGraph#edges.
Every vertex carrying type, in the order the graph learned of them.
This DataflowGraphBuilder extends DataflowGraph with builder methods to easily and compactly add vertices and edges to a dataflow graph. Its usage thus simplifies writing tests for dataflow graphs.