pub struct DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena,
P: Parser<'input, 'arena, TF>,
'input: 'arena,{ /* private fields */ }Expand description
This is the default implementation of ErrorStrategy used for
error reporting and recovery in ANTLR parsers.
Implementations§
Source§impl<'input, 'arena, TF, P> DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena,
P: Parser<'input, 'arena, TF>,
'input: 'arena,
impl<'input, 'arena, TF, P> DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena,
P: Parser<'input, 'arena, TF>,
'input: 'arena,
Trait Implementations§
Source§impl<'input, 'arena, TF, P> Debug for DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena + Debug,
P: Parser<'input, 'arena, TF> + Debug,
P::Node: Debug,
'input: 'arena,
impl<'input, 'arena, TF, P> Debug for DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena + Debug,
P: Parser<'input, 'arena, TF> + Debug,
P::Node: Debug,
'input: 'arena,
Source§impl<'input, 'arena, TF, P> Default for DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena,
P: Parser<'input, 'arena, TF>,
'input: 'arena,
impl<'input, 'arena, TF, P> Default for DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena,
P: Parser<'input, 'arena, TF>,
'input: 'arena,
Source§impl<'input, 'arena, TF, P> ErrorStrategy<'input, 'arena, TF, P> for DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena,
P: Parser<'input, 'arena, TF>,
'input: 'arena,
impl<'input, 'arena, TF, P> ErrorStrategy<'input, 'arena, TF, P> for DefaultErrorStrategy<'input, 'arena, TF, P>where
TF: TokenFactory<'input, 'arena> + 'arena,
P: Parser<'input, 'arena, TF>,
'input: 'arena,
Source§fn reset(&mut self, recognizer: &mut P)
fn reset(&mut self, recognizer: &mut P)
Reset the error handler state for the specified
recognizer.Source§fn recover_inline(
&mut self,
recognizer: &mut P,
) -> Result<&'arena TF::Tok, ANTLRError>
fn recover_inline( &mut self, recognizer: &mut P, ) -> Result<&'arena TF::Tok, ANTLRError>
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 moreSource§fn recover(
&mut self,
recognizer: &mut P,
_e: &ANTLRError,
) -> Result<(), ANTLRError>
fn recover( &mut self, recognizer: &mut P, _e: &ANTLRError, ) -> Result<(), ANTLRError>
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.Source§fn sync(&mut self, recognizer: &mut P) -> Result<(), ANTLRError>
fn sync(&mut self, recognizer: &mut P) -> Result<(), ANTLRError>
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
Source§fn in_error_recovery_mode(&mut self, _recognizer: &mut P) -> bool
fn in_error_recovery_mode(&mut self, _recognizer: &mut P) -> bool
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 oneSource§fn report_error(&mut self, recognizer: &mut P, e: &ANTLRError)
fn report_error(&mut self, recognizer: &mut P, e: &ANTLRError)
Report any kind of
ANTLRError. This method is called by
the default exception handler generated for a rule method.Source§fn report_match(&mut self, recognizer: &mut P)
fn report_match(&mut self, recognizer: &mut P)
This method is called when the parser successfully matches an input
symbol.
Auto Trait Implementations§
impl<'input, 'arena, TF, P> Freeze for DefaultErrorStrategy<'input, 'arena, TF, P>
impl<'input, 'arena, TF, P> RefUnwindSafe for DefaultErrorStrategy<'input, 'arena, TF, P>
impl<'input, 'arena, TF, P> Send for DefaultErrorStrategy<'input, 'arena, TF, P>
impl<'input, 'arena, TF, P> Sync for DefaultErrorStrategy<'input, 'arena, TF, P>
impl<'input, 'arena, TF, P> Unpin for DefaultErrorStrategy<'input, 'arena, TF, P>
impl<'input, 'arena, TF, P> UnwindSafe for DefaultErrorStrategy<'input, 'arena, TF, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more