Trait antlr_rust::Lexer[][src]

pub trait Lexer<'input>: TokenSource<'input> + Recognizer<'input, Node = EmptyContextType<'input, <Self as TokenAware<'input>>::TF>> {
    type Input: IntStream;
    fn input(&mut self) -> &mut Self::Input;
fn set_channel(&mut self, v: isize);
fn push_mode(&mut self, m: usize);
fn pop_mode(&mut self) -> Option<usize>;
fn set_type(&mut self, t: isize);
fn set_mode(&mut self, m: usize);
fn more(&mut self);
fn skip(&mut self); }
Expand description

Lexer functionality required by LexerATNSimulator to work properly

Associated Types

Concrete input stream used by this parser

Required methods

Same as TokenStream::get_input_stream but returns concrete type instance important for proper inlining in hot code of LexerATNSimulator

Sets channel where current token will be pushed

By default two channels are available:

  • LEXER_DEFAULT_TOKEN_CHANNEL
  • LEXER_HIDDEN

Pushes current mode to internal mode stack and sets m as current lexer mode `pop_mode should be used to recover previous mode

Pops mode from internal mode stack

Sets type of the current token Called from action to override token that will be emitted by lexer

Sets lexer mode discarding current one

Used to informs lexer that it should consider next token as a continuation of the current one

Tells lexer to completely ignore and not emit current token.

Implementors