Struct antlr_rust::common_token_stream::CommonTokenStream
source · [−]pub struct CommonTokenStream<'input, T: TokenSource<'input>> { /* private fields */ }
Expand description
Default token stream that skips token that not correspond to current channel.
Implementations
sourceimpl<'input, T: TokenSource<'input>> CommonTokenStream<'input, T>
impl<'input, T: TokenSource<'input>> CommonTokenStream<'input, T>
sourcepub fn new(lexer: T) -> CommonTokenStream<'input, T>
pub fn new(lexer: T) -> CommonTokenStream<'input, T>
Creates CommonTokenStream that produces tokens from TOKEN_DEFAULT_CHANNEL
sourcepub fn with_channel(lexer: T, channel: isize) -> CommonTokenStream<'input, T>
pub fn with_channel(lexer: T, channel: isize) -> CommonTokenStream<'input, T>
Creates CommonTokenStream that produces tokens from channel
sourcepub fn iter(&mut self) -> IterWrapper<'_, Self>ⓘNotable traits for IterWrapper<'a, T>impl<'a, T: IntStream> Iterator for IterWrapper<'a, T> type Item = isize;
pub fn iter(&mut self) -> IterWrapper<'_, Self>ⓘNotable traits for IterWrapper<'a, T>impl<'a, T: IntStream> Iterator for IterWrapper<'a, T> type Item = isize;
Creates iterator over this token stream
Trait Implementations
sourceimpl<'input, T: Debug + TokenSource<'input>> Debug for CommonTokenStream<'input, T>
impl<'input, T: Debug + TokenSource<'input>> Debug for CommonTokenStream<'input, T>
sourceimpl<'input, T: TokenSource<'input>> IntStream for CommonTokenStream<'input, T>
impl<'input, T: TokenSource<'input>> IntStream for CommonTokenStream<'input, T>
sourcefn consume(&mut self)
fn consume(&mut self)
Consumes the current symbol in the stream. Advances this stream to the next element. Read more
sourcefn mark(&mut self) -> isize
fn mark(&mut self) -> isize
After this call subsequent calls to seek must succeed if seek index is greater than mark index Read more
sourcefn seek(&mut self, index: isize)
fn seek(&mut self, index: isize)
Put stream back in state it was when it was in index
position Read more
sourcefn get_source_name(&self) -> String
fn get_source_name(&self) -> String
Returns name of the source this stream operates over if any
sourceimpl<'input, T: TokenSource<'input>> TokenStream<'input> for CommonTokenStream<'input, T>
impl<'input, T: TokenSource<'input>> TokenStream<'input> for CommonTokenStream<'input, T>
type TF = <T as TokenSource<'input>>::TF
type TF = <T as TokenSource<'input>>::TF
Token factory that created tokens in this stream
sourcefn lt(&mut self, k: isize) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
fn lt(&mut self, k: isize) -> Option<&<Self::TF as TokenFactory<'input>>::Tok>
Lookahead for tokens, same as IntSteam::la
but return reference to full token
sourcefn get(&self, index: isize) -> &<Self::TF as TokenFactory<'input>>::Tok
fn get(&self, index: isize) -> &<Self::TF as TokenFactory<'input>>::Tok
Returns reference to token at index
sourcefn get_token_source(&self) -> &dyn TokenSource<'input, TF = Self::TF>
fn get_token_source(&self) -> &dyn TokenSource<'input, TF = Self::TF>
Token source that produced data for tokens for this stream
sourcefn get_text_from_interval(&self, start: isize, stop: isize) -> String
fn get_text_from_interval(&self, start: isize, stop: isize) -> String
Get combined text of tokens in start..=stop interval
sourcefn get_all_text(&self) -> String
fn get_all_text(&self) -> String
Get combined text of all tokens in this stream
impl<'input, T: TidAble<'input>> TidAble<'input> for CommonTokenStream<'input, T> where
T: TokenSource<'input>,
Auto Trait Implementations
impl<'input, T> RefUnwindSafe for CommonTokenStream<'input, T> where
T: RefUnwindSafe,
<<T as TokenSource<'input>>::TF as TokenFactory<'input>>::Tok: RefUnwindSafe,
impl<'input, T> Send for CommonTokenStream<'input, T> where
T: Send,
<<T as TokenSource<'input>>::TF as TokenFactory<'input>>::Tok: Send,
impl<'input, T> Sync for CommonTokenStream<'input, T> where
T: Sync,
<<T as TokenSource<'input>>::TF as TokenFactory<'input>>::Tok: Sync,
impl<'input, T> Unpin for CommonTokenStream<'input, T> where
T: Unpin,
<<T as TokenSource<'input>>::TF as TokenFactory<'input>>::Tok: Unpin,
impl<'input, T> UnwindSafe for CommonTokenStream<'input, T> where
T: UnwindSafe,
<<T as TokenSource<'input>>::TF as TokenFactory<'input>>::Tok: UnwindSafe,
Blanket Implementations
sourceimpl<T> AnyExt for T where
T: Any + ?Sized,
impl<T> AnyExt for T where
T: Any + ?Sized,
sourcefn downcast_ref<T>(this: &Self) -> Option<&T> where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T> where
T: Any,
Attempts to downcast this to T
behind reference
sourcefn downcast_mut<T>(this: &mut Self) -> Option<&mut T> where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T> where
T: Any,
Attempts to downcast this to T
behind mutable reference
sourcefn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Any,
Attempts to downcast this to T
behind Rc
pointer
sourcefn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Any,
Attempts to downcast this to T
behind Arc
pointer
sourcefn downcast_box<T>(
this: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Any,
fn downcast_box<T>(
this: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Any,
Attempts to downcast this to T
behind Box
pointer
sourcefn downcast_move<T>(this: Self) -> Option<T> where
T: Any,
fn downcast_move<T>(this: Self) -> Option<T> where
T: Any,
Attempts to downcast owned Self
to T
,
useful only in generic context as a workaround for specialization Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, X> CoerceTo<T> for X where
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for X where
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X, Global>) -> Box<T, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
sourceimpl<'a, X> TidExt<'a> for X where
X: Tid<'a> + ?Sized,
impl<'a, X> TidExt<'a> for X where
X: Tid<'a> + ?Sized,
sourcefn is<T>(&self) -> bool where
T: Tid<'a>,
fn is<T>(&self) -> bool where
T: Tid<'a>,
Returns true if type behind self is equal to the type of T.
sourcefn downcast_ref<T>(&'b self) -> Option<&'b T> where
T: Tid<'a>,
fn downcast_ref<T>(&'b self) -> Option<&'b T> where
T: Tid<'a>,
Attempts to downcast self to T
behind reference
sourcefn downcast_mut<T>(&'b mut self) -> Option<&'b mut T> where
T: Tid<'a>,
fn downcast_mut<T>(&'b mut self) -> Option<&'b mut T> where
T: Tid<'a>,
Attempts to downcast self to T
behind mutable reference
sourcefn downcast_rc<T>(self: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Tid<'a>,
fn downcast_rc<T>(self: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Tid<'a>,
Attempts to downcast self to T
behind Rc
pointer
sourcefn downcast_arc<T>(self: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Tid<'a>,
fn downcast_arc<T>(self: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Tid<'a>,
Attempts to downcast self to T
behind Arc
pointer
sourcefn downcast_box<T>(
self: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Tid<'a>,
fn downcast_box<T>(
self: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Tid<'a>,
Attempts to downcast self to T
behind Box
pointer
sourcefn downcast_move<T>(self) -> Option<T> where
T: Tid<'a>,
fn downcast_move<T>(self) -> Option<T> where
T: Tid<'a>,
Attempts to downcast owned Self
to T
,
useful only in generic context as a workaround for specialization Read more