pub struct LexerAtn { /* private fields */ }Expand description
Deserialized lexer Abstract Transition Network.
The structure keeps the state graph plus ANTLR side tables such as rule-to-start, rule-to-token, mode-to-start, decisions, and actions. Parser ATNs never use this object-graph representation.
Implementations§
Source§impl LexerAtn
impl LexerAtn
Sourcepub const fn new(max_token_type: i32) -> Self
pub const fn new(max_token_type: i32) -> Self
Creates an empty lexer ATN with the maximum token type read from the serialized header.
pub const fn max_token_type(&self) -> i32
pub fn states(&self) -> &[LexerAtnState]
pub fn state(&self, state_number: usize) -> Option<&LexerAtnState>
pub fn state_mut(&mut self, state_number: usize) -> Option<&mut LexerAtnState>
Sourcepub fn add_state(&mut self, state: LexerAtnState) -> usize
pub fn add_state(&mut self, state: LexerAtnState) -> usize
Appends a state and returns the state number assigned by insertion order.
pub fn decision_to_state(&self) -> &[usize]
pub fn add_decision_state(&mut self, state_number: usize)
pub fn rule_to_start_state(&self) -> &[usize]
pub fn set_rule_to_start_state(&mut self, rule_to_start_state: Vec<usize>)
pub fn rule_to_stop_state(&self) -> &[usize]
pub fn set_rule_to_stop_state(&mut self, rule_to_stop_state: Vec<usize>)
pub fn rule_to_token_type(&self) -> &[i32]
pub fn set_rule_to_token_type(&mut self, rule_to_token_type: Vec<i32>)
pub fn mode_to_start_state(&self) -> &[usize]
pub fn add_mode_start_state(&mut self, state_number: usize)
pub fn lexer_actions(&self) -> &[LexerAction]
pub fn set_lexer_actions(&mut self, lexer_actions: Vec<LexerAction>)
Trait Implementations§
impl Eq for LexerAtn
impl StructuralPartialEq for LexerAtn
Auto Trait Implementations§
impl Freeze for LexerAtn
impl RefUnwindSafe for LexerAtn
impl Send for LexerAtn
impl Sync for LexerAtn
impl Unpin for LexerAtn
impl UnsafeUnpin for LexerAtn
impl UnwindSafe for LexerAtn
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