Struct stack_graphs::paths::Path [−][src]
#[repr(C)]pub struct Path {
pub start_node: Handle<Node>,
pub end_node: Handle<Node>,
pub symbol_stack: SymbolStack,
pub scope_stack: ScopeStack,
pub edges: PathEdgeList,
}
Expand description
A sequence of edges from a stack graph. A complete path represents a full name binding in a source language.
Fields
start_node: Handle<Node>
end_node: Handle<Node>
symbol_stack: SymbolStack
scope_stack: ScopeStack
edges: PathEdgeList
Implementations
pub fn from_partial_path(
graph: &StackGraph,
paths: &mut Paths,
partials: &mut PartialPaths,
partial_path: &PartialPath
) -> Option<Path>
pub fn from_partial_path(
graph: &StackGraph,
paths: &mut Paths,
partials: &mut PartialPaths,
partial_path: &PartialPath
) -> Option<Path>
Promotes a partial path to a path.
pub fn append_partial_path(
&mut self,
graph: &StackGraph,
paths: &mut Paths,
partials: &mut PartialPaths,
partial_path: &PartialPath
) -> Result<(), PathResolutionError>
pub fn append_partial_path(
&mut self,
graph: &StackGraph,
paths: &mut Paths,
partials: &mut PartialPaths,
partial_path: &PartialPath
) -> Result<(), PathResolutionError>
Attempts to append a partial path to the end of a path. If the partial path is not compatible with this path, we return an error describing why.
Creates a new empty path starting at a stack graph node. The starting node cannot be a pop symbol node.
Returns whether one path shadows another. Note that shadowing is not commutative — if path A shadows path B, the reverse is not true.
A complete path represents a full name binding that resolves a reference to a definition.
pub fn display<'a>(
&'a self,
graph: &'a StackGraph,
paths: &'a mut Paths
) -> impl Display + 'a
pub fn append(
&mut self,
graph: &StackGraph,
paths: &mut Paths,
edge: Edge
) -> Result<(), PathResolutionError>
pub fn append(
&mut self,
graph: &StackGraph,
paths: &mut Paths,
edge: Edge
) -> Result<(), PathResolutionError>
Attempts to append an edge to the end of a path. If the edge is not a valid extension of this path, we return an error describing why.
pub fn resolve(
&mut self,
graph: &StackGraph,
paths: &mut Paths
) -> Result<(), PathResolutionError>
pub fn resolve(
&mut self,
graph: &StackGraph,
paths: &mut Paths
) -> Result<(), PathResolutionError>
Attempts to resolve any jump to scope node at the end of a path. If the path does not end in a jump to scope node, we do nothing. If it does, and we cannot resolve it, then we return an error describing why.
Attempts to extend one path as part of the path-finding algorithm. When calling this
function, you are responsible for ensuring that graph
already contains data for all of
the possible edges that we might want to extend path
with.
The resulting extended paths will be added to result
. We have you pass that in as a
parameter, instead of building it up ourselves, so that you have control over which
particular collection type to use, and so that you can reuse result collections across
multiple calls.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Path
impl UnwindSafe for Path
Blanket Implementations
Mutably borrows from an owned value. Read more