Struct antlr_rust::error_strategy::DefaultErrorStrategy[][src]

pub struct DefaultErrorStrategy<'input, Ctx: ParserNodeType<'input>> { /* fields omitted */ }
Expand description

This is the default implementation of ErrorStrategy used for error reporting and recovery in ANTLR parsers.

Implementations

Creates new instance of DefaultErrorStrategy

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Reset the error handler state for the specified recognizer.

This method is called when an unexpected symbol is encountered during an inline match operation, such as Parser::match. If the error strategy successfully recovers from the match failure, this method returns the Token instance which should be treated as the successful result of the match. Read more

This method is called to recover from error e. This method is called after ErrorStrategy::reportError by the default error handler generated for a rule method. Read more

This method provides the error handler with an opportunity to handle syntactic or semantic errors in the input stream before they result in a error. Read more

Tests whether or not {@code recognizer} is in the process of recovering from an error. In error recovery mode, Parser::consume will create ErrorNode leaf instead of TerminalNode one Read more

Report any kind of ANTLRError. This method is called by the default exception handler generated for a rule method. Read more

This method is called when the parser successfully matches an input symbol. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Returns text representation of current node type, rule name for context nodes and token text for terminal nodes Read more

Returns type id of the type of self Read more

Returns type id of this type

Returns true if type behind self is equal to the type of T.

Attempts to downcast self to T behind reference

Attempts to downcast self to T behind mutable reference

Attempts to downcast self to T behind Rc pointer

Attempts to downcast self to T behind Arc pointer

Attempts to downcast self to T behind Box pointer

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.