help-bison
[Top][All Lists]
Advanced

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

Re: %include functionality


From: Akim Demaille
Subject: Re: %include functionality
Date: Sat, 25 Aug 2018 08:12:53 +0200


> Le 3 juil. 2018 à 01:39, Egor Pugin <address@hidden> a écrit :
> 
> Hi,

Hi Egor,

> I'm looking for something like C includes but for bison files before
> any m4 procesing or expanding.
> Is there any such facilities currently or could it be implemented?
> How do you like the idea?
> I could manually prepocess files, but wanted something more builtin.
> 
> I have several bison parsers which could be included partly into each other.
> For example, there are many common terminals and non-terminal that
> later form different grammars.
> I'd like to reuse them instead of manually changing two or more files.
> 
> I imagine this as like there %include declaration which is processed
> before other parts and behave like C/C++ #incudes.
> 
> In big.yy:
> ...
> %%
> file: ... EOQ
> ...
> %include "common_parts.yy" // any ext
> ...
> %%
> 
> And we invoke bison with something like
> bison … -Ipath/to/dir/with/includes big.yy

This is definitely something that we wanted for years.  What we lack
is time to implement it.  Or someone willing to do it (read my mind ;-).


reply via email to

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