Reproduce “Syntax Error Recovery in Parsing Expression Grammars” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Sérgio Medeiros, Fabio Mascarenhas
Researchers from UFRN and UFRJ introduced a formal mechanism for syntax error recovery in Parsing Expression Grammars (PEGs), extending the formalism to integrate recovery expressions with labeled failures. This approach allows PEG parsers to construct partial Abstract Syntax Trees from syntactically incorrect code, achieving over 90% acceptable recovery quality on a Lua test suite and demonstrating a significant parsing speed advantage over ANTLR.
Key insights
- Integrating recovery expressions directly with labeled failures provides a unified and principled approach to both error reporting and repair within PEGs.
- The conservative extension maintains the inherent advantages of PEGs, such as linear-time parsing and unambiguous grammar specification, for valid inputs while adding robust error handling.
- Grammar-driven recovery, rather than fully automated strategies, allows for more precise and effective error handling, reducing spurious errors and minimizing information loss.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.