Struct rustemo::StringLexer
source · pub struct StringLexer<C, S, TK, TR: 'static, const TERMINAL_COUNT: usize> { /* private fields */ }
Expand description
A lexer that operates over string inputs and uses generated string and regex recognizers provided by the parser table.
Implementations§
source§impl<'i, C: Context<'i, str, S, TK>, S: State, TK, TR: TokenRecognizer<'i>, const TERMINAL_COUNT: usize> StringLexer<C, S, TK, TR, TERMINAL_COUNT>
impl<'i, C: Context<'i, str, S, TK>, S: State, TK, TR: TokenRecognizer<'i>, const TERMINAL_COUNT: usize> StringLexer<C, S, TK, TR, TERMINAL_COUNT>
pub fn new( skip_ws: bool, token_recognizers: &'static [TR; TERMINAL_COUNT] ) -> Self
Trait Implementations§
source§impl<'i, C, S, TK, TR, const TERMINAL_COUNT: usize> Lexer<'i, C, S, TK> for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
impl<'i, C, S, TK, TR, const TERMINAL_COUNT: usize> Lexer<'i, C, S, TK> for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
type Input = str
source§fn next_tokens(
&self,
context: &mut C,
input: &'i Self::Input,
expected_tokens: Vec<(TK, bool)>
) -> Box<dyn Iterator<Item = Token<'i, Self::Input, TK>> + 'i>
fn next_tokens( &self, context: &mut C, input: &'i Self::Input, expected_tokens: Vec<(TK, bool)> ) -> Box<dyn Iterator<Item = Token<'i, Self::Input, TK>> + 'i>
Given the current context, this method yield an iterator over possible
tokens found at the current location where the order and kinds of token
to look for, and its finish flags, are given by the
expected_tokens
parameter. Read moreAuto Trait Implementations§
impl<C, S, TK, TR, const TERMINAL_COUNT: usize> RefUnwindSafe for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
impl<C, S, TK, TR, const TERMINAL_COUNT: usize> Send for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
impl<C, S, TK, TR, const TERMINAL_COUNT: usize> Sync for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
impl<C, S, TK, TR, const TERMINAL_COUNT: usize> Unpin for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
impl<C, S, TK, TR, const TERMINAL_COUNT: usize> UnwindSafe for StringLexer<C, S, TK, TR, TERMINAL_COUNT>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more