[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Erroneous YYBACKUP skeleton
From: |
David Kastrup |
Subject: |
Re: Erroneous YYBACKUP skeleton |
Date: |
Tue, 11 Oct 2011 22:43:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> David Kastrup <address@hidden> writes:
>
>> "Joel E. Denny" <address@hidden> writes:
>
> [...]
>
>>>> I have not checked that the enhancement for reducing rules with more
>>>> than one token does actually work. It seems like an obvious change,
>>>> but I don't really understand Bison enough to be sure.
>>>
>>> Does this mean you haven't found need for that enhancement then?
>>
>> Up to now, I have been just doing basic tests and trying to figure out
>> why I could not get stuff to work at all. It seems one should always
>> be able to program around the missing enhancement by creating
>> one-element rule aliases to all multi-element rules one wants to back
>> up.
>
> Update: no, that does not work, since backing up only moves backwards
> one reduction, so putting an alias in between will not help. It would
> seem, however, that YYPOPSTACK (yylen) is the wrong thing to do: when
> the action is executed, apparently the stack has already been reduced to
> have one lefthand value left. So YYPOPSTACK (1) seems correct
> regardless of the value of yylen (possibly excepting yylen==0 though I
> don't think this can ever occur).
Update: I take the update back. My code was flawed, crashing due to a
different reason. Indeed YYPOPSTACK (yylen) is the right thing to do
and actually works.
--
David Kastrup