[−][src]Struct antlr_rust::BaseLexer
Default implementation of Lexer
Public fields in this struct are intended to be used by embedded actions
Fields
interpreter: Option<Box<LexerATNSimulator>>
LexerATNSimulator
instance of this lexer
input: Option<Input>
CharStream
used by this lexer
token_start_char_index: isize
token_start_line: isize
token_start_column: isize
token_type: isize
Overrides token type emitted by lexer for current token
token: Option<TF::Tok>
Make it Some
to override token that is currently being generated by lexer
channel: isize
Channel lexer is currently assigning tokens to
mode: usize
Mode lexer is currently in
text: Option<<TF::Data as ToOwned>::Owned>
Make it Some
to override text for token that is currently being generated by lexer
Implementations
impl<'input, T, Input, TF> BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
pub fn get_char_index(&self) -> isize
[src]
Current position in input stream
pub fn get_text<'a>(&'a self) -> Cow<'a, TF::Data> where
'input: 'a,
[src]
'input: 'a,
Current token text
pub fn set_text(&mut self, _text: <TF::Data as ToOwned>::Owned)
[src]
Used from lexer actions to override text of the token that will be emitted next
pub fn add_error_listener(
&mut self,
listener: Box<dyn ErrorListener<'input, Self>>
)
[src]
&mut self,
listener: Box<dyn ErrorListener<'input, Self>>
)
Add error listener
pub fn remove_error_listeners(&mut self)
[src]
Remove and drop all error listeners
pub fn new_base_lexer(
input: Input,
interpreter: LexerATNSimulator,
recog: T,
factory: &'input TF
) -> Self
[src]
input: Input,
interpreter: LexerATNSimulator,
recog: T,
factory: &'input TF
) -> Self
Creates new lexer instance
Trait Implementations
impl<'input, T, Input, TF> Deref for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
impl<'input, T, Input, TF> DerefMut for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
impl<'input, T, Input, TF> Lexer<'input> for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
type Input = Input
Concrete input stream used by this parser
pub fn input(&mut self) -> &mut Self::Input
[src]
pub fn set_channel(&mut self, v: isize)
[src]
pub fn push_mode(&mut self, m: usize)
[src]
pub fn pop_mode(&mut self) -> Option<usize>
[src]
pub fn set_type(&mut self, t: isize)
[src]
pub fn set_mode(&mut self, m: usize)
[src]
pub fn more(&mut self)
[src]
pub fn skip(&mut self)
[src]
pub fn reset(&mut self)
[src]
pub fn get_interpreter(&self) -> Option<&LexerATNSimulator>
[src]
impl<'input, T, Input, TF> TokenSource<'input> for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
type TF = TF
TokenFactory this token source produce tokens with
pub fn next_token(&mut self) -> <Self::TF as TokenFactory<'input>>::Tok
[src]
pub fn get_line(&self) -> isize
[src]
pub fn get_char_position_in_line(&self) -> isize
[src]
pub fn get_input_stream(&mut self) -> Option<&mut dyn IntStream>
[src]
pub fn get_source_name(&self) -> String
[src]
pub fn get_token_factory(&self) -> &'input TF
[src]
Auto Trait Implementations
impl<'input, T, Input, TF = CommonTokenFactory> !RefUnwindSafe for BaseLexer<'input, T, Input, TF>
[src]
impl<'input, T, Input, TF = CommonTokenFactory> !Send for BaseLexer<'input, T, Input, TF>
[src]
impl<'input, T, Input, TF = CommonTokenFactory> !Sync for BaseLexer<'input, T, Input, TF>
[src]
impl<'input, T, Input, TF> Unpin for BaseLexer<'input, T, Input, TF> where
Input: Unpin,
T: Unpin,
<<TF as TokenFactory<'input>>::Data as ToOwned>::Owned: Unpin,
<TF as TokenFactory<'input>>::Tok: Unpin,
[src]
Input: Unpin,
T: Unpin,
<<TF as TokenFactory<'input>>::Data as ToOwned>::Owned: Unpin,
<TF as TokenFactory<'input>>::Tok: Unpin,
impl<'input, T, Input, TF = CommonTokenFactory> !UnwindSafe for BaseLexer<'input, T, Input, TF>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> NodeText for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,