[Top][All Lists]

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

filenaming with .yxx extensions

From: Ken Foskey
Subject: filenaming with .yxx extensions
Date: 17 Feb 2002 21:21:31 +1100

OpenOffice.org having some problems with the newer releases of bison and
OpenOffice.   OpenOffice uses the -d option with .yxx files and it does
not react the same way as 1.28 bison.

rsc uses bison to generate its parser.  Bison runs with 

        bison -d -o output input.yxx

The old bison would create

        output  (parser code)

        output.h (header for other programs).

Bison 1.31 (debian woody) creates

        output   (header code)

Work around is to run in solenv/inc/tg_yacc.mk duplicate the bison lines
and replace with:

        $(BISON) -d -o $(YACCOUT)$/$(YACCTARGET).h $(YACCFILES)

We also use .y and .yy extensions suffering similar problems.  Someone
has applied the following patch to Bison to work around the problem.

        * src/files (compute_exts_from_gf, compute_exts_from_src):
        the case where header_extension is the same as src_extension,
        handle -d -o <file> where <file> doesn't have a known EXT to
        transform. e.g. if <file> is <something>.yxx, set the
        header_extension to <something>.yxx.h, as would do bison 1.28.

--- bison-1.32/src/files.c.extfix       Mon Jan 21 16:41:46 2002
+++ bison-1.32/src/files.c      Fri Feb 15 15:40:43 2002
@@ -288,6 +288,8 @@ compute_exts_from_gf (const char *ext)
   src_extension = tr (src_extension, 'Y', 'C');
   header_extension = tr (ext, 'y', 'h');
   header_extension = tr (header_extension, 'Y', 'H');
+  if (!strcmp (header_extension, src_extension))
+       header_extension = stringappend (src_extension, ".h");

 /* Computes extensions from the given c source file extension. */
@@ -300,6 +302,8 @@ compute_exts_from_src (const char *ext)
   src_extension = xstrdup (ext);
   header_extension = tr (ext, 'c', 'h');
   header_extension = tr (header_extension, 'C', 'H');
+  if (!strcmp (header_extension, src_extension))
+       header_extension = stringappend (src_extension, ".h");

Please let me know what is happening so that I can pass it back to Open


reply via email to

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