Re: Error reporting/recovery

Jean-Marc Bourguet <>
14 Apr 2000 01:03:11 -0400

          From comp.compilers

Related articles
Error reporting/recovery (Jean-Marc Bourguet) (2000-04-05)
Re: Error reporting/recovery (2000-04-11)
Re: Error reporting/recovery (2000-04-11)
Re: Error reporting/recovery (Jean-Marc Bourguet) (2000-04-14)
Re: Error reporting/recovery (Jean-Marc Bourguet) (2000-04-14)
Re: Error reporting/recovery (Rodney M. Bates) (2000-04-14)
Re: Error reporting/recovery (2000-04-16)
Re: Error reporting/recovery (Jocelyn Coulmance) (2000-04-20)
Re: Error reporting/recovery (2000-05-08)
| List of all articles for this month |

From: Jean-Marc Bourguet <>
Newsgroups: comp.compilers
Date: 14 Apr 2000 01:03:11 -0400
Organization: - Before you buy.
References: 00-04-053 00-04-070
Keywords: parse, errors (Ian Kaplan) wrote:
> Jean-Marc Bourguet <> wrote:
> > The parser generators I know of (I've looked at yacc variants and
> > pccts) are bad at error reporting/recovery at least when not helped
> > by suitable addition in the grammar description. I know that the
> > field has been studied and I'm quite sure that yacc is not at the
> > state of the art in this matter, so I wondered:
> > - if there was other parser generators freely available
> > who did a better jobs,
> > - if there was an available benchmark (grammars and
> > input) to test the error reporting/recovery of parser
> > generators.
> I use ANTLR, which has excellent error reporting "right out of the box".

Is the ANTLR error reporting different from the one of PCCTS? As far
as I known, the out of the box error reporting of PCCTS is just the
list of valid tokens (with help, it may summarize some sets of token
by a name like "relationnal operator"). That is not something I'd
call excellent but just minimal.

I fear that providing what I'd call excellent error messages you need
to take semantic into account and use heuristic. (The difference
between very good and excellent error messages is tiny, reporting a
missing end token using the same case as the user do ie. report using
'END' 'End' or 'end' would make a very good error message an excellent

> ANTLR generates a recursive decent parser, which tends to have
> beeter error reporting.

It is easier to do a simple error reporting for a recursive decent
parser (and then for an LL grammar I'm not sure is it really simpler),
but I remember having read something on a parser generator which gave
meaningfull error messages in the case of unclosed recursive structure
(like begin/end block, parenthized expressions). For this kind of
processing, I wonder if the LR states may provide better hints on what
is expected.

-- Jean-Marc Bourguet

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.