/[bison]/bison/src/LR0.c
ViewVC logotype

Diff of /bison/src/LR0.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by akim, Mon Dec 10 09:09:49 2001 UTC revision 1.43 by akim, Mon Dec 10 09:10:10 2001 UTC
# Line 316  static void Line 316  static void
316  save_shifts (void)  save_shifts (void)
317  {  {
318    shifts *p = shifts_new (nshifts);    shifts *p = shifts_new (nshifts);
   
   p->number = this_state->number;  
319    shortcpy (p->shifts, shiftset, nshifts);    shortcpy (p->shifts, shiftset, nshifts);
320    this_state->shifts = p;    this_state->shifts = p;
321  }  }
# Line 339  insert_start_shifting_state (void) Line 337  insert_start_shifting_state (void)
337    shifts *sp;    shifts *sp;
338    
339    statep = STATE_ALLOC (0);    statep = STATE_ALLOC (0);
340    statep->number = nstates;    statep->number = nstates++;
341    
342    /* The distinctive feature of this state from the    /* The distinctive feature of this state from the
343       eof_shifting_state, is that it is labeled as post-start-symbol       eof_shifting_state, is that it is labeled as post-start-symbol
# Line 354  insert_start_shifting_state (void) Line 352  insert_start_shifting_state (void)
352    /* Make a shift from this state to (what will be) the final state.  */    /* Make a shift from this state to (what will be) the final state.  */
353    sp = shifts_new (1);    sp = shifts_new (1);
354    statep->shifts = sp;    statep->shifts = sp;
   sp->number = nstates++;  
355    sp->shifts[0] = nstates;    sp->shifts[0] = nstates;
356  }  }
357    
# Line 375  insert_eof_shifting_state (void) Line 372  insert_eof_shifting_state (void)
372       next-to-final state.       next-to-final state.
373       The symbol for that shift is 0 (end-of-file).  */       The symbol for that shift is 0 (end-of-file).  */
374    statep = STATE_ALLOC (0);    statep = STATE_ALLOC (0);
375    statep->number = nstates;    statep->number = nstates++;
376    
377    last_state->next = statep;    last_state->next = statep;
378    last_state = statep;    last_state = statep;
# Line 383  insert_eof_shifting_state (void) Line 380  insert_eof_shifting_state (void)
380    /* Make the shift from the final state to the termination state.  */    /* Make the shift from the final state to the termination state.  */
381    sp = shifts_new (1);    sp = shifts_new (1);
382    statep->shifts = sp;    statep->shifts = sp;
   sp->number = nstates++;  
383    sp->shifts[0] = nstates;    sp->shifts[0] = nstates;
384  }  }
385    
# Line 459  augment_automaton (void) Line 455  augment_automaton (void)
455            shifts *sp = statep->shifts;            shifts *sp = statep->shifts;
456    
457            shifts *sp1 = shifts_new (sp->nshifts + 1);            shifts *sp1 = shifts_new (sp->nshifts + 1);
           sp1->number = statep->number;  
458            statep->shifts = sp1;            statep->shifts = sp1;
459            sp1->shifts[0] = nstates;            sp1->shifts[0] = nstates;
460            for (i = sp->nshifts; i > 0; i--)            for (i = sp->nshifts; i > 0; i--)

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26