bison-patches
[Top][All Lists]
Advanced

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

[FYI] c++-skeleton-extending-parsers.patch


From: Robert Anisko
Subject: [FYI] c++-skeleton-extending-parsers.patch
Date: Sat, 9 Mar 2002 15:44:18 +0100 (CET)

Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.583
diff -u -r1.583 ChangeLog
--- ChangeLog   5 Mar 2002 18:30:22 -0000       1.583
+++ ChangeLog   9 Mar 2002 14:30:13 -0000
@@ -1,3 +1,8 @@
+2002-03-09  Robert Anisko  <address@hidden>
+
+       * data/bison.c++: Make the user able to add members to the generated
+       parser by subclassing.
+
 2002-03-05  Robert Anisko  <address@hidden>
 
        * src/reader.c (read_additionnal_code): `c' should be an integer, not
Index: data/bison.c++
===================================================================
RCS file: /cvsroot/bison/bison/data/bison.c++,v
retrieving revision 1.14
diff -u -r1.14 bison.c++
--- data/bison.c++      4 Mar 2002 16:48:33 -0000       1.14
+++ data/bison.c++      9 Mar 2002 14:30:13 -0000
@@ -25,6 +25,24 @@
                   [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name),
                                 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
 
+m4_define([b4_inherit],
+          [m4_ifdef([b4_root], 
+                   [: public b4_root
+],
+                   [])])
+
+m4_define([b4_param],
+         [m4_ifdef([b4_root],
+                   [,
+            const Param& param],
+                   [])])
+
+m4_define([b4_constructor],
+         [m4_ifdef([b4_root],
+                   [b4_root (param),
+      ],
+                   [])])
+
 m4_define([b4_copyright],
           [/* -*- C++ -*- */
 /* A Bison parser, made from b4_filename,
@@ -126,7 +144,7 @@
 
 namespace yy
 {
-  class b4_name
+  class b4_name b4_inherit
   {
   public:
 
@@ -140,10 +158,12 @@
 
 #if YYLSP_NEEDED
     b4_name (bool debug,
-            LocationType initlocation) : debug_ (debug),
-                                         initlocation_ (initlocation)
+           LocationType initlocation[]b4_param) : 
+      b4_constructor[]debug_ (debug),
+      initlocation_ (initlocation)
 #else
-    b4_name (bool debug) : debug_ (debug)
+    b4_name (bool debug[]b4_param) :
+      b4_constructor[]debug_ (debug)
 #endif
     {
     }



reply via email to

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