[Top][All Lists]

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

Generated headers

From: Frank Heckenbach
Subject: Generated headers
Date: Sat, 03 Mar 2018 22:36:33 +0100


when using "%defines" or "--defines", bison generates the normal C++
file, the header (whose name can be set with "--defines") and 3 more
files, position.hh, location.hh and stack.hh whose names apparently
cannot be changed.

I think that's not nice for at least two reasons:

- When using several C++ bison parsers in the same source directory
  (I'm not doing this now, but I might in the future), they would
  overwrite each other. Even if the contents might be the same, this
  seems strange.

- To write a proper Makefile, one should remove those files in one
  of the *clean rules. Should one hard code those 3 names? Might
  bison add another one in the future?

  Or, more dangerous, might it get rid of (some of) them? Then, much
  later, someone else might unknowingly use one of those names for a
  real source file and have it deleted accidentally. (Same if the
  source stops using bison sometime in the future.)

So, isn't there some way to rename those files, either based on the
bison source file name, or by a command-line option or directive, or
at least, if still hard coded, in a way that clearly marks them as
bison outputs, e.g. bison-generated-foo.hh?

(I know they're not generated when no header is requested,
but I need the header for my scanner and driver.)


reply via email to

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