[−][src]Trait antlr_rust::token_stream::TokenStream
An IntSteam
of Token
s
Used as an input for Parser
s
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
Required methods
pub fn lt(
&mut self,
k: isize
) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
[src]
&mut self,
k: isize
) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
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
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]
Self: Sized,
Get combined text of tokens in between a
and b
Implementors
impl<'input, T: TokenSource<'input>> TokenStream<'input> for CommonTokenStream<'input, T>
[src]
type TF = T::TF
pub fn lt(
&mut self,
k: isize
) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
[src]
&mut self,
k: isize
) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
pub fn get(&self, index: isize) -> &<Self::TF as TokenFactory<'input>>::Tok
[src]
pub fn get_token_source(&self) -> &dyn TokenSource<'input, TF = Self::TF>
[src]
pub fn get_text_from_interval(&self, start: isize, stop: isize) -> String
[src]
impl<'input, T: TokenSource<'input>> TokenStream<'input> for UnbufferedTokenStream<'input, T>
[src]
type TF = T::TF
pub fn lt(
&mut self,
i: isize
) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
[src]
&mut self,
i: isize
) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>