Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ANTLR implements good error recovery mechanisms by default within the runtimes of all target languages but in some cases the way a grammar is structuretd structured impairs the ability of the algorithms to cover recover to exactly where you might expect or wish. Sometimes your grammar rules cause a loop in a parsing rule to be exited earlier than you would expect or want; sometimes when a certain construct is in error you want to skip everything up to the end of that construct instead of resuming at wherever ANTLR sees a token that looks like it is a valid recovery point. There are many reasons you may wish to influence or override the standard recovery behavior. Before However, before we can examine how to implement your own recovery, we need to know something about how ANTLR recovers from mismatch problems.

...