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

Diff of /bison/src/lalr.c

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

revision 1.16.2.20 by akim, Wed Dec 5 09:24:54 2001 UTC revision 1.16.2.21 by akim, Mon Dec 10 08:43:37 2001 UTC
# Line 247  set_goto_map (void) Line 247  set_goto_map (void)
247    
248    ngotos = 0;    ngotos = 0;
249    for (sp = first_shift; sp; sp = sp->next)    for (sp = first_shift; sp; sp = sp->next)
250      for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)      if (sp->nshifts)
251        {        for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)
252          symbol = state_table[sp->shifts[i]].accessing_symbol;          {
253              symbol = state_table[sp->shifts[i]].accessing_symbol;
254          if (ngotos == MAXSHORT)  
255            fatal (_("too many gotos (max %d)"), MAXSHORT);            if (ngotos == MAXSHORT)
256                fatal (_("too many gotos (max %d)"), MAXSHORT);
257          ngotos++;  
258          goto_map[symbol]++;            ngotos++;
259        }            goto_map[symbol]++;
260            }
261    
262    k = 0;    k = 0;
263    for (i = ntokens; i < nsyms; i++)    for (i = ntokens; i < nsyms; i++)
# Line 277  set_goto_map (void) Line 278  set_goto_map (void)
278    for (sp = first_shift; sp; sp = sp->next)    for (sp = first_shift; sp; sp = sp->next)
279      {      {
280        state1 = sp->number;        state1 = sp->number;
281        for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)        if (sp->nshifts)
282          {          for (i = sp->nshifts - 1; i >= 0 && SHIFT_IS_GOTO (sp, i); --i)
283            state2 = sp->shifts[i];            {
284            symbol = state_table[state2].accessing_symbol;              state2 = sp->shifts[i];
285                symbol = state_table[state2].accessing_symbol;
286            k = temp_map[symbol]++;  
287            from_state[k] = state1;              k = temp_map[symbol]++;
288            to_state[k] = state2;              from_state[k] = state1;
289          }              to_state[k] = state2;
290              }
291      }      }
292    
293    XFREE (temp_map + ntokens);    XFREE (temp_map + ntokens);

Legend:
Removed from v.1.16.2.20  
changed lines
  Added in v.1.16.2.21

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