Module rustlr::runtime_parser

source ·
Expand description

This module is deprecated by the crate::zc_parser module and is only kept for compatibility with existing parsers.

This module implements the parsing routines that uses the state machine generated by rustlr. The main structure here is RuntimeParser. All parsing functions are organized around the RuntimeParser::parse_base function, which implements the basic LR parsing algorithm. This function expects dynamic Lexer and ErrHandler trait-objects. This module provides generic parsing and parser-training routines that use stdio for interface, but the ErrHandler trait allows custom user interfaces to be build separately.

Structs

Traits

  • 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.