Let's stop parser Hell
Philippe Sigaud
philippe.sigaud at gmail.com
Tue Jul 10 12:14:01 PDT 2012
Tue, Jul 10, 2012 at 12:41 PM, Roman D. Boiko <rb at d-coding.com> wrote:
> One disadvantage of Packrat parsers I mentioned was problematic error
> recovery (according to the article from ANTLR website). After some
> additional research, I found that it is not a critical problem. To find the
> exact place of error (from parser's perspective, not user's) one only needs
> to remember the farthest successfully parsed position (among several
> backtracking attempts) and the reason that it failed.
IIRC, that's what I encoded in Pegged (admittedly limited) error
reporting: remember the farthest error.
> It is also possible to rerun parsing with some additional heuristics after
> failing, thus enabling advanced error repair scenarios.
Do people really what error-repairing parsers? I want my parsers to
tell me something is bad, and, optionally to advance a possible
repair, but definitely *not* to automatically repair a inferred error
and continue happily.
More information about the Digitalmars-d
mailing list