bison-patches
[Top][All Lists]
Advanced

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

FYI: lalr1.cc: Template coding style


From: Akim Demaille
Subject: FYI: lalr1.cc: Template coding style
Date: Wed, 29 Sep 2004 17:39:10 +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: Move towards a more standard C++ coding style
        for templates: Class < T > -> Class<T>.

Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.59
diff -u -u -r1.59 lalr1.cc
--- data/lalr1.cc 29 Sep 2004 12:41:58 -0000 1.59
+++ data/lalr1.cc 29 Sep 2004 12:49:23 -0000
@@ -195,13 +195,13 @@
 {
   class ]b4_parser_class_name[;
 
-  template < typename P >
+  template <typename P>
   struct Traits
   {
   };
 
-  template < >
-  struct Traits< ]b4_parser_class_name[ >
+  template <>
+  struct Traits<]b4_parser_class_name[>
   {
     typedef ]b4_int_type_for([b4_translate])[ TokenNumberType;
     typedef ]b4_int_type_for([b4_rhs])[       RhsNumberType;
@@ -217,15 +217,15 @@
   {
   public:
 
-    typedef Traits< ]b4_parser_class_name[ >::TokenNumberType TokenNumberType;
-    typedef Traits< ]b4_parser_class_name[ >::RhsNumberType   RhsNumberType;
-    typedef Traits< ]b4_parser_class_name[ >::StateType       StateType;
-    typedef Traits< ]b4_parser_class_name[ >::SemanticType    SemanticType;
-    typedef Traits< ]b4_parser_class_name[ >::LocationType    LocationType;
-
-    typedef Stack< StateType >    StateStack;
-    typedef Stack< SemanticType > SemanticStack;
-    typedef Stack< LocationType > LocationStack;
+    typedef Traits<]b4_parser_class_name[>::TokenNumberType TokenNumberType;
+    typedef Traits<]b4_parser_class_name[>::RhsNumberType   RhsNumberType;
+    typedef Traits<]b4_parser_class_name[>::StateType       StateType;
+    typedef Traits<]b4_parser_class_name[>::SemanticType    SemanticType;
+    typedef Traits<]b4_parser_class_name[>::LocationType    LocationType;
+
+    typedef Stack<StateType>    StateStack;
+    typedef Stack<SemanticType> SemanticStack;
+    typedef Stack<LocationType> LocationStack;
 
     ]b4_parser_class_name[ (bool debug][]b4_param[]b4_parse_param_decl[) :
       ]b4_constructor[][debug_ (debug),
@@ -595,7 +595,7 @@
 
   if (len_)
     {
-      Slice< LocationType, LocationStack > slice (location_stack_, len_);
+      Slice<LocationType, LocationStack> slice (location_stack_, len_);
       YYLLOC_DEFAULT (yyloc, slice, len_);
     }
   YY_REDUCE_PRINT (n_);
@@ -927,7 +927,8 @@
 {
   unsigned int yylno = rline_[yyrule];
   /* Print the symbols being reduced, and their result.  */
-  cdebug_ << "Reducing stack by rule " << n_ - 1 << " (line " << yylno << "), 
";
+  cdebug_ << "Reducing stack by rule " << n_ - 1
+          << " (line " << yylno << "), ";
   for (]b4_int_type_for([b4_prhs])[ i = prhs_[n_];
        0 <= rhs_[i]; ++i)
     cdebug_ << name_[rhs_[i]] << ' ';
@@ -975,7 +976,7 @@
 
 namespace yy
 {
-  template < class T, class S = std::deque< T > >
+  template <class T, class S = std::deque<T> >
   class Stack
   {
   public:
@@ -1036,7 +1037,7 @@
     S seq_;
   };
 
-  template < class T, class S = Stack< T > >
+  template <class T, class S = Stack<T> >
   class Slice
   {
   public:




reply via email to

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