bison-patches
[Top][All Lists]
Advanced

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

Re: push parser


From: Joel E. Denny
Subject: Re: push parser
Date: Wed, 13 Dec 2006 21:59:28 -0500 (EST)

On Wed, 13 Dec 2006, Bob Rossi wrote:

> On Wed, Dec 13, 2006 at 02:53:33PM -0500, Joel E. Denny wrote:
> > On Wed, 13 Dec 2006, Bob Rossi wrote:
> > 
> > > On Tue, Dec 12, 2006 at 05:11:39PM -0500, Joel E. Denny wrote:
> > 
> > > > How about replacing yypstate_init with yypstate_new and 
> > > > yypstate_delete?  
> > > > Sorry, I forgot about this during the previous renaming, but this will 
> > > > probably be a nice self-contained patch anyway.  Also, did you look 
> > > > into 
> > > > using b4_c_function_def for these definitions?  If you agree with these 
> > > > ideas, you could proceed with them while we wait for Paul's response to 
> > > > the above.
> > > 
> > > OK, do you want me to simply rename yypstateinit to yypstate_new and
> > > then add yypstate_delete to just do a free of the data allocated?
> > 
> > Yes, if that's agreeable to you.  (And don't forget b4_c_function_def.)
> > 
> > Also, Paul has responded about your previous patch, so you could revise 
> > that.
> 
> How does this look?

Thanks.  I committed that with a few formatting tweaks.

> 2006-12-13  Bob Rossi  <address@hidden>
> 
>         * data/push.c (yypstate_init #define): Deleted.
>         (yypsate_new, yypstate_delete #define): Added.
>         (yypstate_init function_decl): Deleted.
>         (yypsate_new, yypstate_delete function_decl): Added.
>         (yypush_parse): Changed parameters yynval and yynlloc to be const.
>         * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new
>         yypstate_delete functions.

This is a little unusual (relative to the rest of the ChangeLog).  I 
re-wrote it as:

2006-12-13  Bob Rossi  <address@hidden>

        * data/push.c (yypstate_init): Rename to...
        (yypstate_new): ... this and use b4_c_function_def.
        (yypstate_delete): New.
        (yypush_parse): Change parameters yynval and yynlloc to be const.
        * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
        yypstate_delete functions.

Here are some more unresolved issues:

1. Remove the yyparse prototype when %push-parser is specified.

2. There's something wrong with the m4 in the header file.  You don't 
generate the push parser declarations unless locations are turned on.

3. Similar to YYSTYPE and YYLTYPE, consider adding the following to both 
the header and code file:

  typedef struct yypstate yypstate;

Then abbreviate `struct yypstate' to just `yypstate' in the rest of the 
code.




reply via email to

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