Towards Automatic Error Recovery in Parsing Expression
S\'ergio Queiroz de Medeiros, Fabio Mascarenhas

TL;DR
This paper introduces an algorithm that automatically annotates Parsing Expression Grammars with error recovery labels and expressions, improving parser robustness in IDEs with minimal manual effort.
Contribution
It presents a novel algorithm for automatic annotation of PEGs with error recovery mechanisms, reducing manual effort in parser error handling.
Findings
Successfully added error recovery to Titan language parser
Minimal manual intervention needed for effective recovery
Most grammar alternatives are disjoint, aiding recovery process
Abstract
Error recovery is an essential feature for a parser that should be plugged in Integrated Development Environments (IDEs), which must build Abstract Syntax Trees (ASTs) even for syntactically invalid programs in order to offer features such as automated refactoring and code completion. Parsing Expressions Grammars (PEGs) are a formalism that naturally describes recursive top-down parsers using a restricted form of backtracking. Labeled failures are a conservative extension of PEGs that adds an error reporting mechanism for PEG parsers, and these labels can also be associated with recovery expressions to also be an error recovery mechanism. These expressions can use the full expressivity of PEGs to recover from syntactic errors. Manually annotating a large grammar with labels and recovery expressions can be difficult. In this work, we present an algorithm that automatically annotates…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
