pub struct TagStringAlgebra { /* private fields */ }Expand description
Alto-compatible TAG string algebra.
Implementations§
Source§impl TagStringAlgebra
impl TagStringAlgebra
Sourcepub fn with_signature(signature: Signature) -> Self
pub fn with_signature(signature: Signature) -> Self
Construct an algebra over an existing target signature.
Sourcepub fn intern_word(&mut self, word: impl Into<String>) -> Symbol
pub fn intern_word(&mut self, word: impl Into<String>) -> Symbol
Intern a nullary lexical symbol.
Sourcepub fn operation_symbol(&self, name: &str) -> Option<Symbol>
pub fn operation_symbol(&self, name: &str) -> Option<Symbol>
Resolve an operation or lexical symbol by name.
Sourcepub fn parse_string(&mut self, input: &str) -> TagStringValue<Symbol>
pub fn parse_string(&mut self, input: &str) -> TagStringValue<Symbol>
Parse whitespace-separated tokens as a contiguous string.
Sourcepub fn decompose(
&self,
value: TagStringValue<Symbol>,
) -> Option<TagStringDecompositionAutomaton>
pub fn decompose( &self, value: TagStringValue<Symbol>, ) -> Option<TagStringDecompositionAutomaton>
Build a lazy decomposition for a contiguous input string.
Complete string-pair values are not parse inputs, matching Alto.
Trait Implementations§
Source§impl Algebra for TagStringAlgebra
impl Algebra for TagStringAlgebra
Source§type InternalValue = TagStringValue<Symbol>
type InternalValue = TagStringValue<Symbol>
Efficient internal value domain used by
evaluate and decomposition.Source§type Value = TagStringValue<String>
type Value = TagStringValue<String>
Standalone public value produced for output by
evaluate_term.Source§type ParseError = Infallible
type ParseError = Infallible
Error returned when parsing a textual object representation.
Source§fn evaluate(
&self,
symbol: Symbol,
children: &[Self::InternalValue],
) -> Option<Self::InternalValue>
fn evaluate( &self, symbol: Symbol, children: &[Self::InternalValue], ) -> Option<Self::InternalValue>
Evaluate an operation over child internal values. Read more
Source§fn parse_object(
&mut self,
input: &str,
) -> Result<Self::InternalValue, Self::ParseError>
fn parse_object( &mut self, input: &str, ) -> Result<Self::InternalValue, Self::ParseError>
Parse a textual representation into an internal value.
Source§fn to_external(&self, value: &Self::InternalValue) -> Self::Value
fn to_external(&self, value: &Self::InternalValue) -> Self::Value
Map an internal value to its standalone public form.
Source§fn visualize(&self, value: &Self::Value) -> VisualRepresentation
fn visualize(&self, value: &Self::Value) -> VisualRepresentation
Convert a public value into this algebra’s preferred GUI-neutral representation.
Source§fn evaluate_term_internal(
&self,
arena: &TreeArena<Symbol>,
root: Tree,
) -> Option<Self::InternalValue>
fn evaluate_term_internal( &self, arena: &TreeArena<Symbol>, root: Tree, ) -> Option<Self::InternalValue>
Source§fn evaluate_term(
&self,
arena: &TreeArena<Symbol>,
root: Tree,
) -> Option<Self::Value>
fn evaluate_term( &self, arena: &TreeArena<Symbol>, root: Tree, ) -> Option<Self::Value>
Evaluate a term tree to its public value (bottom-up
evaluate, then
to_external).Source§fn is_valid_value(&self, _value: &Self::InternalValue) -> bool
fn is_valid_value(&self, _value: &Self::InternalValue) -> bool
Return whether
value is a valid internal value.Source§fn decompose_default(
&self,
value: Self::InternalValue,
) -> EvaluatingDecompositionAutomaton<'_, Self>where
Self: Sized,
fn decompose_default(
&self,
value: Self::InternalValue,
) -> EvaluatingDecompositionAutomaton<'_, Self>where
Self: Sized,
Build the default evaluating decomposition automaton for
value.Source§impl Clone for TagStringAlgebra
impl Clone for TagStringAlgebra
Source§fn clone(&self) -> TagStringAlgebra
fn clone(&self) -> TagStringAlgebra
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TagStringAlgebra
impl Debug for TagStringAlgebra
Auto Trait Implementations§
impl Freeze for TagStringAlgebra
impl RefUnwindSafe for TagStringAlgebra
impl Send for TagStringAlgebra
impl Sync for TagStringAlgebra
impl Unpin for TagStringAlgebra
impl UnsafeUnpin for TagStringAlgebra
impl UnwindSafe for TagStringAlgebra
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more