Trait rustlr::lexer_interface::Lexer[][src]

pub trait Lexer<AT: Default> {
    fn nextsym(&mut self) -> Option<Lextoken<AT>>;

    fn linenum(&self) -> usize { ... }
fn column(&self) -> usize { ... }
fn current_line(&self) -> &str { ... } }
Expand description

This trait defines the interace that any lexical analyzer must be adopted to. The default implementations for linenum, column and current_line should be replaced. They’re provided only for compatibility.

Required methods

retrieves the next Lextoken, or None at end-of-stream.

Provided methods

returns the current line number. The default implementation returns 0.

returns the current column (character position) on the current line. The default implementation returns 0;

returns the current line being tokenized. The default implementation returns the empty string.

Implementors