[−][src]Enum antlr_rust::errors::ANTLRError
Main ANTLR4 Rust runtime error
Variants
Returned from Lexer when it fails to find matching token type for current input
Usually Lexers contain last 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
Index at which error has happened
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. Or user provided type returned data that is incompatible with current parser state
Unrecoverable error. Indicates that error should not be processed by parser/error strategy and it should abort parsing and immediately return to caller.
Potentially recoverable error.
Used to allow user to emit his own errors from parser actions or from custom error strategy.
Parser will try to recover with provided ErrorStrategy
Implementations
impl ANTLRError
[src]
pub fn get_offending_token(&self) -> Option<&OwningToken>
[src]
Returns first token that caused parser to fail.
Trait Implementations
impl Clone for ANTLRError
[src]
pub fn clone(&self) -> ANTLRError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ANTLRError
[src]
impl Display for ANTLRError
[src]
impl Error for ANTLRError
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ANTLRError
[src]
impl !Send for ANTLRError
[src]
impl !Sync for ANTLRError
[src]
impl Unpin for ANTLRError
[src]
impl !UnwindSafe for ANTLRError
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> NodeText for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,