|Re: Recursive-descent C parser WANTED firstname.lastname@example.org (1992-02-27)|
|Re: Recursive-descent C parser WANTED email@example.com (1992-02-27)|
|Re: Recursive-descent C parser WANTED firstname.lastname@example.org (1992-02-27)|
|Re: Recursive-descent C parser WANTED email@example.com (1992-03-04)|
|From:||firstname.lastname@example.org (Henry Spencer)|
|Organization:||U of Toronto Zoology|
|Date:||Thu, 27 Feb 1992 22:57:40 GMT|
In article 92-02-126 email@example.com (Doug Merritt) writes:
>The added bonus to parser generators is that it is possible to add
>variations on automated Graham-Rhodes error recovery to them...
Despite popular misconceptions, there is no great difficulty in adding
automated error recovery to recursive-descent parsers. If the parser
tells the scanner what sorts of tokens it's looking for, rather than
just saying "give me the next token", a fairly effective error-recovery
strategy can be implemented as a layer in between scanner and parser.
I did this in an experimental C parser.
(The basic strategy is to give the parser what it wants, and if that
wasn't what showed up in the input stream, complain. Some simple
heuristics work fairly well for resynchronization and avoiding infinite
loops. The code is simple and the cost is minimal.)
| Henry Spencer @ U of Toronto Zoology, firstname.lastname@example.org utzoo!henry
Return to the
Search the comp.compilers archives again.