[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: glr: include the created header
From: |
Joel E. Denny |
Subject: |
Re: glr: include the created header |
Date: |
Tue, 3 Jan 2006 23:25:48 -0500 (EST) |
On Tue, 3 Jan 2006, Akim Demaille wrote:
> >>> "Joel" == Joel E Denny <address@hidden> writes:
>
> > To accommodate YYSTYPE dependencies, YYLTYPE dependencies, a non-%union
> > YYSTYPE definition, a user YYLTYPE definition, or anything else the user
> > might wish to place in the header, perhaps there should be some sort of
> > general `header' qualifier for any literal block:
>
> > %header{
> > /* C code */
> > %}
>
> I dislike the difference that it introduces between a parser with
> %defines, and another without. That's another thing I enjoy with the
> current scheme: there's nothing to change.
In the current scheme, adding %defines means you should rearrange your
bison spec so that no inappropriate code appears in the pre-prologue. If
you forget, you may unknowingly pollute the header.
In the scheme I'm proposing, adding %defines means you have to rearrange
so that appropriate code appears in %header literal blocks. If you
forget, the compiler will complain about missing dependencies from the
header, so you'll be sure to find out.
In either scheme, removing %defines requires no extra work.
> In fact, I don't like parsers without headers :(
Neither do I.
> Can this wait after 2.2?
Absolutely.
Joel