[][src]Trait antlr_rust::Lexer

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

Lexer functionality required by LexerATNSimulator to work properly

Associated Types

type Input: IntStream[src]

Concrete input stream used by this parser

Loading content...

Required methods

pub fn input(&mut self) -> &mut Self::Input[src]

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

pub fn set_channel(&mut self, v: isize)[src]

Sets channel where current token will be pushed

By default two channels are available:

  • LEXER_DEFAULT_TOKEN_CHANNEL
  • LEXER_HIDDEN

pub fn push_mode(&mut self, m: usize)[src]

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

pub fn pop_mode(&mut self) -> Option<usize>[src]

Pops mode from internal mode stack

pub fn set_type(&mut self, t: isize)[src]

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

pub fn set_mode(&mut self, m: usize)[src]

Sets lexer mode discarding current one

pub fn more(&mut self)[src]

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

pub fn skip(&mut self)[src]

Tells lexer to completely ignore and not emit current token.

Loading content...

Implementors

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]

type Input = Input

Loading content...