bison-patches
[Top][All Lists]
Advanced

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

FYI: lalr1.cc: Restore previous ctor


From: Akim Demaille
Subject: FYI: lalr1.cc: Restore previous ctor
Date: Wed, 29 Sep 2004 14:42:18 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * data/lalr1.cc: Reinstall the former ctor, for sake of
        compatibility, but warn it will be removed.
        Move towards a more standard C++ coding style (i.e., type *var ->
        type* var).

        (b4_parse_param_decl): Use it to have different names between attribute
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.58
diff -u -u -r1.58 lalr1.cc
--- data/lalr1.cc 27 Sep 2004 07:45:09 -0000 1.58
+++ data/lalr1.cc 29 Sep 2004 12:41:45 -0000
@@ -205,8 +205,8 @@
   {
     typedef ]b4_int_type_for([b4_translate])[ TokenNumberType;
     typedef ]b4_int_type_for([b4_rhs])[       RhsNumberType;
-    typedef int      StateType;
-    typedef yystype  SemanticType;
+    typedef int StateType;
+    typedef yystype SemanticType;
     typedef ]b4_location_type[ LocationType;
   };
 }
@@ -233,6 +233,17 @@
     {
     }
 
+    ]b4_parser_class_name[ (bool debug,
+           LocationType][]b4_param[]b4_parse_param_decl[) :
+      ]b4_constructor[][debug_ (debug),
+      cdebug_ (std::cerr)]b4_parse_param_cons[
+    {
+      cdebug_ << __FILE__ << ':' << __LINE__
+             << ": this constructor is provided by backward compatibility"
+             << ", but will be removed in the near future."
+             << std::endl;
+    }
+
     virtual ~]b4_parser_class_name[ ()
     {
     }
@@ -247,8 +258,8 @@
     virtual void report_syntax_error_ ();
 #if YYDEBUG
     virtual void symprint_ (int yytype,
-                           const SemanticType *yyvaluep,
-                           const LocationType *yylocationp);
+                           const SemanticType* yyvaluep,
+                           const LocationType* yylocationp);
 #endif /* ! YYDEBUG */
 
 
@@ -286,9 +297,9 @@
 
     /* Even more tables.  */
     inline TokenNumberType translate_ (int token);
-    inline void destruct_ (const char *yymsg,
+    inline void destruct_ (const char* yymsg,
                            int yytype,
-                           SemanticType *yyvaluep, LocationType *yylocationp);
+                           SemanticType* yyvaluep, LocationType* yylocationp);
 
     /// Pop \a n symbols the three stacks.
     inline void pop (unsigned int n = 1);
@@ -317,7 +328,7 @@
 
     /* Debugging.  */
     int debug_;
-    std::ostream &cdebug_;
+    std::ostream& cdebug_;
 
     /* Look-ahead and look-ahead in internal form.  */
     int looka_;
@@ -398,7 +409,7 @@
 
 void
 yy::]b4_parser_class_name[::symprint_ (int yytype,
-                         const SemanticType *yyvaluep, const LocationType 
*yylocationp)
+                         const SemanticType* yyvaluep, const LocationType* 
yylocationp)
 {
   /* Pacify ``unused variable'' warnings.  */
   (void) yyvaluep;
@@ -418,8 +429,8 @@
 #endif /* ! YYDEBUG */
 
 void
-yy::]b4_parser_class_name[::destruct_ (const char *yymsg,
-                         int yytype, SemanticType *yyvaluep, LocationType 
*yylocationp)
+yy::]b4_parser_class_name[::destruct_ (const char* yymsg,
+                         int yytype, SemanticType* yyvaluep, LocationType* 
yylocationp)
 {
   /* Pacify ``unused variable'' warnings.  */
   (void) yyvaluep;
@@ -1245,7 +1256,7 @@
   }
 
   /** \brief Add and assign a Location */
-  inline Location &operator+= (Location& res, unsigned int width)
+  inline Location& operator+= (Location& res, unsigned int width)
   {
     res.columns (width);
     return res;




reply via email to

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