Trait antlr_rust::token_stream::TokenStream[][src]

pub trait TokenStream<'input>: IntStream {
    type TF: TokenFactory<'input> + 'input;
    fn lt(
        &mut self,
        k: isize
    ) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>;
fn get(&self, index: isize) -> &<Self::TF as TokenFactory<'input>>::Tok;
fn get_token_source(&self) -> &dyn TokenSource<'input, TF = Self::TF>;
fn get_text_from_interval(&self, start: isize, stop: isize) -> String; fn get_all_text(&self) -> String { ... }
fn get_text_from_tokens<T: Token + ?Sized>(&self, a: &T, b: &T) -> String
    where
        Self: Sized
, { ... } }
Expand description

An IntSteam of Tokens

Used as an input for Parsers If there is an existing source of tokens, you should implement TokenSource, not TokenStream

Associated Types

Token factory that created tokens in this stream

Required methods

Lookahead for tokens, same as IntSteam::la but return reference to full token

Returns reference to token at index

Token source that produced data for tokens for this stream

Get combined text of tokens in start..=stop interval

Provided methods

Get combined text of all tokens in this stream

Get combined text of tokens in between a and b

Implementors