Better error recovery



On Thu, 10 Aug 2006, Karsten Nyblad wrote:

"[..]

At last, I would avoid parser generators that use the error recovery of
yacc. That error recovery was fine in the early seventies where parser
generators and parsers had to be squeezed down in 16 bit computers, but
it has been outdated for at least 20 years. Today you should expect an
error recovery to be better at guessing the intentions of the programmer
and/or be easier to work with for the compiler writer. I would suggest
that you go hunting for at parser generator with a better error
recovery. Modern parser generators may also have a more powerful
language for describing the language accepted by the generated parser.
These advantages could end up saving you money even if you have to buy
the parser generator."

It is the responsibility of the programmer to provide the compiler
with the intended input. Hand-coded second-guessing of mistakes can
provide much more helpful error messages, but may be issued in
response to more types of mistakes than those they provide helpful
suggestions for.

.



Relevant Pages

  • Re: What does the future of computing hold?
    ... The bulk of parser generators that I'm ... grammar is LR, or whatever, to the programmer. ... Context free languages can be parsed using a GLR parser. ...
    (comp.programming)
  • Re: Why LL(1) Parsers do not support left recursion?
    ... Do there exist LR parsers or parser generators at all, ... preserve the relationship between the parser code and the grammar? ... and its target language --- something that makes it parse C and not ...
    (comp.compilers)
  • Re: ANTLR Target for Ruby
    ... I've benchmarked a bunch ... parser generators out there using JSON and would always like to add ... Have you tried the JSON parser one built in to 1.9? ...
    (comp.lang.ruby)
  • Re: SciLexer.dll 1.68
    ... various existing indicator styles, but they were all a bit too heavy ... If anyone has any other suggestions for replacing the red squiggle ... reasons John Brant did Smacc was to provide a Smalltalk parser with enhanced ... error recovery over the RB parser, ...
    (comp.lang.smalltalk.dolphin)
  • Re: Trouble in Error Recovery
    ... > I'm having trouble in writing error recovery routines. ... Bison has a built in error recovery feature. ... parser stack, until it sees an error recover state, and then perform ... If this character does not fit into the .y grammar via ...
    (comp.compilers)