help-bison
[Top][All Lists]
Advanced

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

Re: Includes


From: Akim Demaille
Subject: Re: Includes
Date: Sun, 15 Jan 2012 10:29:53 +0100

Le 13 janv. 2012 à 16:03, Csaba Raduly a écrit :

> Hi,

Hi Csaba,

> Bison 2.3 used to write the prologue into the definitions file (the header)
> 
> Bison 2.4 seems to have changed this and now writes the prologue into
> the parser implementation file. This has created a problem for me
> because the %union contains pointers to various user-defined types,
> but the #includes containing their definitions are no longer written
> into the bison-generated header file. Manually updating the list of
> includes in every file that uses the bison-generated header is a pain.
> 
> %code appears to provide the needed flexibility, but of course it's
> not recognized by bison 2.3 and I need my code to be compatible with
> both 2.3 and 2.4.x
> 
> Is this (i.e. putting #includes into the generated header) possible?

This area was really messy, and as Hans pointed out, %code is really
the safest way to go.  Is there some reason that prevents you from
deploying Bison 2.5 instead?

If you really want to stick to old versions, please be aware that %{…%}
sections before %union are published in the header, contrary %{…%}
after %union.  IIRC…

But really, %code is safer and much clearer.


reply via email to

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