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
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;
fn current_line(&self) -> &str
fn current_line(&self) -> &str
returns the current line being tokenized. The default implementation returns the empty string.