Skip to main content

Parser

Trait Parser 

Source
pub trait Parser: Recognizer {
    // Required methods
    fn build_parse_trees(&self) -> bool;
    fn set_build_parse_trees(&mut self, build: bool);

    // Provided methods
    fn report_diagnostic_errors(&self) -> bool { ... }
    fn set_report_diagnostic_errors(&mut self, _report: bool) { ... }
    fn prediction_mode(&self) -> PredictionMode { ... }
    fn set_prediction_mode(&mut self, _mode: PredictionMode) { ... }
}

Required Methods§

Source

fn build_parse_trees(&self) -> bool

Reports whether generated parser rules should build parse-tree nodes while recognizing input.

Source

fn set_build_parse_trees(&mut self, build: bool)

Enables or disables parse-tree construction for subsequent rule calls.

Provided Methods§

Source

fn report_diagnostic_errors(&self) -> bool

Reports whether prediction diagnostic-listener messages are emitted during parser ATN recognition.

Source

fn set_report_diagnostic_errors(&mut self, _report: bool)

Enables or disables ANTLR-style prediction diagnostics for subsequent rule calls.

Source

fn prediction_mode(&self) -> PredictionMode

Reports the prediction strategy used when selecting among alternatives.

Source

fn set_prediction_mode(&mut self, _mode: PredictionMode)

Sets the prediction strategy for subsequent rule calls.

Implementors§

Source§

impl<S> Parser for BaseParser<S>
where S: TokenSource,