pub struct Lexer<'input, Iter: Iterator<Item = char> + Clone, Token, State, Error, Wrapper> {
pub __state: usize,
pub __done: bool,
pub __initial_state: usize,
pub __iter: Peekable<Iter>,
/* private fields */
}
Expand description
Common parts in lexers generated by lexgen.
Fields are used by lexgen-generated code and should not be used directly.
Fields§
§__state: usize
§__done: bool
§__initial_state: usize
§__iter: Peekable<Iter>
Implementations§
Source§impl<I: Iterator<Item = char> + Clone, T, S: Default, E, W> Lexer<'static, I, T, S, E, W>
impl<I: Iterator<Item = char> + Clone, T, S: Default, E, W> Lexer<'static, I, T, S, E, W>
pub fn new_from_iter(iter: I) -> Self
Source§impl<I: Iterator<Item = char> + Clone, T, S, E, W> Lexer<'static, I, T, S, E, W>
impl<I: Iterator<Item = char> + Clone, T, S, E, W> Lexer<'static, I, T, S, E, W>
pub fn new_from_iter_with_state(iter: I, state: S) -> Self
Source§impl<'input, T, S, E, W> Lexer<'input, Chars<'input>, T, S, E, W>
impl<'input, T, S, E, W> Lexer<'input, Chars<'input>, T, S, E, W>
pub fn new_with_state(input: &'input str, state: S) -> Self
Source§impl<'input, I: Iterator<Item = char> + Clone, T, S, E, W> Lexer<'input, I, T, S, E, W>
impl<'input, I: Iterator<Item = char> + Clone, T, S, E, W> Lexer<'input, I, T, S, E, W>
pub fn next(&mut self) -> Option<char>
pub fn peek(&mut self) -> Option<char>
pub fn backtrack( &mut self, ) -> Result<for<'lexer> fn(&'lexer mut W) -> SemanticActionResult<Result<T, E>>, LexerError<E>>
pub fn reset_accepting_state(&mut self)
pub fn set_accepting_state( &mut self, semantic_action_fn: for<'lexer> fn(&'lexer mut W) -> SemanticActionResult<Result<T, E>>, )
pub fn reset_match(&mut self)
pub fn match_(&self) -> &'input str
pub fn match_loc(&self) -> (Loc, Loc)
pub fn state(&mut self) -> &mut S
Trait Implementations§
Auto Trait Implementations§
impl<'input, Iter, Token, State, Error, Wrapper> Freeze for Lexer<'input, Iter, Token, State, Error, Wrapper>
impl<'input, Iter, Token, State, Error, Wrapper> RefUnwindSafe for Lexer<'input, Iter, Token, State, Error, Wrapper>where
State: RefUnwindSafe,
Iter: RefUnwindSafe,
impl<'input, Iter, Token, State, Error, Wrapper> Send for Lexer<'input, Iter, Token, State, Error, Wrapper>
impl<'input, Iter, Token, State, Error, Wrapper> Sync for Lexer<'input, Iter, Token, State, Error, Wrapper>
impl<'input, Iter, Token, State, Error, Wrapper> Unpin for Lexer<'input, Iter, Token, State, Error, Wrapper>
impl<'input, Iter, Token, State, Error, Wrapper> UnwindSafe for Lexer<'input, Iter, Token, State, Error, Wrapper>where
State: UnwindSafe,
Iter: UnwindSafe,
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