/[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.44 by akim, Sat Dec 22 14:58:53 2001 UTC revision 1.45 by akim, Thu Dec 27 18:05:05 2001 UTC
# Line 310  static void Line 310  static void
310  add_lookback_edge (int stateno, int ruleno, int gotono)  add_lookback_edge (int stateno, int ruleno, int gotono)
311  {  {
312    int i;    int i;
   int k;  
   int found;  
313    shorts *sp;    shorts *sp;
314    
315    i = state_table[stateno]->lookaheadsp;    for (i = 0; i < state_table[stateno]->nlookaheads; ++i)
316    k = state_table[stateno + 1]->lookaheadsp;      if (LAruleno[state_table[stateno]->lookaheadsp + i] == ruleno)
317    found = 0;        break;
   while (!found && i < k)  
     {  
       if (LAruleno[i] == ruleno)  
         found = 1;  
       else  
         i++;  
     }  
318    
319    assert (found);    assert (LAruleno[state_table[stateno]->lookaheadsp + i] == ruleno);
320    
321    sp = XCALLOC (shorts, 1);    sp = XCALLOC (shorts, 1);
322    sp->next = lookback[i];    sp->next = lookback[state_table[stateno]->lookaheadsp + i];
323    sp->value = gotono;    sp->value = gotono;
324    lookback[i] = sp;    lookback[state_table[stateno]->lookaheadsp + i] = sp;
325  }  }
326    
327    

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

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