GNU bison suggestion: some include directive.

Basile Starynkevitch <[email protected]> Wed, 9 Aug 2023 12:36:46 +0200
Newsgroups gmane.comp.parsers.bison.bugs
Message-ID <[email protected]>
Hello all,


In some cases, a GNU bison input grammar might be a too big file, and it 
would be convenient to have some include directive (à la GNU cpp) in it.


Spliting a large grammar file into several pieces is convenient, for 
software engineering reasons (exactly for the same reason, C and C++ 
have #include....)


My suggestion is to add some new feature to the GNU bison syntax:

If an input line starts with %+ followed by a file path, the content of 
that file is included at that place.

I would even like to include a popen-ed output, if explicitly allowed by 
a --popen-allowed program option. Then %| would popen the command and 
include it.

Is that suggestion interesting someone?

(it would be very useful in the RefPerSys open source -GPLv3+ licensed- 
inference engine project on https://github.com/RefPerSys/RefPerSys/ ....)


Regards

-- 
Basile Starynkevitch                  <[email protected]>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/