pub trait Lexer<LexemeT: Lexeme<StorageT>, StorageT: Hash + PrimInt + Unsigned> {
    fn iter<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = Result<LexemeT, LexError>> + 'a>; }
Expand description

The base trait which all lexers which want to interact with lrpar must implement.

Required Methods

Iterate over all the lexemes in this lexer. Note that:

  • The lexer may or may not stop after the first LexError is encountered.
  • There are no guarantees about what happens if this function is called more than once. For example, a streaming lexer may only produce Lexemes on the first call.

Implementors