bison-patches
[Top][All Lists]
Advanced

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

17-fyi-maxrhs.patch


From: Akim Demaille
Subject: 17-fyi-maxrhs.patch
Date: Mon, 19 Nov 2001 10:03:02 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
        (maxrhs): this new function.

Index: src/lalr.c
--- src/lalr.c Fri, 16 Nov 2001 00:09:09 +0100 akim
+++ src/lalr.c Fri, 16 Nov 2001 00:13:09 +0100 akim
@@ -1,5 +1,5 @@
 /* Compute look-ahead criteria for bison,
-   Copyright 1984, 1986, 1989, 2000 Free Software Foundation, Inc.
+   Copyright 1984, 1986, 1989, 2000, 2001  Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -48,7 +48,6 @@
 extern void berror PARAMS ((const char *));
 
 static int infinity;
-static int maxrhs;
 static int ngotos;
 
 /* And for the famous F variable, which named is so descriptive that a
@@ -213,8 +212,9 @@
 }
 
 
-static void
-set_maxrhs (void)
+/* Return the size of the longest ride hand side of the rules. */
+static size_t
+maxrhs (void)
 {
   short *itemp;
   int length;
@@ -236,7 +236,7 @@
        }
     }
 
-  maxrhs = max;
+  return max;
 }
 
 
@@ -547,7 +547,7 @@
 
   includes = XCALLOC (short *, ngotos);
   edge = XCALLOC (short, ngotos + 1);
-  states = XCALLOC (short, maxrhs + 1);
+  states = XCALLOC (short, maxrhs () + 1);
 
   for (i = 0; i < ngotos; i++)
     {
@@ -673,7 +673,6 @@
   tokensetsize = WORDSIZE (ntokens);
 
   set_state_table ();
-  set_maxrhs ();
   initialize_LA ();
   set_goto_map ();
   initialize_F ();



reply via email to

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