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

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

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

type TF: TokenFactory<'input> + 'input[src]

Token factory that created tokens in this stream

Loading content...

Required methods

pub fn lt(
    &mut self,
    k: isize
) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
[src]

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

pub fn get(&self, index: isize) -> &<Self::TF as TokenFactory<'input>>::Tok[src]

Returns reference to token at index

pub fn get_token_source(&self) -> &dyn TokenSource<'input, TF = Self::TF>[src]

Token source that produced data for tokens for this stream

pub fn get_text_from_interval(&self, start: isize, stop: isize) -> String[src]

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

Loading content...

Provided methods

pub fn get_all_text(&self) -> String[src]

Get combined text of all tokens in this stream

pub fn get_text_from_tokens<T: Token + ?Sized>(&self, a: &T, b: &T) -> String where
    Self: Sized
[src]

Get combined text of tokens in between a and b

Loading content...

Implementors

impl<'input, T: TokenSource<'input>> TokenStream<'input> for CommonTokenStream<'input, T>[src]

type TF = T::TF

impl<'input, T: TokenSource<'input>> TokenStream<'input> for UnbufferedTokenStream<'input, T>[src]

type TF = T::TF

Loading content...