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: Wed, 11 Oct 2006 16:33:27 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Bob Rossi <address@hidden> writes:

> I hope doing this in small patches is easier, that's why I'm sending
> them in this way.

Yes, thanks.

> 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.

> +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.




reply via email to

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