/[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.45 by akim, Thu Dec 27 18:05:30 2001 UTC revision 1.46 by akim, Thu Dec 27 18:10:48 2001 UTC
# Line 541  save_reductions (void) Line 541  save_reductions (void)
541  static void  static void
542  set_state_table (void)  set_state_table (void)
543  {  {
544      state_t *sp;
545    state_table = XCALLOC (state_t *, nstates);    state_table = XCALLOC (state_t *, nstates);
546    
547    {    for (sp = first_state; sp; sp = sp->next)
548      state_t *sp;      {
549      for (sp = first_state; sp; sp = sp->next)        /* Pessimization, but simplification of the code: make sure all
550        state_table[sp->number] = sp;           the states have a shifts and errs, even if reduced to 0.  */
551    }        if (!sp->shifts)
552            sp->shifts = shifts_new (0);
553          if (!sp->errs)
554            sp->errs = errs_new (0);
555    
556    /* Pessimization, but simplification of the code: make sure all the        state_table[sp->number] = sp;
557       states have a shifts, even if reduced to 0 shifts.  */      }
   {  
     int i;  
     for (i = 0; i < nstates; i++)  
       if (!state_table[i]->shifts)  
         state_table[i]->shifts = shifts_new (0);  
   }  
558  }  }
559    
560  /*-------------------------------------------------------------------.  /*-------------------------------------------------------------------.

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

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