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

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_inner(
        &self,
        index: isize
    ) -> &<Self::TF as TokenFactory<'input>>::Inner;
fn get_token_source(&self) -> &dyn TokenSource<'input, TF = Self::TF>;
fn get_all_text(&self) -> String;
fn get_text_from_interval(&self, start: isize, stop: isize) -> String; 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

Output token type

Loading content...

Required methods

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_inner(&self, index: isize) -> &<Self::TF as TokenFactory<'input>>::Inner

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

fn get_all_text(&self) -> String

fn get_text_from_interval(&self, start: isize, stop: isize) -> String

Loading content...

Provided methods

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

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...