[Top][All Lists]
[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:35:27 -0700 |
As further evidence that perhaps something odd is going on, here is an
example where there is a parse error; it is recovered from; but
Bison never uses the error production!
prog: 'x' 'y' 'z' ';' { printf (" x y z ;\n"); }
| r error ';' { printf (" *err*\n"); }
| r 'x' ';' { printf (" x x ;\n"); }
| q ';'
| q '.'
;
q : 'x'
;
r : 'x'
;
With the input
x y x ;
we get the output
Error: parse error
x x ;
indicating that 'error' was never shifted.
Why? Well, when we pop the stack back to the first 'x' and take the
reduction r : 'x' (which is indicated when the lookahead token is
error), the algorithm I sent in the last message has us "proceeding
normally", meaning that we use the current lookahead symbol ('x').
Paul Hilfinger
- Re: Reductions during Bison error handling, (continued)
- Re: Reductions during Bison error handling, Hans Aberg, 2002/05/13
- Re: Reductions during Bison error handling, Paul Hilfinger, 2002/05/13
- Re: Reductions during Bison error handling, Hans Aberg, 2002/05/14
- Re: Reductions during Bison error handling, Paul Hilfinger, 2002/05/14
- Re: Reductions during Bison error handling, Hans Aberg, 2002/05/14
- Re: Reductions during Bison error handling, Paul Hilfinger, 2002/05/14
- Re: Reductions during Bison error handling, Hans Aberg, 2002/05/15
- Re: Reductions during Bison error handling, Akim Demaille, 2002/05/20
- Re: Reductions during Bison error handling, Paul Hilfinger, 2002/05/21
- Re: Reductions during Bison error handling, Akim Demaille, 2002/05/20
Re: Reductions during Bison error handling,
Paul Hilfinger <=
Re: Reductions during Bison error handling, Paul Hilfinger, 2002/05/10
Re: Reductions during Bison error handling, Akim Demaille, 2002/05/20