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

Diff of /bison/src/conflicts.c

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

revision 1.79 by akim, Tue Jun 11 20:16:05 2002 UTC revision 1.80 by akim, Sat Jun 15 18:23:50 2002 UTC
# Line 256  set_conflicts (state_t *state) Line 256  set_conflicts (state_t *state)
256       check for shift-reduce conflict, and try to resolve using       check for shift-reduce conflict, and try to resolve using
257       precedence */       precedence */
258    for (i = 0; i < state->nlookaheads; ++i)    for (i = 0; i < state->nlookaheads; ++i)
259      if (LArule[state->lookaheadsp + i]->prec      if (state->lookaheads_rule[i]->prec
260          && LArule[state->lookaheadsp + i]->prec->prec          && state->lookaheads_rule[i]->prec->prec
261          && !bitset_disjoint_p (LA[state->lookaheadsp + i], lookaheadset))          && !bitset_disjoint_p (state->lookaheads[i], lookaheadset))
262        {        {
263          resolve_sr_conflict (state, state->lookaheadsp + i);          resolve_sr_conflict (state, (state->lookaheads - LA) + i);
264          break;          break;
265        }        }
266    
# Line 268  set_conflicts (state_t *state) Line 268  set_conflicts (state_t *state)
268       for conflicts not resolved above.  */       for conflicts not resolved above.  */
269    for (i = 0; i < state->nlookaheads; ++i)    for (i = 0; i < state->nlookaheads; ++i)
270      {      {
271        if (!bitset_disjoint_p (LA[state->lookaheadsp + i], lookaheadset))        if (!bitset_disjoint_p (state->lookaheads[i], lookaheadset))
272          conflicts[state->number] = 1;          conflicts[state->number] = 1;
273    
274        bitset_or (lookaheadset, lookaheadset, LA[state->lookaheadsp + i]);        bitset_or (lookaheadset, lookaheadset, state->lookaheads[i]);
275      }      }
276  }  }
277    
# Line 312  count_sr_conflicts (state_t *state) Line 312  count_sr_conflicts (state_t *state)
312        bitset_set (shiftset, SHIFT_SYMBOL (shiftp, i));        bitset_set (shiftset, SHIFT_SYMBOL (shiftp, i));
313    
314    for (i = 0; i < state->nlookaheads; ++i)    for (i = 0; i < state->nlookaheads; ++i)
315      bitset_or (lookaheadset, lookaheadset, LA[state->lookaheadsp + i]);      bitset_or (lookaheadset, lookaheadset, state->lookaheads[i]);
316    
317    bitset_and (lookaheadset, lookaheadset, shiftset);    bitset_and (lookaheadset, lookaheadset, shiftset);
318    
# Line 340  count_rr_conflicts (state_t *state) Line 340  count_rr_conflicts (state_t *state)
340        int count = 0;        int count = 0;
341        int j;        int j;
342        for (j = 0; j < state->nlookaheads; ++j)        for (j = 0; j < state->nlookaheads; ++j)
343          if (bitset_test (LA[state->lookaheadsp + j], i))          if (bitset_test (state->lookaheads[j], i))
344            count++;            count++;
345    
346        if (count >= 2)        if (count >= 2)

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80

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