Struct lexgen_util::Lexer
source · [−]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
sourceimpl<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
sourceimpl<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
sourceimpl<'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
sourceimpl<'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
Auto Trait Implementations
impl<'input, Iter, Token, State, Error, Wrapper> RefUnwindSafe for Lexer<'input, Iter, Token, State, Error, Wrapper> where
Iter: RefUnwindSafe,
State: RefUnwindSafe,
impl<'input, Iter, Token, State, Error, Wrapper> Send for Lexer<'input, Iter, Token, State, Error, Wrapper> where
Iter: Send,
State: Send,
impl<'input, Iter, Token, State, Error, Wrapper> Sync for Lexer<'input, Iter, Token, State, Error, Wrapper> where
Iter: Sync,
State: Sync,
impl<'input, Iter, Token, State, Error, Wrapper> Unpin for Lexer<'input, Iter, Token, State, Error, Wrapper> where
Iter: Unpin,
State: Unpin,
impl<'input, Iter, Token, State, Error, Wrapper> UnwindSafe for Lexer<'input, Iter, Token, State, Error, Wrapper> where
Iter: UnwindSafe,
State: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more