pub struct Parser {
pub rules: Vec<ProductionRule<&'static str, ChunkOrExpressionsNonTerminals>>,
pub states: Vec<SparseState<ChunkOrExpressionsNonTerminals, SmallVecU8>>,
pub classes: Vec<Vec<&'static str>>,
}Expand description
A struct that holds the entire parser table and production rules.
Fields§
§rules: Vec<ProductionRule<&'static str, ChunkOrExpressionsNonTerminals>>production rules
states: Vec<SparseState<ChunkOrExpressionsNonTerminals, SmallVecU8>>states
classes: Vec<Vec<&'static str>>terminal classes
Implementations§
Source§impl ChunkOrExpressionsParser
A struct that holds the whole parser table.
impl ChunkOrExpressionsParser
A struct that holds the whole parser table.
Trait Implementations§
Source§impl Parser for ChunkOrExpressionsParser
impl Parser for ChunkOrExpressionsParser
Source§type State = SparseState<ChunkOrExpressionsNonTerminals, SmallVec<[u8; 16]>>
type State = SparseState<ChunkOrExpressionsNonTerminals, SmallVec<[u8; 16]>>
The type of the parser state.
Source§type TerminalClassElement = &'static str
type TerminalClassElement = &'static str
A type to represent single element in a terminal class. Read more
Source§fn class_precedence(&self, class: TerminalSymbol<usize>) -> Option<usize>
fn class_precedence(&self, class: TerminalSymbol<usize>) -> Option<usize>
Get the precedence level (priority) of the given terminal class
None if the terminal class has no precedence defined.Source§fn precedence_types(&self, level: usize) -> Option<ReduceType>
fn precedence_types(&self, level: usize) -> Option<ReduceType>
Get the type of precedence for i’th level.
None if i’th level was defined as %precedence (no reduce type).Source§fn get_rules(
&self,
) -> &[ProductionRule<&'static str, ChunkOrExpressionsNonTerminals>]
fn get_rules( &self, ) -> &[ProductionRule<&'static str, ChunkOrExpressionsNonTerminals>]
Get list of production rules
Source§fn get_states(
&self,
) -> &[SparseState<ChunkOrExpressionsNonTerminals, SmallVecU8>]
fn get_states( &self, ) -> &[SparseState<ChunkOrExpressionsNonTerminals, SmallVecU8>]
Get list of states
Source§fn get_terminals(
&self,
i: usize,
) -> Option<impl IntoIterator<Item = Self::TerminalClassElement> + '_>
fn get_terminals( &self, i: usize, ) -> Option<impl IntoIterator<Item = Self::TerminalClassElement> + '_>
Get set of terminals for i’th terminal class
Source§fn to_terminal_class(&self, terminal: &Self::Term) -> usize
fn to_terminal_class(&self, terminal: &Self::Term) -> usize
Get the terminal class of the given terminal
Source§fn error_used() -> bool
fn error_used() -> bool
whether the
error token was used in the grammar.Auto Trait Implementations§
impl Freeze for ChunkOrExpressionsParser
impl RefUnwindSafe for ChunkOrExpressionsParser
impl Send for ChunkOrExpressionsParser
impl Sync for ChunkOrExpressionsParser
impl Unpin for ChunkOrExpressionsParser
impl UnwindSafe for ChunkOrExpressionsParser
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