Protected
rootContains the vertices of the root level graph (i.e., included those vertices from the complete graph, that are nested within function definitions)
Retrieves the set of vertices which have side effects that we do not know anything about.
Static
fromConstructs a dataflow graph instance from the given JSON data and returns the result. This can be useful for data sent by the flowR server when analyzing it further.
The JSON data to construct the graph from
Adds a new vertex to the graph, for ease of use, some arguments are optional and filled automatically.
The vertex to add
If false, this will only add the vertex but do not add it to the rootIds|root vertices of the graph. This is probably only of use, when you construct dataflow graphs for tests.
Adds an argument edge (E9) with from as function call, and to as argument.
Adds a vertex for a function call (V2).
AST node ID
Function name
Function arguments; may be empty
Optional
info: { Additional/optional properties.
Optional
controlOptional
environment?: REnvironmentInformationOptional
onlyOptional
reads?: readonly NodeId[]Optional
returns?: readonly NodeId[]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 (E5) with from as caller, and to as callee.
Adds a vertex for a constant value (V6).
AST node ID
Optional
options: { Additional/optional properties;
Optional
controlshould 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 (E2), with from as defined variable, and to as a variable/function contributing to its definition.
Adds a vertex for a function definition (V1).
AST node ID
Node IDs for exit point vertices.
Subflow data graph for the defined function.
Optional
info: { Additional/optional properties.
Optional
controlOptional
environment?: REnvironmentInformationshould 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 (E7) with from as variable, and to as its definition
Adds a vertex for a variable definition (V4).
AST node ID
Optional
name: stringVariable name
Optional
info: { Additional/optional properties.
Optional
controlOptional
definedShould 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 all edges in the graph together with their edge information
Get the DataflowGraphVertexInfo attached to a node as well as all outgoing edges.
The id of the node to get
If true this will search function definitions as well and not just the toplevel
the node info for the given id (if it exists)
Get the DataflowGraphVertexInfo attached to a vertex.
The id of the node to get
If true this will search function definitions as well and not just the toplevel
the node info for the given id (if it exists)
Returns true if the graph contains a node with the given id.
The id to check for
If true this will check function definitions as well and not just the toplevel
Returns true if the root level of the graph contains a node with the given id.
Merges the other graph into this one (in-place). The return value is only for convenience.
The graph to merge into this one
If false, this will only merge the vertices and edges but exclude the root vertices this is probably only of use in the context of function definitions
Adds a non-standard evaluation edge with from as vertex, and to as vertex.
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.
Adds a read edge (E1).
Vertex/NodeId
see from
Adds a return edge (E6) with from as function, and to as exit point.
Marks a vertex in the graph to be a definition
The reference to the vertex to mark as definition
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.
Marks a vertex in the graph to be a function call with the new information
The information about the new function call node
Adds a vertex for variable use (V5). Intended for creating dataflow graphs as part of function tests.
AST node id
Optional
name: stringVariable name
Optional
info: 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)
If true this will iterate over function definitions as well and not just the toplevel
the ids of all toplevel vertices in the graph together with their vertex information
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.