]> git.saurik.com Git - bison.git/commitdiff
output: no longer use b4_tokens.
authorAkim Demaille <akim@lrde.epita.fr>
Sun, 22 Jul 2012 07:11:42 +0000 (09:11 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Sun, 22 Jul 2012 15:01:15 +0000 (17:01 +0200)
* data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, data/yacc.c:
Since the previous commit, b4_tokens_define and the like no longer need
b4_tokens.
* src/output.c (token_definitions_output): Remove.

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

diff --git a/TODO b/TODO
index 4f628a20aa4f3577ffc1a004030587c4395e17a8..cec18669c05ed2d671651241b0efff36e543c919 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,11 +2,6 @@
 ** Variable names.
 What should we name `variant' and `lex_symbol'?
 
-** Use b4_symbol in all the skeleton
-Move its definition in the more standard places and deploy it in other
-skeletons.  Then remove the older system, including the tables
-generated by output.c
-
 ** Update the documentation on gnu.org
 
 ** Get rid of fake #lines [Bison: ...]
index 37cf1a4af0f4da2f9c56fb7f7fbbb0187a162d9d..d392622903a9f1e6197d4aed0a32bb8bc3f47600 100644 (file)
@@ -176,7 +176,7 @@ m4_define([b4_rhs_location],
 m4_define([b4_shared_declarations],
 [b4_declare_yydebug[
 ]b4_percent_code_get([[requires]])[
-]b4_token_enums(b4_tokens)[
+]b4_token_enums[
 ]b4_declare_yylstype[
 ]b4_c_ansi_function_decl(b4_prefix[parse], [int], b4_parse_param)[
 ]b4_percent_code_get([[provides]])[]dnl
index 2f986da2e5873be7e7a17d00518dbc883829cda9..81e80278234fcaf2e075cc08c113f5d87989c8db 100644 (file)
@@ -300,7 +300,7 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
 
 ]dnl Redirections for glr.c.
 b4_percent_define_flag_if([[global_tokens_and_yystype]],
-[b4_token_defines(b4_tokens)])
+[b4_token_defines])
 [
 #ifndef ]b4_api_PREFIX[STYPE
 # define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class_name[::semantic_type
index 59b30964473c10cba5c22c0c796a4534891097d6..96936bbe67955cf17d11b62887475da705d8fffc 100644 (file)
@@ -333,7 +333,7 @@ b4_public_types_define])[
 ]b4_namespace_close[
 
 ]b4_percent_define_flag_if([[global_tokens_and_yystype]],
-[b4_token_defines(b4_tokens)
+[b4_token_defines
 
 #ifndef ]b4_api_PREFIX[STYPE
  /* Redirection for backward compatibility.  */
index a40d6c272a6ee2374acf437b9c6f83c1a4698825..9952491735e63017d931362d041cd47f497e5f8e 100644 (file)
@@ -133,7 +133,7 @@ b4_locations_if([[
     /** Token returned by the scanner to signal the end of its input.  */
     public static final int EOF = 0;
 
-]b4_token_enums(b4_tokens)[
+]b4_token_enums[
 
     ]b4_locations_if([[/**
      * Method to retrieve the beginning position of the last scanned token.
index c279ec3ff244a03e44cf16c34528100493bbbf8d..80b7ab5ff5cc001832b08cbd8b87dbbc5ef41ce4 100644 (file)
@@ -284,7 +284,7 @@ m4_define([b4_shared_declarations],
 [b4_cpp_guard_open([b4_spec_defines_file])[
 ]b4_declare_yydebug[
 ]b4_percent_code_get([[requires]])[
-]b4_token_enums_defines(b4_tokens)[
+]b4_token_enums_defines[
 ]b4_declare_yylstype[
 ]b4_declare_yyparse[
 ]b4_percent_code_get([[provides]])[
index d65609707d0cc721b1432f52d1ddb7d6c859bcb3..26a6e7fe6c2fd06c83c9b3f256724d37bcbcd79e 100644 (file)
@@ -469,40 +469,6 @@ prepare_symbol_definitions (void)
 }
 
 
-/*--------------------------------------.
-| Output the tokens definition to OUT.  |
-`--------------------------------------*/
-
-static void
-token_definitions_output (FILE *out)
-{
-  int i;
-  char const *sep = "";
-
-  fputs ("m4_define([b4_tokens], \n[", out);
-  for (i = 0; i < ntokens; ++i)
-    {
-      symbol *sym = symbols[i];
-      int number = sym->user_token_number;
-      uniqstr id = symbol_id_get (sym);
-
-      /* At this stage, if there are literal string aliases, they are
-         part of SYMBOLS, so we should not find their aliased symbols
-         here.  */
-      aver (number != USER_NUMBER_HAS_STRING_ALIAS);
-
-      /* Skip error token and tokens without identifier.  */
-      if (sym != errtoken && id)
-        {
-          fprintf (out, "%s[[[%s]], %d]",
-                   sep, id, number);
-          sep = ",\n";
-        }
-    }
-  fputs ("])\n\n", out);
-}
-
-
 static void
 prepare_actions (void)
 {
@@ -561,7 +527,6 @@ muscles_output (FILE *out)
   fputs ("m4_init()\n", out);
   merger_output (out);
   symbol_numbers_output (out);
-  token_definitions_output (out);
   type_names_output (out);
   user_actions_output (out);
   // Must be last.