Struct hime_redist::parsers::lrk::LRkAutomaton
source · pub struct LRkAutomaton { /* private fields */ }
Expand description
Represents the LR(k) parsing table and productions
Implementations§
source§impl LRkAutomaton
impl LRkAutomaton
sourcepub fn new(data: &[u8]) -> LRkAutomaton
pub fn new(data: &[u8]) -> LRkAutomaton
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_action(&self, state: u32, identifier: u32) -> LRAction<'_>
pub fn get_action(&self, state: u32, identifier: u32) -> LRAction<'_>
Gets the LR(k) 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_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