|Re: error recovery email@example.com (1989-04-30)|
|Error recovery firstname.lastname@example.org (Cayot Robert-Olivier) (1997-03-21)|
|Re: Error recovery email@example.com (Gord Cormack) (1997-03-22)|
|Re: Error recovery P.Whillance@ncl.ac.uk (Peter Whillance) (1997-03-27)|
|Error Recovery firstname.lastname@example.org (1997-05-12)|
|Re: Error Recovery email@example.com (1997-05-25)|
|Re: Error Recovery firstname.lastname@example.org (Thomas W. Christopher) (1997-05-25)|
|Re: Error Recovery email@example.com (Mark Gregory) (1997-05-27)|
|Re: Error Recovery firstname.lastname@example.org (Michael Roach) (1997-05-31)|
|From:||"Thomas W. Christopher" <email@example.com>|
|Date:||25 May 1997 13:46:03 -0400|
|Organization:||Illinois Institute of Technology|
> The one thing we rarely get around here are questions concerning
> error recovery while parsing. What systems exist already for error
> recovery, and what form do they take? What would be the ideal and how
> can we implement them? I have very few ideas in this area and would be
> happy for any suggestions.
In my LL(1) and LL(k) parsers, I use "panic mode" error recovery:
Upon detecting an unexpected token in the input, the parser throws
away input up to a "fiducial symbol" that is expected. A fiducial
symbol is a terminal symbol that ends or separates significant
sections of program, e.g. ";", "end", "else".
It then generates a replacement string of "error" tokens so that the
input is syntactically valid, albeit semantically meaningless. The
error tokens tell the semantics routines not to try processing the
input, but at least they get called with the correct number of operands,
so the compiler doesn't crash.
For a fuller description, see Chapter 6 of
or zipped Postcsript: http://www.iit.edu/~tc/tcll1ps.zip
For a copy of the LL(1) system: http://www.iit.edu/~tc/tcll1.zip
The system is written in and for the Icon programming language;
(Translations into other languages are under construction).
And for the preliminary versions of my LL(k) parser generator:
or through http://www.iit.edu/~tc/toolsfor
-Thomas W. Christopher http://www.iit.edu/~tc
Return to the
Search the comp.compilers archives again.