按年被提到
20182019 · 2 次2026
软件工程与 AI 编程›代码生成与程序合成·arXiv:1804.07133 · cs.PL

Don't Panic! Better, Fewer, Syntax Errors for LR Parsers

Lukas Diekmann, Laurence Tratt · 2018
开始阅读 ↗PDFalphaXiv 讨论
被提及 · 2 人首次 2018-11-08 · 最近 2020-07-15
2不同的人
4活跃月份
4讨论串
13被引(OpenAlex)
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.

候选层:至少 2 个不同的人、在 2 个不同月份提到过,还没到主书架的 3 人 3 个月。没有做立场标注,所以只写“被提及”。

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
评论ltratt · 2018-11

“> The problem with yacc/bison-style LALR parser generators is that you end up with an LALR parser. Which works great on syntactically correct code, but trying to get a reasonable error message out of one is about as much fun as repeatedly poking yourself in the eye with a sharp stick. The standard ways of getting error messages from LR parsers are pretty…”

Owl: Parser generator for visibly pushdown languages原评论 ↗
评论ltratt · 2019-03

“> They correctly point out that error handling is by far the biggest one, and usually ends up being the biggest part of a parser for a language, full of crufts and strange mixtures of semantics and syntax. Add to this that you frequently want to try to partially recover -- make a guess as to what was intended and continue parsing in the hopes of finding m…”

Dreaming of a Parser Generator for Language Design原评论 ↗
评论ltratt · 2019-12

“I completely agree: the poor quality of error reporting in parsing tools is a significant reason not to use them. When I started looking into this a couple of years back, what surprised me is how much work there's been in this spread over decades. Building upon that (and obvious bias alert!) led us to come up with a couple of new algorithms. The current …”

Glush: A robust parser compiler built using non-deterministic automatons原评论 ↗
评论bollu · 2020-07

“Awesome. I love good research into parsing, since parsing is famously "the solved problem that isn't": https://tratt.net/laurie/blog/entries/parsing_the_solved_problem_that_isnt.html I hope to study this paper well (which is by the author of the above post) and understand what their algorithm is. I feel that good error messages make or break a language. …”

Don't Panic! Better, Fewer, Syntax Errors for LR Parsers原评论 ↗