]> git.saurik.com Git - bison.git/blobdiff - src/state.c
Add nls.m4, po.m4.
[bison.git] / src / state.c
index 3afe46cfd004efe850c71d75fb8f672d9949bda6..e6d15f2a4291da03fe6fab73f2a36abd2f1438bd 100644 (file)
@@ -1,6 +1,6 @@
 /* Type definitions for nondeterministic finite state machine for Bison.
 
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 
@@ -49,17 +49,17 @@ transitions_new (int num, state **the_states)
 }
 
 
-/*-------------------------------------------------------------------.
-| Return the state such these TRANSITIONS contain a shift/goto to it |
-| on S.  Abort if none found.                                        |
-`-------------------------------------------------------------------*/
+/*-------------------------------------------------------.
+| Return the state such that SHIFTS contain a shift/goto |
+| to it on SYM.  Abort if none found.                    |
+`-------------------------------------------------------*/
 
 state *
-transitions_to (transitions *shifts, symbol_number s)
+transitions_to (transitions *shifts, symbol_number sym)
 {
   int j;
   for (j = 0; j < shifts->num; j++)
-    if (TRANSITION_SYMBOL (shifts, j) == s)
+    if (TRANSITION_SYMBOL (shifts, j) == sym)
       return shifts->states[j];
   abort ();
 }
@@ -236,12 +236,13 @@ state_rule_lookaheads_print (state *s, rule *r, FILE *out)
     {
       bitset_iterator biter;
       int k;
-      int not_first = 0;
+      char const *sep = "";
       fprintf (out, "  [");
       BITSET_FOR_EACH (biter, reds->lookaheads[red], k, 0)
-       fprintf (out, "%s%s",
-                not_first++ ? ", " : "",
-                symbols[k]->tag);
+       {
+         fprintf (out, "%s%s", sep, symbols[k]->tag);
+         sep = ", ";
+       }
       fprintf (out, "]");
     }
 }