[Top][All Lists]

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

Re: FYI: Fix the computation of YYFINAL

From: Akim Demaille
Subject: Re: FYI: Fix the computation of YYFINAL
Date: Thu, 03 Nov 2005 17:28:50 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

>>> "Alexandre" == Alexandre Duret-Lutz <address@hidden> writes:

 > On Thu, Nov 03, 2005 at 04:22:59PM +0100, Akim Demaille wrote:
 >> At least one issue is addressed here.

 > Thanks!  I guess this means I can now rewrite my parser without using
 > YYACCEPT, which in turn means bison won't destruct the symbols I need on
 > the stack?

Right.  But in some future, YYACCEPT will also stop killing your
results, so you might just want to wait.

 >> --- tests/ 24 Jul 2005 07:24:22 -0000 1.19
 >> +++ tests/ 3 Nov 2005 15:20:53 -0000
 > [...]
 >> +# grammar, which is a very suspicious accidental feature introduce
 >> +# as a side effect of allowing the user to name $end using

 > introduced


For the records, one might wander why we don't simply reduce rule 0 to
conclude the parsing, instead of special casing the arrival to the
"final state".  The reason is that the compression of the various
tables use n < 0 to encode "reduce -n", and n == 0 to encode the
"default action".  So rule 0 cannot be coded (easily) in the tables.

Maybe we should peek deeper to check whether there is really no gain
is stopping this special case.  We could, for instance, code rule 0 as
rule N + 1.  I suspect this would yield a more natural parser code.

reply via email to

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