include files for bison?

Gus Gassmann <>
Thu, 21 Oct 2010 14:36:29 -0700 (PDT)

          From comp.compilers

Related articles
include files for bison? (Gus Gassmann) (2010-10-21)
| List of all articles for this month |

From: Gus Gassmann <>
Newsgroups: comp.compilers
Date: Thu, 21 Oct 2010 14:36:29 -0700 (PDT)
Organization: Compilers Central
Keywords: bison, question
Posted-Date: 22 Oct 2010 01:08:31 EDT

I am working on a large project with multiple parsers for several
different XML files. Some of the elements and types in the XML schemas
are identical, and I would like to share some of the parser code. I am
working in flex/bison and am wondering if there is a way to use
include files for bison.

I understand that I can use #include in the C code section, but this
is not what I am talking about. I want to set aside some repeated
grammar rules into a separate file and then "paste" that file into
several bison parsers via an include statement. Is this sort of thing
possible? How would I do it?


gus gassmann
[I'd use m4 as a preprocessor and feed its output to bison. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.