Related articles |
---|
Error reporting/recovery bourguet@my-deja.com (Jean-Marc Bourguet) (2000-04-05) |
Re: Error reporting/recovery iank@bearcave.com (2000-04-11) |
Re: Error reporting/recovery grosch@cocolab.de (2000-04-11) |
Re: Error reporting/recovery bourguet@my-deja.com (Jean-Marc Bourguet) (2000-04-14) |
Re: Error reporting/recovery bourguet@my-deja.com (Jean-Marc Bourguet) (2000-04-14) |
Re: Error reporting/recovery rod.bates@wichita.boeing.com (Rodney M. Bates) (2000-04-14) |
Re: Error reporting/recovery nr@labrador.eecs.harvard.edu (2000-04-16) |
Re: Error reporting/recovery j.coulmance@itecor-software.com (Jocelyn Coulmance) (2000-04-20) |
Re: Error reporting/recovery pnyq@my-deja.com (2000-05-08) |
From: | grosch@cocolab.de (Josef Grosch) |
Newsgroups: | comp.compilers |
Date: | 11 Apr 2000 14:31:11 -0400 |
Organization: | Compilers Central |
References: | 00-04-053 |
Keywords: | parse, errors, tools |
Jean-Marc Bourguet <bourguet@my-deja.com> asked about error
reporting/recovery provided by parser generators:
> - if there was other parser generators freely available
> who did a better jobs,
The parser generators Lark (LALR(2)) and Ell (LL(1)) of the Cocktail
Toolbox provide automatic error reporting, recovery and repair.
There is no need to add extra grammar rules using an error token.
Everything is generated automatically. Example:
if (a = b] write (a);
The above source line would result in the following message:
3, 13: Error found/expected : ]/) = + - <> <= >= < > IN OR ...
The location of the error is reported (line 3, column 13).
The message is classified as Error. It is a syntax error indicated
by "found/expected". The token ] is causing the syntax error.
The tokens after the slash are the set of expected tokens.
This set is truncated which is indicated by the three dots.
Error recovery also happens automatically. A minimal sequence of
tokens is skipped so that parsing can safely continue. Moreover
a minimal sequence of tokens is inserted (virtually) in order to repair
the error. This has the advantage that the output of the parser is
always consistent in the sense that it belongs to a syntactically correct
input. Therefore phases following after parsing do not have to take
care about syntax errors.
References:
1. J. Grosch, `Efficient and Comfortable Error Recovery in Recursive
Descent Parsers', Structured Programming, 11, 129-140 (1990).
2. http://www.cocolab.de - look for ell.ps oder ell.pdf
Older versions of Cocktail are available for free on the Internet.
Newer versions are commercial products.
Dr. Josef Grosch
CoCoLab - Datenverarbeitung
Turenneweg 11
77880 Sasbach
Germany
Phone: +49-7841-669144
Fax : +49-7841-669145
Mail : grosch@cocolab.de
Web : www.cocolab.de
Return to the
comp.compilers page.
Search the
comp.compilers archives again.