Bob Rossi <[EMAIL PROTECTED]> 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