help-bison
[Top][All Lists]
Advanced

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

%include functionality


From: Egor Pugin
Subject: %include functionality
Date: Tue, 3 Jul 2018 02:39:58 +0300

Hi,

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

-- 
Egor Pugin



reply via email to

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