pub enum Node<LexemeT: Lexeme<StorageT>, StorageT> {
Term {
lexeme: LexemeT,
},
Nonterm {
ridx: RIdx<StorageT>,
nodes: Vec<Node<LexemeT, StorageT>>,
},
}
Expand description
A generic parse tree.
Variants§
Term
Terminals store a single lexeme.
Fields
§
lexeme: LexemeT
Nonterm
Nonterminals reference a rule and have zero or more Node
s as children.
Implementations§
Trait Implementations§
source§impl<LexemeT: PartialEq + Lexeme<StorageT>, StorageT: PartialEq> PartialEq for Node<LexemeT, StorageT>
impl<LexemeT: PartialEq + Lexeme<StorageT>, StorageT: PartialEq> PartialEq for Node<LexemeT, StorageT>
impl<LexemeT: Lexeme<StorageT>, StorageT> StructuralPartialEq for Node<LexemeT, StorageT>
Auto Trait Implementations§
impl<LexemeT, StorageT> Freeze for Node<LexemeT, StorageT>
impl<LexemeT, StorageT> RefUnwindSafe for Node<LexemeT, StorageT>where
LexemeT: RefUnwindSafe,
StorageT: RefUnwindSafe,
impl<LexemeT, StorageT> Send for Node<LexemeT, StorageT>
impl<LexemeT, StorageT> Sync for Node<LexemeT, StorageT>
impl<LexemeT, StorageT> Unpin for Node<LexemeT, StorageT>
impl<LexemeT, StorageT> UnwindSafe for Node<LexemeT, StorageT>where
LexemeT: UnwindSafe,
StorageT: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)