]> git.saurik.com Git - bison.git/commitdiff
* src/reader.c (symbols_output): New, extracted from...
authorAkim Demaille <akim@epita.fr>
Mon, 5 Nov 2001 14:19:29 +0000 (14:19 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 5 Nov 2001 14:19:29 +0000 (14:19 +0000)
(packsymbols): here.
(reader): Adjust.

ChangeLog
src/reader.c

index c0b7ebe54f968c2c626b92ef1046244a6934ce9d..6f8a79421e76e5dd4ce9b6cba421ffed20613d29 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-05  Akim Demaille  <akim@epita.fr>
+
+       * src/reader.c (symbols_output): New, extracted from...
+       (packsymbols): here.
+       (reader): Adjust.
+
 2001-11-05  Akim Demaille  <akim@epita.fr>
 
        * src/lex.c (parse_percent_token): s/quotearg/quote/.
index bf6eef0dc280ce5fe97eb4c57ef3ab000794cfd6..03c0d31197ea3ee3902ca5eceaeacb2b8c799750 100644 (file)
@@ -1832,6 +1832,22 @@ packsymbols (void)
 
   error_token_number = errtoken->value;
 
+  if (startval->class == unknown_sym)
+    fatal (_("the start symbol %s is undefined"), startval->tag);
+  else if (startval->class == token_sym)
+    fatal (_("the start symbol %s is a token"), startval->tag);
+
+  start_symbol = startval->value;
+}
+
+
+/*-----------------------------------.
+| Output definition of token names.  |
+`-----------------------------------*/
+
+static void
+symbols_output (void)
+{
   {
     struct obstack tokendefs;
     obstack_init (&tokendefs);
@@ -1846,13 +1862,6 @@ packsymbols (void)
     output_token_defines (&table_obstack);
 #endif
 
-  if (startval->class == unknown_sym)
-    fatal (_("the start symbol %s is undefined"), startval->tag);
-  else if (startval->class == token_sym)
-    fatal (_("the start symbol %s is a token"), startval->tag);
-
-  start_symbol = startval->value;
-
   if (defines_flag)
     {
       output_token_defines (&defines_obstack);
@@ -2020,6 +2029,7 @@ reader (void)
   /* Assign the symbols their symbol numbers.  Write #defines for the
      token symbols into FDEFINES if requested.  */
   packsymbols ();
+  symbols_output ();
   /* Convert the grammar into the format described in gram.h.  */
   packgram ();
 }