bison-patches
[Top][All Lists]
Advanced

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

15-fyi-simplify-augment.patch


From: Akim Demaille
Subject: 15-fyi-simplify-augment.patch
Date: Mon, 10 Dec 2001 09:36:29 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * src/LR0.c (augment_automaton): Now that all states have shifts,
        merge the two cases addition shifts to the initial state.
        
        
Index: src/LR0.c
--- src/LR0.c Sat, 08 Dec 2001 20:48:59 +0100 akim
+++ src/LR0.c Sat, 08 Dec 2001 20:54:33 +0100 akim
@@ -437,9 +437,9 @@
 static void
 augment_automaton (void)
 {
-  if (!first_shift->nshifts)
+  if (!first_state->shifts->nshifts)
     {
-      /* There are no shifts for any state.  Make one shift, from the
+      /* The first state has no shifts.  Make one shift, from the
         initial state to the next-to-final state.  */
 
       shifts *sp = shifts_new (1);
@@ -454,7 +454,7 @@
          what will be the final state.  */
       insert_start_shifting_state ();
     }
-  else if (first_shift->number == 0)
+  else
     {
       state_t *statep = first_state->next;
       shifts *sp = first_shift;
@@ -543,22 +543,6 @@
             what will be the final state.  */
          insert_start_shifting_state ();
        }
-    }
-  else
-    {
-      /* The initial state didn't even have any shifts.
-        Give it one shift, to the next-to-final state.  */
-      shifts *sp = shifts_new (1);
-      first_state->shifts = sp;
-      sp->shifts[0] = nstates;
-
-      /* Patch sp into the chain of shifts at the beginning.  */
-      sp->next = first_shift;
-      first_shift = sp;
-
-      /* Create the next-to-final state, with shift to
-        what will be the final state.  */
-      insert_start_shifting_state ();
     }
 
   insert_eof_shifting_state ();



reply via email to

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