Automatic Error Recovery Strategy
Error recovery is what allows the parser to continue after finding a syntax error. In principle, the best error recovery would come from the human touch in a handwritten recursive-descent parser. In my experience, though, itâs really tough to get good error recovery by hand because itâs so tedious and easy to screw up. In this latest version of ANTLR, Iâve incorporated every bit of jujitsu Iâve learned and picked up over the years to provide good error recovery automatically for ANTLR grammars.
ANTLRâs error recovery mechanism is based upon Niklaus Wirthâs early ideas in Algorithms + Data Structures = Programs [Wir78] (as well as Rodney Toporâs A Note on Error Recovery in Recursive Descent Parsers ...
Get The Definitive ANTLR 4 Reference, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.