bison-patches
[Top][All Lists]
Advanced

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

Re: glr: include the created header


From: Paul Eggert
Subject: Re: glr: include the created header
Date: Thu, 15 Jun 2006 09:41:21 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Joel E. Denny" <address@hidden> writes:

>    %{
>      /* A block for the non-header pre-prologue.  */
>      /* For Yacc portability, Bison doesn't put this in the header file.  */
>    %}
>    %header{
>      /* A block for the header pre-prologue.  */
>      /* This is the right place to declare %union dependencies.  */
>    %}
>    %union {
>      /* If you don't declare a %union, Bison will not generate any
>         post-prologues.  */
>    }
>    %header{
>      /* A block for the header post-prologue.  */
>      /* If you want something in the header file and it depends on
>         Bison-generated definitions, put it here.  */
>    %}
>    %{
>      /* A block for the non-header post-prologue.  */
>      /* If you want something in your code file but *not* in your header file
>         and it depends on Bison-generated definitions, put it here.  */
>    %}

A nice solution but whew! it's kinda complicated when you step back
and look at it.

Is there any reason one might want to put %header anywhere other than
immediately before or after %union?  If not, another possibility is to
extend the %union syntax to allow three operands, not one.  Or if
that's too weird, the new %header syntax could be used _instead_ of
%union, and could have three operands.




reply via email to

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