Struct hime_redist::parsers::rnglr::RNGLRAutomaton
source · pub struct RNGLRAutomaton { /* private fields */ }
Expand description
Represents the RNGLR parsing table and productions
Implementations§
source§impl RNGLRAutomaton
impl RNGLRAutomaton
sourcepub fn new(data: &[u8]) -> RNGLRAutomaton
pub fn new(data: &[u8]) -> RNGLRAutomaton
Initializes a new automaton from the given binary data
sourcepub fn get_states_count(&self) -> usize
pub fn get_states_count(&self) -> usize
Gets the number of states in this automaton
sourcepub fn get_contexts(&self, state: u32) -> &LRContexts
pub fn get_contexts(&self, state: u32) -> &LRContexts
Gets the contexts opened by the specified state
sourcepub fn get_actions_count(&self, state: u32, identifier: u32) -> usize
pub fn get_actions_count(&self, state: u32, identifier: u32) -> usize
Gets the number of GLR actions for the given state and symbol identifier
sourcepub fn get_action(&self, state: u32, identifier: u32, index: usize) -> LRAction<'_>
pub fn get_action(&self, state: u32, identifier: u32, index: usize) -> LRAction<'_>
Gets the i-th GLR action for the given state and sid
sourcepub fn get_production(&self, index: usize) -> &LRProduction
pub fn get_production(&self, index: usize) -> &LRProduction
Gets the i-th production
sourcepub fn get_nullable_production(&self, index: usize) -> Option<&LRProduction>
pub fn get_nullable_production(&self, index: usize) -> Option<&LRProduction>
Gets the production for the nullable variable with the given index
sourcepub fn is_accepting_state(&self, state: u32) -> bool
pub fn is_accepting_state(&self, state: u32) -> bool
Determine whether the given state is the accepting state
sourcepub fn get_expected(&self, state: u32, terminals: &'static [Symbol]) -> LRExpected
pub fn get_expected(&self, state: u32, terminals: &'static [Symbol]) -> LRExpected
Gets the expected terminals for the specified state