[][src]Enum antlr_rust::errors::ANTLRError

pub enum ANTLRError {
    LexerNoAltError {
        start_index: isize,
    },
    NoAltError(NoViableAltError),
    InputMismatchError(InputMisMatchError),
    PredicateError(FailedPredicateError),
    IllegalStateError(String),
    FallThrough(Box<dyn Error>),
    OtherError(Box<dyn Error>),
}

Main ANTLR4 Rust runtime error

Variants

LexerNoAltError

Returned from Lexer when it fails to find matching token type for current input

Usually Lexers contain rule that captures all invalid tokens like:

ERROR_TOKEN: . ;

to prevent lexer from throwing errors and have all error handling in parser.

Fields of LexerNoAltError

start_index: isize
NoAltError(NoViableAltError)

Indicates that the parser could not decide which of two or more paths to take based upon the remaining input. It tracks the starting token of the offending input and also knows where the parser was in the various paths when the error. Reported by reportNoViableAlternative()

InputMismatchError(InputMisMatchError)

This signifies any kind of mismatched input exceptions such as when the current input does not match the expected token.

PredicateError(FailedPredicateError)

A semantic predicate failed during validation. Validation of predicates occurs when normally parsing the alternative just like matching a token. Disambiguating predicate evaluation occurs when we test a predicate during prediction.

IllegalStateError(String)

Internal error.

FallThrough(Box<dyn Error>)

Indicates that error should not be processed and parser should immediately return to caller

OtherError(Box<dyn Error>)

Used to allow user to emit his own errors from parser actions or from custom error strategy

Trait Implementations

impl Clone for ANTLRError[src]

impl Debug for ANTLRError[src]

impl Display for ANTLRError[src]

impl Error for ANTLRError[src]

impl RecognitionError for ANTLRError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.