From: Akim Demaille <akim@epita.fr>
Date: Mon, 10 Dec 2001 09:10:10 +0000 (+0000)
Subject: * src/state.h (shifts): Remove the `number' member: shifts are
X-Git-Tag: before-m4-back-end~159
X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/0279f8e90cf43a9b07516caefa89fe2aa8cea8bb?ds=inline

* src/state.h (shifts): Remove the `number' member: shifts are
attached to state, hence no longer need to be labelled with a
state number.
---

diff --git a/ChangeLog b/ChangeLog
index 1df9c0a2..e108638d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-12-10  Akim Demaille  <akim@epita.fr>
+
+	* src/state.h (shifts): Remove the `number' member: shifts are
+	attached to state, hence no longer need to be labelled with a
+	state number.
+
+	
 2001-12-10  Akim Demaille  <akim@epita.fr>
 
 	Now that states have a complete set of members, the linked list of
diff --git a/src/LR0.c b/src/LR0.c
index 4ea292a9..d3f099b6 100644
--- a/src/LR0.c
+++ b/src/LR0.c
@@ -316,8 +316,6 @@ static void
 save_shifts (void)
 {
   shifts *p = shifts_new (nshifts);
-
-  p->number = this_state->number;
   shortcpy (p->shifts, shiftset, nshifts);
   this_state->shifts = p;
 }
@@ -339,7 +337,7 @@ insert_start_shifting_state (void)
   shifts *sp;
 
   statep = STATE_ALLOC (0);
-  statep->number = nstates;
+  statep->number = nstates++;
 
   /* The distinctive feature of this state from the
      eof_shifting_state, is that it is labeled as post-start-symbol
@@ -354,7 +352,6 @@ insert_start_shifting_state (void)
   /* Make a shift from this state to (what will be) the final state.  */
   sp = shifts_new (1);
   statep->shifts = sp;
-  sp->number = nstates++;
   sp->shifts[0] = nstates;
 }
 
@@ -375,7 +372,7 @@ insert_eof_shifting_state (void)
      next-to-final state.
      The symbol for that shift is 0 (end-of-file).  */
   statep = STATE_ALLOC (0);
-  statep->number = nstates;
+  statep->number = nstates++;
 
   last_state->next = statep;
   last_state = statep;
@@ -383,7 +380,6 @@ insert_eof_shifting_state (void)
   /* Make the shift from the final state to the termination state.  */
   sp = shifts_new (1);
   statep->shifts = sp;
-  sp->number = nstates++;
   sp->shifts[0] = nstates;
 }
 
@@ -459,7 +455,6 @@ augment_automaton (void)
 	  shifts *sp = statep->shifts;
 
 	  shifts *sp1 = shifts_new (sp->nshifts + 1);
-	  sp1->number = statep->number;
 	  statep->shifts = sp1;
 	  sp1->shifts[0] = nstates;
 	  for (i = sp->nshifts; i > 0; i--)
diff --git a/src/state.h b/src/state.h
index f7244b4b..de7ec08c 100644
--- a/src/state.h
+++ b/src/state.h
@@ -95,7 +95,6 @@
 
 typedef struct shifts
 {
-  short number;
   short nshifts;
   short shifts[1];
 } shifts;