bison-patches
[Top][All Lists]
Advanced

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

[PATCH] Comment changes.


From: Akim Demaille
Subject: [PATCH] Comment changes.
Date: Thu, 13 Nov 2008 05:55:26 -0000

        * data/lalr1.cc, data/yacc.c: Fix the description of the
        yytranslate and yytoknum tables.
---
 ChangeLog     |    6 ++++++
 data/lalr1.cc |    9 +++++----
 data/yacc.c   |   10 ++++++----
 3 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a9c41f2..55d9b10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-11-13  Akim Demaille  <address@hidden>
 
+       Comment changes.
+       * data/lalr1.cc, data/yacc.c: Fix the description of the
+       yytranslate and yytoknum tables.
+
+2008-11-13  Akim Demaille  <address@hidden>
+
        Define make_symbol in the header.
        To reach good performances these functions should be inlined (yet this 
is
        to measure precisely).  To this end they must be available to the 
caller.
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 2e9259c..8256e0d 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -411,7 +411,7 @@ m4_map([b4_char_sizeof_], address@hidden)dnl
 # Define yytranslate_.  Sometimes we want it in the header file,
 # sometimes the cc file suffices.
 m4_define([b4_yytranslate_definition],
-[[  // YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.
+[[  // Symbol number corresponding to token number t.
   ]b4_parser_class_name[::token_number_type
   ]b4_parser_class_name[::yytranslate_ (]b4_lex_symbol_if([token_type],
                                                           [int])[ t)
@@ -727,7 +727,8 @@ m4_ifdef([b4_stype],
 #if YYDEBUG
     /// For each rule, its source line number.
     static const ]b4_int_type_for([b4_rline])[ yyrline_[];
-    /// For each scanner token number, its symbol number.
+    /// (External) token number corresponding to the (internal) symbol
+    /// number (which must be that of a token).
     static const ]b4_int_type_for([b4_toknum])[ yytoken_number_[];
     /// Report on the debug stream that the rule \a r is going to be reduced.
     virtual void yy_reduce_print_ (int r);
@@ -1564,8 +1565,8 @@ b4_error_verbose_if([int yystate, int yytoken],
   ]b4_table_define([stos], [b4_stos])[;
 
 #if YYDEBUG
-  /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
-     to YYLEX-NUM.  */
+  /* YYTOKNUM[NUM] -- (External) token number corresponding to the
+     (internal) symbol number NUM (which must be that of a token).  */
   ]b4_table_define([token_number], [b4_toknum])[;
 #endif
 
diff --git a/data/yacc.c b/data/yacc.c
index d16e385..36028e2 100644
--- a/data/yacc.c
+++ b/data/yacc.c
@@ -485,14 +485,16 @@ union yyalloc
 /* YYNSTATES -- Number of states.  */
 #define YYNSTATES  ]b4_states_number[
 
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  ]b4_undef_token_number[
 #define YYMAXUTOK   ]b4_user_token_number_max[
 
 #define YYTRANSLATE(YYX)                                               \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, without out-of-bounds checking.  */
 static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
 {
   ]b4_translate[
@@ -529,8 +531,8 @@ static const char *const yytname[] =
 #endif
 
 # ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
 static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
 {
   ]b4_toknum[
-- 
1.6.0.2.588.g3102





reply via email to

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