[−][src]Trait antlr_rust::ErrorStrategy
The interface for defining strategies to deal with syntax errors encountered during a parse by ANTLR-generated parsers. We distinguish between three different kinds of errors:
- The parser could not figure out which path to take in the ATN (none of the available alternatives could possibly match)
- The current input does not match what we were looking for
- A predicate evaluated to false
Implementations of this interface report syntax errors by calling Parser.notifyErrorListeners
Required methods
fn reset(&mut self, recognizer: &mut T)
fn recover_inline(
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
fn recover(
&mut self,
recognizer: &mut T,
e: &ANTLRError
) -> Result<(), ANTLRError>
&mut self,
recognizer: &mut T,
e: &ANTLRError
) -> Result<(), ANTLRError>
fn sync(&mut self, recognizer: &mut T) -> Result<(), ANTLRError>
fn in_error_recovery_mode(&mut self, recognizer: &mut T) -> bool
fn report_error(&mut self, recognizer: &mut T, e: &ANTLRError)
fn report_match(&mut self, recognizer: &mut T)
Implementations on Foreign Types
impl<'a, T: Parser<'a> + TidAble<'a>> ErrorStrategy<'a, T> for Box<dyn ErrorStrategy<'a, T> + 'a>
[src]
fn reset(&mut self, recognizer: &mut T)
[src]
fn recover_inline(
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
[src]
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
fn recover(
&mut self,
recognizer: &mut T,
e: &ANTLRError
) -> Result<(), ANTLRError>
[src]
&mut self,
recognizer: &mut T,
e: &ANTLRError
) -> Result<(), ANTLRError>
fn sync(&mut self, recognizer: &mut T) -> Result<(), ANTLRError>
[src]
fn in_error_recovery_mode(&mut self, recognizer: &mut T) -> bool
[src]
fn report_error(&mut self, recognizer: &mut T, e: &ANTLRError)
[src]
fn report_match(&mut self, recognizer: &mut T)
[src]
Implementors
impl<'a, T: Parser<'a>> ErrorStrategy<'a, T> for BailErrorStrategy<'a, T::Node>
[src]
fn reset(&mut self, recognizer: &mut T)
[src]
fn recover_inline(
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
[src]
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
fn recover(
&mut self,
recognizer: &mut T,
e: &ANTLRError
) -> Result<(), ANTLRError>
[src]
&mut self,
recognizer: &mut T,
e: &ANTLRError
) -> Result<(), ANTLRError>
fn sync(&mut self, _recognizer: &mut T) -> Result<(), ANTLRError>
[src]
fn in_error_recovery_mode(&mut self, recognizer: &mut T) -> bool
[src]
fn report_error(&mut self, recognizer: &mut T, e: &ANTLRError)
[src]
fn report_match(&mut self, recognizer: &mut T)
[src]
impl<'a, T: Parser<'a>> ErrorStrategy<'a, T> for DefaultErrorStrategy<'a, T::Node>
[src]
fn reset(&mut self, _recognizer: &mut T)
[src]
fn recover_inline(
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
[src]
&mut self,
recognizer: &mut T
) -> Result<<T::TF as TokenFactory<'a>>::Tok, ANTLRError>
fn recover(
&mut self,
recognizer: &mut T,
_e: &ANTLRError
) -> Result<(), ANTLRError>
[src]
&mut self,
recognizer: &mut T,
_e: &ANTLRError
) -> Result<(), ANTLRError>