[−][src]Trait antlr_rust::token_source::TokenSource
Provides tokens for parser via TokenStream
Required methods
fn next_token(&mut self) -> <Self::TF as TokenFactory<'input>>::Tok
fn get_line(&self) -> isize
Get the line number for the current position in the input stream. The first line in the input is line 1.
@return The line number for the current position in the input stream, or 0 if the current token source does not track line numbers.
fn get_char_position_in_line(&self) -> isize
Get the index into the current line for the current position in the input stream. The first character on a line has position 0.
@return The line number for the current position in the input stream, or -1 if the current token source does not track character positions.
fn get_input_stream(&mut self) -> Option<&mut dyn IntStream>
fn get_source_name(&self) -> String
fn get_token_factory(&self) -> &'input Self::TF
Gets the {@link TokenFactory} this token source is currently using for creating {@link Token} objects from the input.
Required by Parser
for creating missing tokens.
@return The {@link TokenFactory} currently used by this token source.
Implementations on Foreign Types
impl<'input, T, '_> TokenSource<'input> for &'_ mut T where
T: TokenSource<'input>,
[src]
T: TokenSource<'input>,
fn next_token(&mut self) -> <Self::TF as TokenFactory<'input>>::Tok
[src]
fn get_line(&self) -> isize
[src]
fn get_char_position_in_line(&self) -> isize
[src]
fn get_input_stream(&mut self) -> Option<&mut dyn IntStream>
[src]
fn get_source_name(&self) -> String
[src]
fn get_token_factory(&self) -> &'input Self::TF
[src]
Implementors
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>,