[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inserting into tab.h, after %union
From: |
Joel E. Denny |
Subject: |
Re: inserting into tab.h, after %union |
Date: |
Sat, 2 Dec 2006 16:11:33 -0500 (EST) |
On Sat, 2 Dec 2006, Joel E. Denny wrote:
> On Fri, 1 Dec 2006, Jeff Inman wrote:
>
> > It seems wrong to me that the second set of "%{ ... %}", after a "%union{
> > ...}", should insert
> > into the tab.cpp file, instead of into the tab.hpp file. I want to make
> > more
> > declarations
> > that depend on the type produced by the union.
>
> I definitely agree that the relationship between %{...%} and %union is
> confusing. We're working on a set of alternatives to %{...%} that will
> hopefully make things more explicit and more flexible:
>
> 1. %code {...} will insert code into your tab.cpp after the contents of
> the header, which include the union definition. You can, for example,
> declare static globals here.
>
> 2. %requires {...} will insert code into your tab.hpp and tab.cpp before
> the union definition. This is the right place for dependencies of your
> union.
>
> 3. %provides {...} will insert code into your tab.hpp and tab.cpp after
> the union definition. In other words, it's a place to write code that
> your parser module provides to external code.
>
> 4. %code-top {...} is not as often useful. It inserts code at the very
> top of your tab.cpp.
>
> These are implemented in CVS now. We will consider them experimental
> until we can get some user feedback. I can't promise when the next
> release will be though.
I meant to ask: does this sound like it will address your needs?
- inserting into tab.h, after %union, Jeff Inman, 2006/12/02
- Re: inserting into tab.h, after %union, Joel E. Denny, 2006/12/02
- Re: inserting into tab.h, after %union,
Joel E. Denny <=
- Re: inserting into tab.h, after %union, Jeff Inman, 2006/12/04
- Re: inserting into tab.h, after %union, Joel E. Denny, 2006/12/04
- Re: inserting into tab.h, after %union, Joel E. Denny, 2006/12/04
- Re: inserting into tab.h, after %union, Hans Aberg, 2006/12/04
- Re: inserting into tab.h, after %union, Joel E. Denny, 2006/12/04
- Re: inserting into tab.h, after %union, Hans Aberg, 2006/12/05
- Re: inserting into tab.h, after %union, Hans Aberg, 2006/12/05
- Re: inserting into tab.h, after %union, Joel E. Denny, 2006/12/05
- Message not available
- Message not available
- Re: inserting into tab.h, after %union, Joel E. Denny, 2006/12/06
- Re: inserting into tab.h, after %union, Hans Aberg, 2006/12/06