Trait rustlr::runtime_parser::ErrHandler
source · [−]pub trait ErrHandler<AT: Default, ET: Default> {
fn err_reporter(
&mut self,
parser: &mut RuntimeParser<AT, ET>,
lookahead: &Lextoken<AT>,
erropt: &Option<Stateaction>
);
fn report_err(&self, parser: &mut RuntimeParser<AT, ET>, msg: &str) { ... }
}
Expand description
A trait object that implements ErrHandler is expected by the RuntimeParser::parse_base function, which implements the basic LR parsing algorithm using the generated state machine. The struct StandardReporter is provided as the default ErrHandler that uses standard I/O as interface and has the ability to train the parser. But other implementations of the trait can be created that use different interfaces, such as a graphical IDE.