bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reductions during Bison error handling


From: Paul Hilfinger
Subject: Re: Reductions during Bison error handling
Date: Fri, 10 May 2002 20:58:27 -0700

Ah! Now I see what problem the yyerrdefault code-suppression was
trying to fix.  So now I can amend my comment to say that I think a 
different fix might be indicated.  

Here's the issue.  If our erroneous configuration is

    Parse Stack:  s1  s2 ... sk ... sn  <-top   Lookahead: X

we pop back to sk, and if the indicated action is "reduce", we take
the reduction and proceed normally.  Now, if that reduction is a
non-defaulted reduction (again, I don't mean default ACTION, but
default reduction, mediated by yydefact), we are guaranteed that X can
eventually be shifted.  If, however, the default reduction was used
because X is an erroneous symbol in state sk, then we will eventually
return to the error-recovery code, throw away X *and then continue to
pop the stack*, turning mere "panic-mode" into "full-fledged
rout-mode".  

Again, however, the anomalies reported earlier still exist.  We might
therefore consider actually using the documented error recovery
procedure.  Or we might consider a different technique for throwing
away input.

Paul Hilfinger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]