webql/compiler/context
Copy MarkdownTypes
Context
pub type Context {
Context(
nodes: dict.Dict(String, reference.Node),
supernodes: dict.Dict(String, reference.Supernode),
edges: dict.Dict(reference.Input, reference.Edge),
inputs: dict.Dict(
List(String),
#(reference.Input, reference.Port),
),
outputs: dict.Dict(
List(String),
#(reference.Output, reference.Port),
),
parameters: dict.Dict(String, reference.Parameter),
returns: dict.Dict(String, reference.Return),
contexts: dict.Dict(reference.Supernode, Context),
)
}Context(
nodes: dict.Dict(String, reference.Node),
supernodes: dict.Dict(String, reference.Supernode),
edges: dict.Dict(reference.Input, reference.Edge),
inputs: dict.Dict(
List(String),
#(reference.Input, reference.Port),
),
outputs: dict.Dict(
List(String),
#(reference.Output, reference.Port),
),
parameters: dict.Dict(String, reference.Parameter),
returns: dict.Dict(String, reference.Return),
contexts: dict.Dict(reference.Supernode, Context),
)Values
add_context
pub fn add_context(
context: Context,
supernode: reference.Supernode,
nested_context: Context,
) -> ContextAdds a nested context to the current context instance.
add_contexts
pub fn add_contexts(
context: Context,
contexts: List(#(reference.Supernode, Context)),
) -> ContextAdds nested contexts to the current context instance.
add_edge
pub fn add_edge(
context: Context,
edge: reference.Input,
) -> ContextAdds an edge to the current context instance.
add_edges
pub fn add_edges(
context: Context,
edges: List(reference.Input),
) -> ContextAdds edges to the current context instance.
add_input
pub fn add_input(
context: Context,
input: List(String),
port: reference.Port,
) -> ContextAdds a typed input to the current context instance.
add_inputs
pub fn add_inputs(
context: Context,
inputs: List(#(List(String), reference.Port)),
) -> ContextAdds typed inputs to the current context instance.
add_node
pub fn add_node(context: Context, node: String) -> ContextAdds a node to the current context instance.
add_nodes
pub fn add_nodes(
context: Context,
nodes: List(String),
) -> ContextAdds nodes to the current context instance.
add_output
pub fn add_output(
context: Context,
output: List(String),
port: reference.Port,
) -> ContextAdds a typed output to the current context instance.
add_outputs
pub fn add_outputs(
context: Context,
outputs: List(#(List(String), reference.Port)),
) -> ContextAdds typed outputs to the current context instance.
add_parameter
pub fn add_parameter(
context: Context,
parameter: String,
) -> ContextAdds a parameter to the current context instance.
add_parameters
pub fn add_parameters(
context: Context,
parameters: List(String),
) -> ContextAdds parameters to the current context instance.
add_return
pub fn add_return(context: Context, return: String) -> ContextAdds a return to the current context instance.
add_returns
pub fn add_returns(
context: Context,
returns: List(String),
) -> ContextAdds returns to the current context instance.
add_supernode
pub fn add_supernode(
context: Context,
supernode: String,
) -> ContextAdds a supernode to the current context instance.
add_supernodes
pub fn add_supernodes(
context: Context,
supernodes: List(String),
) -> ContextAdds supernodes to the current context instance.
get_context
pub fn get_context(
context: Context,
supernode: reference.Supernode,
) -> Result(Context, Nil)Looks up a nested context by supernode reference.
get_edge
pub fn get_edge(
context: Context,
input: reference.Input,
) -> Result(reference.Edge, Nil)Looks up an edge reference by input reference.
get_input
pub fn get_input(
context: Context,
path: List(String),
) -> Result(#(reference.Input, reference.Port), Nil)Looks up a typed input by path.
get_node
pub fn get_node(
context: Context,
node: String,
) -> Result(reference.Node, Nil)Looks up a node reference by name.
get_output
pub fn get_output(
context: Context,
path: List(String),
) -> Result(#(reference.Output, reference.Port), Nil)Looks up a typed output by path.
get_parameter
pub fn get_parameter(
context: Context,
parameter: String,
) -> Result(reference.Parameter, Nil)Looks up a parameter reference by name.
get_return
pub fn get_return(
context: Context,
return: String,
) -> Result(reference.Return, Nil)Looks up a return reference by name.
get_supernode
pub fn get_supernode(
context: Context,
supernode: String,
) -> Result(reference.Supernode, Nil)Looks up a supernode reference by name.
new
pub fn new() -> ContextCreates a new context.
next_edge
pub fn next_edge(context: Context) -> reference.EdgeGets the next stable edge reference.
next_input
pub fn next_input(context: Context) -> reference.InputGets the next stable input reference.
next_node
pub fn next_node(context: Context) -> reference.NodeGets the next stable node reference.
next_output
pub fn next_output(context: Context) -> reference.OutputGets the next stable output reference.
next_parameter
pub fn next_parameter(context: Context) -> reference.ParameterGets the next stable parameter reference.
next_return
pub fn next_return(context: Context) -> reference.ReturnGets the next stable return reference.
next_supernode
pub fn next_supernode(context: Context) -> reference.SupernodeGets the next stable supernode reference.