]> git.saurik.com Git - bison.git/commitdiff
* data/glr.c (YYTOKEN_TABLE): New macro.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 22 Jul 2005 17:07:31 +0000 (17:07 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 22 Jul 2005 17:07:31 +0000 (17:07 +0000)
(yytname): Define if YYTOKEN_TABLE.
* data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
* data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
(YYERROR_VERBOSE): Define the same way the other skeletons do.
* src/output.c (prepare_symbols): Output token_table_flag.

data/glr.c
data/lalr1.cc
data/yacc.c
src/output.c

index f23f90494bac9628df3b73aaa960fcad3f181477..080d263cb2bd6f47d64ce3863c0196f0d6f095e8 100644 (file)
@@ -172,6 +172,11 @@ b4_pre_prologue[
 # define YYERROR_VERBOSE ]b4_error_verbose[
 #endif
 
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE ]b4_token_table[
+#endif
+
 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 ]m4_ifdef([b4_stype],
 [b4_syncline([b4_stype_line], [b4_filename])
@@ -331,7 +336,7 @@ static const ]b4_int_type_for([b4_rline])[ yyrline[] =
 };
 #endif
 
-#if (YYDEBUG) || YYERROR_VERBOSE
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
 static const char *const yytname[] =
index e492173a40dd3edfeaa6990a0c2ca567e2c97222..e6190c8b9e5b912eef629a2932e1d35a0cc0911c 100644 (file)
@@ -149,11 +149,19 @@ b4_syncline([@oline@], [@ofile@])[
 # define YYDEBUG ]b4_debug[
 #endif
 
-/* Enabling verbose error message.  */
-#ifndef YYERROR_VERBOSE
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
 # define YYERROR_VERBOSE ]b4_error_verbose[
 #endif
 
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE ]b4_token_table[
+#endif
+
 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 ]m4_ifdef([b4_stype],
 [b4_syncline([b4_stype_line], [b4_filename])
@@ -321,7 +329,7 @@ namespace yy
     /// For a rule, its RHS length.
     static const ]b4_int_type_for([b4_r2])[ yyr2_[];
 
-#if YYDEBUG || YYERROR_VERBOSE
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
     /// For a symbol, its name in clear.
     static const char* const yytname_[];
 #endif
@@ -1030,7 +1038,7 @@ yy::]b4_parser_class_name[::yyr2_[] =
   ]b4_r2[
 };
 
-#if YYDEBUG || YYERROR_VERBOSE
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at \a yyntokens_, nonterminals. */
 const char*
index 3dc30898681602478e766954de5960acfa099d96..f4b1b1b9a811d7693225b163cd0ad2f2783df550 100644 (file)
@@ -182,6 +182,11 @@ b4_location_if([#define yylloc b4_prefix[]lloc])])[
 # define YYERROR_VERBOSE ]b4_error_verbose[
 #endif
 
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE ]b4_token_table[
+#endif
+
 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 ]m4_ifdef([b4_stype],
 [b4_syncline([b4_stype_line], [b4_filename])
@@ -415,7 +420,7 @@ static const ]b4_int_type_for([b4_rline])[ yyrline[] =
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
 static const char *const yytname[] =
index 51541822c44c7c4b7178554a416f9ec00f223122..cd5846bcf8229734f0f9ff5e5f14da528db5d773 100644 (file)
@@ -145,6 +145,7 @@ escaped_output (FILE *out, char const *string)
 static void
 prepare_symbols (void)
 {
+  MUSCLE_INSERT_BOOL ("token_table", token_table_flag);
   MUSCLE_INSERT_INT ("tokens_number", ntokens);
   MUSCLE_INSERT_INT ("nterms_number", nvars);
   MUSCLE_INSERT_INT ("undef_token_number", undeftoken->number);