bison-patches
[Top][All Lists]
Advanced

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

[Main] Dead code.


From: Pascal Bart
Subject: [Main] Dead code.
Date: Sat, 1 Sep 2001 13:31:51 +0000 (GMT)

Re,

        The following dead code is ever unused in the future bison-1_29
version, so I think, we needn't to keep it longer.  It seems this code
was disable long time ago, but I can't find ChangeLog entry about this
suppress.  So I'm waiting for a confirmation.

Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.206
diff -u -r1.206 ChangeLog
--- ChangeLog   2001/09/01 10:40:54     1.206
+++ ChangeLog   2001/09/01 10:52:35
@@ -1,5 +1,10 @@
 2001-09-01  Pascal Bart  <address@hidden>

+       * src/reader.c (get_type): Delete function.
+       (readgram): Delete dead code, which used get_type.
+
+2001-09-01  Pascal Bart  <address@hidden>
+
        * src/reader.c (copy_guard): Use muscle to specify the `#line'
        filename.

Index: src/reader.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.c,v
retrieving revision 1.84
diff -u -r1.84 reader.c
--- src/reader.c        2001/09/01 10:40:54     1.84
+++ src/reader.c        2001/09/01 10:52:36
@@ -1313,58 +1313,6 @@
   sym->value = nvars++;
   return sym;
 }
-
-#if 0
-/*------------------------------------------------------------------.
-| read in a %type declaration and record its information for        |
-| get_type_name to access.  This is unused.  It is only called from |
-| the #if 0 part of readgram                                        |
-`------------------------------------------------------------------*/
-
-static int
-get_type (void)
-{
-  int k;
-  token_t token;
-  char *name;
-
-  token = lex ();
-
-  if (token != tok_typename)
-    {
-      complain (_("invalid %s declaration"), "%type");
-      return t;
-    }
-
-  name = xstrdup (token_buffer);
-
-  for (;;)
-    {
-      token = lex ();
-
-      switch (token)
-       {
-       case tok_semicolon:
-         return lex ();
-
-       case tok_comma:
-         break;
-
-       case tok_identifier:
-         if (symval->type_name == NULL)
-           symval->type_name = name;
-         else if (strcmp (name, symval->type_name) != 0)
-           complain (_("type redeclaration for %s"), symval->tag);
-
-         break;
-
-       default:
-         return token;
-       }
-    }
-}
-
-#endif

 /*------------------------------------------------------------------.
 | Parse the input grammar into a one symbol_list structure.  Each   |
@@ -1600,44 +1548,6 @@
          if (t == tok_semicolon)
            t = lex ();
        }
-#if 0
-      /* these things can appear as alternatives to rules.  */
-/* NO, they cannot.
-       a) none of the documentation allows them
-       b) most of them scan forward until finding a next %
-               thus they may swallow lots of intervening rules
-*/
-      else if (t == tok_token)
-       {
-         parse_token_decl (token_sym, nterm_sym);
-         t = lex ();
-       }
-      else if (t == tok_nterm)
-       {
-         parse_token_decl (nterm_sym, token_sym);
-         t = lex ();
-       }
-      else if (t == tok_type)
-       {
-         t = get_type ();
-       }
-      else if (t == tok_union)
-       {
-         parse_union_decl ();
-         t = lex ();
-       }
-      else if (t == tok_expect)
-       {
-         parse_expect_decl ();
-         t = lex ();
-       }
-      else if (t == tok_start)
-       {
-         parse_start_decl ();
-         t = lex ();
-       }
-#endif
-
       else
        {
          complain (_("invalid input: %s"), quote (token_buffer));

Pascal Bart (address@hidden)





reply via email to

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