[−][src]Struct antlr_rust::BaseLexer
Default implementation of Lexer
Public fields in this struct are intended to be used by embedded actions
Fields
interpreter: Option<Box<LexerATNSimulator>>
LexerATNSimulator
instance of this lexer
input: Option<Input>
CharStream
used by this lexer
token_start_char_index: isize
token_start_line: isize
token_start_column: isize
token_type: isize
Overrides token type emitted by lexer for current token
token: Option<TF::Tok>
Make it Some
to override token that is currently being generated by lexer
channel: isize
Channel lexer is currently assigning tokens to
mode: usize
Mode lexer is currently in
text: Option<<TF::Data as ToOwned>::Owned>
Make it Some
to override text for token that is currently being generated by lexer
Implementations
impl<'input, T, Input, TF> BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src][−]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
pub fn get_char_index(&self) -> isize
[src][−]
Current position in input stream
pub fn get_text<'a>(&'a self) -> Cow<'a, TF::Data> where
'input: 'a,
[src][−]
'input: 'a,
Current token text
pub fn set_text(&mut self, _text: <TF::Data as ToOwned>::Owned)
[src][−]
Used from lexer actions to override text of the token that will be emitted next
pub fn add_error_listener(
&mut self,
listener: Box<dyn ErrorListener<'input, Self>>
)
[src][−]
&mut self,
listener: Box<dyn ErrorListener<'input, Self>>
)
Add error listener
pub fn remove_error_listeners(&mut self)
[src][−]
Remove and drop all error listeners
pub fn new_base_lexer(
input: Input,
interpreter: LexerATNSimulator,
recog: T,
factory: &'input TF
) -> Self
[src][−]
input: Input,
interpreter: LexerATNSimulator,
recog: T,
factory: &'input TF
) -> Self
Creates new lexer instance
Trait Implementations
impl<'input, T, Input, TF> Deref for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src][+]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
impl<'input, T, Input, TF> DerefMut for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src][+]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
impl<'input, T, Input, TF> Lexer<'input> for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src][+]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
impl<'input, T, Input, TF> TokenSource<'input> for BaseLexer<'input, T, Input, TF> where
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
[src][+]
T: LexerRecog<'input, Self> + 'static,
Input: CharStream<TF::From>,
TF: TokenFactory<'input>,
Auto Trait Implementations
impl<'input, T, Input, TF = CommonTokenFactory> !RefUnwindSafe for BaseLexer<'input, T, Input, TF>
[src]
impl<'input, T, Input, TF = CommonTokenFactory> !Send for BaseLexer<'input, T, Input, TF>
[src]
impl<'input, T, Input, TF = CommonTokenFactory> !Sync for BaseLexer<'input, T, Input, TF>
[src]
impl<'input, T, Input, TF> Unpin for BaseLexer<'input, T, Input, TF> where
Input: Unpin,
T: Unpin,
<<TF as TokenFactory<'input>>::Data as ToOwned>::Owned: Unpin,
<TF as TokenFactory<'input>>::Tok: Unpin,
[src]
Input: Unpin,
T: Unpin,
<<TF as TokenFactory<'input>>::Data as ToOwned>::Owned: Unpin,
<TF as TokenFactory<'input>>::Tok: Unpin,
impl<'input, T, Input, TF = CommonTokenFactory> !UnwindSafe for BaseLexer<'input, T, Input, TF>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> NodeText for T
[src][+]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,