[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: avoiding infinite loops
From: |
Joel E. Denny |
Subject: |
Re: avoiding infinite loops |
Date: |
Tue, 13 Jun 2006 18:32:11 -0400 (EDT) |
On Tue, 13 Jun 2006, David Russinoff wrote:
> It would appear that my Bison has a bug, not in the parser generator
> itself, but in the generation of the "output" file. The output above is
> more suggestive of the observed bahavior than the output that I get.
>
> The line
>
> > 3 a: p . [$end]
>
> is the interesting one. I suppose it's saying that the rule should not
> be reduced unless the lookahead token is $end.
It's saying that's the only lookahead for which this reduction makes
sense. However, that lookahead is in conflict with the shift, shifts are
preferred, and so the reduction is thrown away. Thus, the only
possibility for this state is a shift... and only on a lookahead of $end.
> I do not understand how Bison derives
> this information. Can anyone explain this aspect of the algorithm or
> tell me how I can learn about it?
The dragon book would be my suggestion.
Joel
Re: avoiding infinite loops, Hans Aberg, 2006/06/13
Re: avoiding infinite loops, Joel E. Denny, 2006/06/13