bison-patches
[Top][All Lists]
Advanced

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

Re: push parser


From: Paul Eggert
Subject: Re: push parser
Date: Tue, 10 Oct 2006 22:32:25 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Bob Rossi <address@hidden> writes:

> Are you suggesting I could take the 
> 'char yymsgbuf[128];' out of the 'struct yypvars' and simply use the
> one on the stack that appears each time yypushparse is called?

Yes, I think so.  But you know the code better than I.

> I avoided using pv->yyssa for a good reason! In short, using a local 
> variable instead of pv->yyssa really made the differences between 
> yacc.c and push.c managable. My original patch did something like:
>   ]b4_push_if([pv->yyssa],[yyssa])[
> for each occurence of each variable that would be used. This made
> the changes overwhemingly confusing. So, since I couldn't copy the
> array 'yytype_int16 yyssa[YYINITDEPTH];' to a variable on the stack,
> I simply created a new variable that I could simply copy.

Why not do this instead, for the push parser only?

    #define yyssa (pv->yyssa)

That way, you don't need to copy anything, and the rest of the
code can simply refer to 'yyssa'.

You could do this with all the state variables, I suppose, but
there may be some performance advantage to caching the scalars
as you do now.  But for arrays like yyssa and yyerror_range
I don't see why you can't just use the #define.




reply via email to

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