bison-patches
[Top][All Lists]
Advanced

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

[PATCH] Simplify names.


From: Akim Demaille
Subject: [PATCH] Simplify names.
Date: Thu, 13 Nov 2008 05:27:18 -0000

        * src/output.c (symbol_definitions_output): Rename symbol
        attributes type_name and has_type_name as type and has_type.
        * data/lalr1.cc: Adjust uses.
---
 ChangeLog     |    7 +++++++
 data/lalr1.cc |   22 +++++++++++-----------
 src/output.c  |    4 ++--
 3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cd1254c..23fd42e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-11-13  Akim Demaille  <address@hidden>
 
+       Simplify names.
+       * src/output.c (symbol_definitions_output): Rename symbol
+       attributes type_name and has_type_name as type and has_type.
+       * data/lalr1.cc: Adjust uses.
+
+2008-11-13  Akim Demaille  <address@hidden>
+
        Use b4_type_names for the union type.
        The union used to compute the size of the variant used to iterate over 
the
        type of all the symbols, with a lot of redundancy.  Now iterate over the
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 83fcfdd..10669ff 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -185,11 +185,11 @@ m4_define([b4_symbol_case_],
 # Run actions for the symbol NUMS that all have the same type-name.
 # Skip NUMS that have no type-name.
 m4_define([b4_type_action_],
-[b4_symbol_if([$1], [has_type_name],
+[b4_symbol_if([$1], [has_type],
 [m4_map([b4_symbol_case_], address@hidden)[]dnl
         b4_dollar_dollar([b4_symbol([$1], [number])],
                          [b4_symbol([$1], [tag])],
-                         [b4_symbol([$1], [type_name])]);
+                         [b4_symbol([$1], [type])]);
        break;
 
 ])])
@@ -202,8 +202,8 @@ m4_define([b4_type_action_],
 m4_define([b4_symbol_constructor_declaration_],
 [    template <token_type>
     static inline symbol_type
-    make_symbol (b4_args(b4_symbol_if([$1], [has_type_name],
-                                      [const b4_symbol([$1], [type_name])& v]),
+    make_symbol (b4_args(b4_symbol_if([$1], [has_type],
+                                      [const b4_symbol([$1], [type])& v]),
                          b4_locations_if([const location_type& l])));
 
 ])
@@ -230,8 +230,8 @@ m4_define([b4_symbol_constructor_specialization_],
   inline
   b4_parser_class_name::symbol_type
   b4_parser_class_name::make_symbol 
<b4_parser_class_name::token::b4_symbol([$1], [id])> (dnl
-b4_args(b4_symbol_if([$1], [has_type_name],
-                     [const b4_symbol([$1], [type_name])& v]),
+b4_args(b4_symbol_if([$1], [has_type],
+                     [const b4_symbol([$1], [type])& v]),
         b4_locations_if([const b4_parser_class_name::location_type& l])));
 ])])])
 
@@ -255,12 +255,12 @@ m4_define([b4_symbol_constructor_definition_],
 [  template <>
   b4_parser_class_name::symbol_type
   b4_parser_class_name::make_symbol 
<b4_parser_class_name::token::b4_symbol([$1], [id])> (dnl
-b4_args(b4_symbol_if([$1], [has_type_name],
-                     [const b4_symbol([$1], [type_name])& v]),
+b4_args(b4_symbol_if([$1], [has_type],
+                     [const b4_symbol([$1], [type])& v]),
         b4_locations_if([const location_type& l])))
   {
     return symbol_type (b4_args([yytranslate_ (token::b4_symbol([$1], [id]))],
-                                b4_symbol_if([$1], [has_type_name], [v]),
+                                b4_symbol_if([$1], [has_type], [v]),
                                 b4_locations_if([l])));
   }
 
@@ -323,10 +323,10 @@ m4_define([b4_char_sizeof_],
 #
 # for defined type names.
 m4_define([b4_char_sizeof],
-[b4_symbol_if([$1], [has_type_name],
+[b4_symbol_if([$1], [has_type],
 [
 m4_map([b4_char_sizeof_], address@hidden)dnl
-      char address@hidden([b4_symbol([$1], [type_name])])@};
+      char address@hidden([b4_symbol([$1], [type])])@};
 ])])
 
 
diff --git a/src/output.c b/src/output.c
index 4759164..31bfd12 100644
--- a/src/output.c
+++ b/src/output.c
@@ -438,10 +438,10 @@ symbol_definitions_output (FILE *out)
       SET_KEY("number");
       MUSCLE_INSERT_INT (key, sym->number);
 
-      SET_KEY("has_type_name");
+      SET_KEY("has_type");
       MUSCLE_INSERT_INT (key, !!sym->type_name);
 
-      SET_KEY("type_name");
+      SET_KEY("type");
       MUSCLE_INSERT_STRING (key, sym->type_name ? sym->type_name : "");
 
 #undef SET_KEY
-- 
1.6.0.2.588.g3102





reply via email to

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