pub struct LexerCustomAction { /* private fields */ }Expand description
Grammar-specific lexer action reached on the accepted ATN path.
ANTLR serializes embedded lexer actions as (rule_index, action_index)
pairs. The runtime also records the input position where the action was
reached so generated code can evaluate templates such as Text() at the
same point as a generated ANTLR lexer, not only at the token end.
Implementations§
Source§impl LexerCustomAction
impl LexerCustomAction
Sourcepub const fn new(rule_index: i32, action_index: i32, position: usize) -> Self
pub const fn new(rule_index: i32, action_index: i32, position: usize) -> Self
Creates a custom lexer action event from serialized ATN metadata.
Sourcepub const fn rule_index(self) -> i32
pub const fn rule_index(self) -> i32
Lexer rule index that owns the embedded action.
Sourcepub const fn action_index(self) -> i32
pub const fn action_index(self) -> i32
Per-rule action index assigned by ANTLR serialization.
Trait Implementations§
Source§impl Clone for LexerCustomAction
impl Clone for LexerCustomAction
Source§fn clone(&self) -> LexerCustomAction
fn clone(&self) -> LexerCustomAction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LexerCustomAction
impl Debug for LexerCustomAction
Source§impl PartialEq for LexerCustomAction
impl PartialEq for LexerCustomAction
Source§fn eq(&self, other: &LexerCustomAction) -> bool
fn eq(&self, other: &LexerCustomAction) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for LexerCustomAction
impl Eq for LexerCustomAction
impl StructuralPartialEq for LexerCustomAction
Auto Trait Implementations§
impl Freeze for LexerCustomAction
impl RefUnwindSafe for LexerCustomAction
impl Send for LexerCustomAction
impl Sync for LexerCustomAction
impl Unpin for LexerCustomAction
impl UnsafeUnpin for LexerCustomAction
impl UnwindSafe for LexerCustomAction
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