Struct stack_graphs::partial::PartialSymbolStack [−][src]
#[repr(C)]pub struct PartialSymbolStack { /* fields omitted */ }
Expand description
A pattern that might match against a symbol stack. Consists of a (possibly empty) list of partial scoped symbols, along with an optional symbol stack variable.
Implementations
Returns whether this partial symbol stack can match the empty symbol stack.
Returns whether this partial symbol stack can only match the empty symbol stack.
Returns whether this partial symbol stack contains any symbols.
Returns an empty partial symbol stack.
Returns a partial symbol stack containing only a symbol stack variable.
Returns whether this partial symbol stack is iterable in both directions without needing mutable access to the arena.
pub fn with_offset(
self,
partials: &mut PartialPaths,
symbol_variable_offset: u32,
scope_variable_offset: u32
) -> PartialSymbolStack
pub fn with_offset(
self,
partials: &mut PartialPaths,
symbol_variable_offset: u32,
scope_variable_offset: u32
) -> PartialSymbolStack
Applies an offset to this partial symbol stack.
When concatenating partial paths, we have to ensure that the left- and right-hand sides have non-overlapping sets of variables. To do this, we find the maximum value of any variable on the left-hand side, and add this “offset” to the values of all of the variables on the right-hand side.
Pushes a new PartialScopedSymbol
onto the front of this partial symbol stack.
Pushes a new PartialScopedSymbol
onto the back of this partial symbol stack.
Removes and returns the PartialScopedSymbol
at the front of this partial symbol
stack. If the stack is empty, returns None
.
Removes and returns the PartialScopedSymbol
at the back of this partial symbol stack.
If the stack is empty, returns None
.
pub fn display<'a>(
self,
graph: &'a StackGraph,
partials: &'a mut PartialPaths
) -> impl Display + 'a
pub fn match_stack(
self,
graph: &StackGraph,
paths: &Paths,
partial_paths: &mut PartialPaths,
stack: SymbolStack,
symbol_bindings: &mut SymbolStackBindings,
scope_bindings: &mut ScopeStackBindings
) -> Result<(), PathResolutionError>
pub fn match_stack(
self,
graph: &StackGraph,
paths: &Paths,
partial_paths: &mut PartialPaths,
stack: SymbolStack,
symbol_bindings: &mut SymbolStackBindings,
scope_bindings: &mut ScopeStackBindings
) -> Result<(), PathResolutionError>
Matches this precondition against a symbol stack, stashing away the unmatched portion of the stack in the bindings.
Returns whether two partial symbol stacks “match”. They must be the same length, and each respective partial scoped symbol must match.
pub fn apply_bindings(
self,
paths: &mut Paths,
partials: &mut PartialPaths,
symbol_bindings: &SymbolStackBindings,
scope_bindings: &ScopeStackBindings
) -> Result<SymbolStack, PathResolutionError>
pub fn apply_bindings(
self,
paths: &mut Paths,
partials: &mut PartialPaths,
symbol_bindings: &SymbolStackBindings,
scope_bindings: &ScopeStackBindings
) -> Result<SymbolStack, PathResolutionError>
Applies a set of bindings to this partial symbol stack, producing a new symbol stack.
pub fn apply_partial_bindings(
self,
partials: &mut PartialPaths,
symbol_bindings: &PartialSymbolStackBindings,
scope_bindings: &PartialScopeStackBindings
) -> Result<PartialSymbolStack, PathResolutionError>
pub fn apply_partial_bindings(
self,
partials: &mut PartialPaths,
symbol_bindings: &PartialSymbolStackBindings,
scope_bindings: &PartialScopeStackBindings
) -> Result<PartialSymbolStack, PathResolutionError>
Applies a set of bindings to this partial symbol stack, producing a new partial symbol stack.
pub fn unify(
self,
partials: &mut PartialPaths,
rhs: PartialSymbolStack,
symbol_bindings: &mut PartialSymbolStackBindings,
scope_bindings: &mut PartialScopeStackBindings
) -> Result<PartialSymbolStack, PathResolutionError>
pub fn unify(
self,
partials: &mut PartialPaths,
rhs: PartialSymbolStack,
symbol_bindings: &mut PartialSymbolStackBindings,
scope_bindings: &mut PartialScopeStackBindings
) -> Result<PartialSymbolStack, PathResolutionError>
Given two partial symbol stacks, returns the largest possible partial symbol stack such that any symbol stack that satisfies the result also satisfies both inputs. This takes into account any existing variable assignments, and updates those variable assignments with whatever constraints are necessary to produce a correct result.
Note that this operation is commutative. (Concatenating partial paths, defined in
PartialPath::concatenate
, is not.)
pub fn cmp(
self,
graph: &StackGraph,
partials: &mut PartialPaths,
other: PartialSymbolStack
) -> Ordering
pub fn iter<'a>(
&self,
partials: &'a mut PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
pub fn iter<'a>(
&self,
partials: &'a mut PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
Returns an iterator over the contents of this partial symbol stack.
pub fn iter_unordered<'a>(
&self,
partials: &'a PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
pub fn iter_unordered<'a>(
&self,
partials: &'a PartialPaths
) -> impl Iterator<Item = PartialScopedSymbol> + 'a
Returns an iterator over the contents of this partial symbol stack, with no guarantee about the ordering of the elements.
Trait Implementations
Performs the conversion.
type Output = MaybeUninit<Self>
type Output = MaybeUninit<Self>
The type that is used to store values of Self
inside of a ControlledOption
. This might
be Self
itself, if your niche is a valid instance of the type, but which violates some
runtime constraint. But if you cannot easily create your niche as an instance of Self
,
you can use some other type, you can use some other type instead. Read more
Returns the niche value for this type that should be used to represent None
for a
ControlledOption
. Read more
Returns whether value is the niche value for this type.
Transforms a non-niche value of this type into its Output
type. When Output
is Self
,
this will be the identity function. Read more
Auto Trait Implementations
impl !RefUnwindSafe for PartialSymbolStack
impl Send for PartialSymbolStack
impl Sync for PartialSymbolStack
impl Unpin for PartialSymbolStack
impl UnwindSafe for PartialSymbolStack
Blanket Implementations
Mutably borrows from an owned value. Read more