[][src]Trait lrpar::Lexer

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

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

Required methods

pub fn iter<'a>(
    &'a self
) -> Box<dyn Iterator<Item = Result<Lexeme<StorageT>, LexError>> + 'a>
[src]

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.
Loading content...

Implementors

Loading content...