bison-patches
[Top][All Lists]
Advanced

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

[PATCH] Define yytranslate in the header for lex_symbol.


From: Akim Demaille
Subject: [PATCH] Define yytranslate in the header for lex_symbol.
Date: Thu, 13 Nov 2008 05:48:23 -0000

        * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
        into the header file when using %define lex_symbol.
        (yytranslate_): Declare inline.
---
 ChangeLog     |    7 +++++++
 data/lalr1.cc |    7 +++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6219754..5b1046b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-11-13  Akim Demaille  <address@hidden>
 
+       Define yytranslate in the header for lex_symbol.
+       * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
+       into the header file when using %define lex_symbol.
+       (yytranslate_): Declare inline.
+
+2008-11-13  Akim Demaille  <address@hidden>
+
        Define the constructors of symbol_type in 
b4_symbol_constructor_definitions.
        The constructors are called by the make_symbol functions, which a
        forthcoming patch will move elsewhere.  Hence the interest of putting 
them
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 3fdd33e..d2c33a1 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -233,6 +233,7 @@ m4_define([b4_symbol_constructor_specialization_],
 b4_args(b4_symbol_if([$1], [has_type],
                      [const b4_symbol([$1], [type])& v]),
         b4_locations_if([const location_type& l])));
+
 ])])])
 
 # b4_symbol_constructor_specializations
@@ -739,7 +740,7 @@ m4_ifdef([b4_stype],
 #endif
 
     /// Convert a scanner token number \a t to a symbol number.
-    static token_number_type yytranslate_ (]b4_lex_symbol_if([token_type], 
[int])[ t);
+    static inline token_number_type yytranslate_ 
(]b4_lex_symbol_if([token_type], [int])[ t);
 
     /// A complete symbol, with its type.
     template <typename Exact>
@@ -873,6 +874,8 @@ m4_ifdef([b4_stype],
 
 ]b4_parse_param_vars[
   };
+
+]b4_lex_symbol_if([b4_yytranslate_definition])[
 ]b4_symbol_constructor_specializations[
 ]b4_namespace_close[
 
@@ -1614,7 +1617,7 @@ b4_error_verbose_if([int yystate, int yytoken],
   }
 #endif // YYDEBUG
 
-]b4_yytranslate_definition[
+]b4_lex_symbol_if([], [b4_yytranslate_definition])[
 ]b4_namespace_close[
 
 ]b4_epilogue[]dnl
-- 
1.6.0.2.588.g3102





reply via email to

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