On Sun, 3 Sep 2006, Akim Demaille wrote:

> 
> >  2006-07-29  Joel E. Denny  <[EMAIL PROTECTED]>
> > 
> > +   Enable declaration of default %printer/%destructor.  Make the parser
> > +   use these for all user-declared grammar symbols for which the user
> > does
> > +   not declare a specific %printer/%destructor.  Thus, the parser uses it
> > +   for token 0 if the user declares it but not if Bison generates it as
> > +   $end.
> 
> Nice work!

Thanks.

I'm beginning to think the declaration is a bit ugly though.  How about 
something like this instead:

  %destructor { free ($$); } %symbol-default
  %printer { fprintf (yyoutput, "%s", $$); } %symbol-default

I think that's clearer than just an empty list.  Unfortunately, it is yet 
another % declaration, but it may have other uses: see here where I called 
it %any instead:

  http://lists.gnu.org/archive/html/bison-patches/2006-08/msg00033.html

What do you think?

Joel


Reply via email to