[Top][All Lists]

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

Re: push parser

From: Bob Rossi
Subject: Re: push parser
Date: Wed, 11 Oct 2006 21:22:22 -0400
User-agent: Mutt/1.5.11

On Wed, Oct 11, 2006 at 04:33:27PM -0700, Paul Eggert wrote:
> Bob Rossi <address@hidden> writes:
> > Did you have any other complaints regarding the 
> > differences between the push and yacc parser?
> What I just noticed is that there's still too much duplication
> in the push parser.  For example, there are two lines that
> say this:
>     yytype_int16 yyssa[YYINITDEPTH];
> and there should be only one.  Similarly for a good chunk
> of the parser variables.

Well, in the case of the pull parser, the yyssa[YYINITDEPTH] is declared
on the stack. In the case of the push parser, it's declared in the
struct yypvars. It's also declared on the stack in this case, but never

What would you suggest I do?

> > +m4_define([b4_yyssa],b4_push_if([pv->yyssa],[yyssa]))
> > +m4_define([b4_yyerror_range],b4_push_if([pv->yyerror_range],[yyerror_range]))
> I'd rather not use M4 macros if the problem can be solved easily at
> the C level.  Can't we just do this at the start of the yypushparse
> function instead?
>     yytype_int16 *yyssa = pv->yyssa;
>     YYLTYPE *yyerror_range = pv->yyerror_range;
> That way, the rest of the code can just say 'yyssa' and 'yyerror_range'
> rather than ']b4_yyssa[' etc.

I think we are going in circles a little bit. Are you suggesting I
create a new pointer variable on the stack, and assign it pv->yyssa in
push mode, and yyssa in pull mode? That's what I originally had. I must
be missing something here.

Also, it would be helpful to me if you could apply the larger patch I
ping'd about to push.c. Even if it's not completly good, we can trim it
down as we do the final review of push vs pull. I think it's mostly a
good patch.

Thanks for the help,
Bob Rossi

reply via email to

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