bison-patches
[Top][All Lists]
Advanced

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

[Main] Copy user definitions.


From: Pascal Bart
Subject: [Main] Copy user definitions.
Date: Tue, 28 Aug 2001 12:07:59 +0000 (GMT)

Hi,

        I send you the patch, which copies the user definitions %{...%} in
the bison.simple. Robert tell me what do you think about ?

cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.188
diff -u -r1.188 ChangeLog
--- ChangeLog   2001/08/27 17:28:28     1.188
+++ ChangeLog   2001/08/28 10:02:47
@@ -1,3 +1,9 @@
+2001-08-28  Pascal Bart  <address@hidden>
+
+       * src/output.c (prepare): Copy attrs_obstack in the '%%definitions'
+       directive.
+       * src/bison.simple: Add `%%definitions'.
+
 2001-08-27  Paul Eggert  <address@hidden>

        * src/bison.simple (yyparse): Don't take the address of an
cvs server: Diffing config
cvs server: Diffing doc
cvs server: Diffing etc
cvs server: Diffing intl
cvs server: Diffing lib
cvs server: Diffing m4
cvs server: Diffing po
cvs server: Diffing src
Index: src/bison.simple
===================================================================
RCS file: /cvsroot/bison/bison/src/bison.simple,v
retrieving revision 1.57
diff -u -r1.57 bison.simple
--- src/bison.simple    2001/08/27 17:24:34     1.57
+++ src/bison.simple    2001/08/28 10:02:48
@@ -33,6 +33,9 @@

 #include <stdio.h>

+/* Copy the user declarations.  */
+%%definitions
+
 #ifndef __cplusplus
 # ifndef __STDC__
 #  define const
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.44
diff -u -r1.44 output.c
--- src/output.c        2001/08/27 14:55:39     1.44
+++ src/output.c        2001/08/28 10:02:48
@@ -1078,6 +1078,15 @@
   MACRO_INSERT_INT ("verbose", 0);

   MACRO_INSERT_STRING ("filename", infile);
+  {
+    size_t size = obstack_object_size (&attrs_obstack);
+    char *definitions;
+
+    definitions = XMALLOC (char, size + 1);
+    bcopy (obstack_finish (&attrs_obstack), definitions, size);
+
+    MACRO_INSERT_STRING ("definitions", definitions);
+  }

   MACRO_INSERT_INT ("nnts", nvars);
   MACRO_INSERT_INT ("nrules", nrules);
cvs server: Diffing tests

Pascal Bart (address@hidden)




reply via email to

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