bison-patches
[Top][All Lists]
Advanced

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

[Main] Use directive with #line.


From: Pascal Bart
Subject: [Main] Use directive with #line.
Date: Fri, 31 Aug 2001 01:55:37 +0000 (GMT)

Re-hello,

        With this patch, Bison uses directives (macro) to set the filename
give to #line in output file.  Robert tells me if you are ok about it.

Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.197
diff -u -r1.197 ChangeLog
--- ChangeLog   2001/08/30 18:51:56     1.197
+++ ChangeLog   2001/08/30 22:41:30
@@ -1,3 +1,10 @@
+2001-08-31  Pascal Bart  <address@hidden>
+
+       * src/output.c (prepare): Delete the `filename' insertion.
+       * src/reader.c (copy_action): Use `filename' directive with `#line'.
+       (parse_union_decl): Use `filename' too.
+       * src/macrotab.c (macro_init): Initialize filename by infile.
+
 2001-08-30  Pascal Bart  <address@hidden>

        * src/main.c: Include macrotab.h.
Index: src/macrotab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/macrotab.c,v
retrieving revision 1.4
diff -u -r1.4 macrotab.c
--- src/macrotab.c      2001/08/30 18:51:56     1.4
+++ src/macrotab.c      2001/08/30 22:41:31
@@ -53,7 +53,7 @@

   /* Version and input file. */
   macro_insert ("version", VERSION);
-  macro_insert ("filename", "a.y");
+  macro_insert ("filename", infile);

   /* Types. */
   macro_insert ("stype", "int");
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.48
diff -u -r1.48 output.c
--- src/output.c        2001/08/30 18:51:56     1.48
+++ src/output.c        2001/08/30 22:41:31
@@ -1067,8 +1067,6 @@
   MACRO_INSERT_INT ("ntbase", ntokens);
   MACRO_INSERT_INT ("verbose", 0);

-  MACRO_INSERT_STRING ("filename", infile);
-
   MACRO_INSERT_INT ("nnts", nvars);
   MACRO_INSERT_INT ("nrules", nrules);
   MACRO_INSERT_INT ("nstates", nstates);
Index: src/reader.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.c,v
retrieving revision 1.79
diff -u -r1.79 reader.c
--- src/reader.c        2001/08/30 00:41:37     1.79
+++ src/reader.c        2001/08/30 22:41:32
@@ -749,7 +749,8 @@

   if (!no_lines_flag)
     obstack_fgrow2 (&attrs_obstack, "\n#line %d %s\n",
-                   lineno, quotearg_style (c_quoting_style, infile));
+                   lineno, quotearg_style (c_quoting_style,
+                                           macro_find("filename")));
   else
     obstack_1grow (&attrs_obstack, '\n');

@@ -1111,7 +1112,8 @@
   if (!no_lines_flag)
     {
       sprintf (buf, "#line %d %s\n",
-              lineno, quotearg_style (c_quoting_style, infile));
+              lineno, quotearg_style (c_quoting_style,
+                                      macro_find ("filename")));
       obstack_grow (&action_obstack, buf, strlen (buf));
     }
   obstack_1grow (&action_obstack, '{');

Pascal Bart (address@hidden)




reply via email to

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