Struct hime_redist::lexers::automaton::AutomatonState
source · pub struct AutomatonState<'a> { /* private fields */ }
Expand description
Represents a state in the automaton of a lexer Binary data structure: u16: number of matched terminals u16: total number of transitions u16: number of non-cached transitions – matched terminals u16: context identifier u16: index of the matched terminal – cache: 256 entries u16: next state’s index for index of the entry – transitions each transition is of the form: u16: start of the range u16: end of the range u16: next state’s index
Implementations§
source§impl<'a> AutomatonState<'a>
impl<'a> AutomatonState<'a>
sourcepub fn get_terminals_count(&self) -> usize
pub fn get_terminals_count(&self) -> usize
Gets the number of matched terminals in this state
sourcepub fn get_terminal(&self, index: usize) -> MatchedTerminal
pub fn get_terminal(&self, index: usize) -> MatchedTerminal
Gets the i-th matched terminal in this state
sourcepub fn is_dead_end(&self) -> bool
pub fn is_dead_end(&self) -> bool
Gets whether this state is a dead end (no more transition)
sourcepub fn get_bulk_transitions_count(&self) -> usize
pub fn get_bulk_transitions_count(&self) -> usize
Gets the number of non-cached transitions in this state
sourcepub fn get_cached_transition(&self, value: Utf16C) -> u32
pub fn get_cached_transition(&self, value: Utf16C) -> u32
Gets the target of the cached transition for the specified value
sourcepub fn get_bulk_transition(&self, index: usize) -> AutomatonTransition
pub fn get_bulk_transition(&self, index: usize) -> AutomatonTransition
Gets the i-th non-cached transition in this state
sourcepub fn get_target_by(&self, value: Utf16C) -> u32
pub fn get_target_by(&self, value: Utf16C) -> u32
Gets the target of a transition from this state on the specified value
Trait Implementations§
source§impl<'a> Clone for AutomatonState<'a>
impl<'a> Clone for AutomatonState<'a>
source§fn clone(&self) -> AutomatonState<'a>
fn clone(&self) -> AutomatonState<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more