Don't Panic! Better, Fewer, Syntax Errors for LR Parsers
Not on the map. Why?
Abstract (arXiv)
Syntax errors are generally easy to fix for humans, but not for parsers in general nor LR parsers in particular. Traditional 'panic mode' error recovery, though easy to implement and applicable to any grammar, often leads to a cascading chain of errors that drown out the original. More advanced error recovery techniques suffer less from this problem but have seen little practical use because their typical performance was seen as poor, their worst case unbounded, and the repairs they reported arbitrary. In this paper we introduce the CPCT+ algorithm, and an implementation of that algorithm, that address these issues. First, CPCT+ reports the complete set of minimum cost repair sequences for a given location, allowing programmers to select the one that best fits their intention. Second, on a corpus of 200,000 real-world syntactically invalid Java programs, CPCT+ is able to repair 98.37% of files within a timeout of 0.5s. Finally, CPCT+ uses the complete set of minimum cost repair sequences to reduce the cascading error problem, where incorrect error recovery causes further spurious syntax errors to be identified. Across the test corpus, CPCT+ reports 435,812 error locations to the user, reducing the cascading error problem substantially relative to the 981,628 error locations reported by panic mode.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 19 Apr 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 2; 2023: 0; 2024: 1; 2025: 0; 2026: 1.
4 papers.
- 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMscited by 68
- 2024Evaluating Mathematical Reasoning of Large Language Models: A Focus on Error Identification and Correctioncited by 45
- 2022Neurosymbolic Repair for Low-Code Formula Languagescited by 12
- 2026Position: Quantum Program Generation Must Prioritize Validity Over Probabilistic Scalingcited by 0
- 2026Position: Quantum Program Generation Must Prioritize Validity Over Probabilistic Scaling15 Jul 2026
- 2024Evaluating Mathematical Reasoning of Large Language Models: A Focus on Error Identification and Correction2 Jun 2024
- 2022Repair Is Nearly Generation: Multilingual Program Repair with LLMs24 Aug 2022
- 2022Neurosymbolic Repair for Low-Code Formula Languages24 Jul 2022