/[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.68 by akim, Mon Mar 4 12:04:33 2002 UTC revision 1.69 by akim, Mon Mar 4 12:05:30 2002 UTC
# Line 186  set_conflicts (state_t *state) Line 186  set_conflicts (state_t *state)
186       for conflicts not resolved above.  */       for conflicts not resolved above.  */
187    for (i = 0; i < state->nlookaheads; ++i)    for (i = 0; i < state->nlookaheads; ++i)
188      {      {
189          /* FIXME: Here, I need something like `bitset_disjoint_p'. */
190        for (j = 0; j < ntokens; ++j)        for (j = 0; j < ntokens; ++j)
191          if (bitset_test (LA[state->lookaheadsp + i], j)          if (bitset_test (LA[state->lookaheadsp + i], j)
192              && bitset_test (lookaheadset, j))              && bitset_test (lookaheadset, j))
193            conflicts[state->number] = 1;            conflicts[state->number] = 1;
194    
195        for (j = 0; j < ntokens; ++j)        bitset_or (lookaheadset, lookaheadset, LA[state->lookaheadsp + i]);
         if (bitset_test (LA[state->lookaheadsp + i], j))  
           bitset_set (lookaheadset, j);  
196      }      }
197  }  }
198    
# Line 220  solve_conflicts (void) Line 219  solve_conflicts (void)
219  static int  static int
220  count_sr_conflicts (state_t *state)  count_sr_conflicts (state_t *state)
221  {  {
222    int i, k;    int i;
223    int src_count = 0;    int src_count = 0;
224    shifts *shiftp = state->shifts;    shifts *shiftp = state->shifts;
225    
# Line 235  count_sr_conflicts (state_t *state) Line 234  count_sr_conflicts (state_t *state)
234        bitset_set (shiftset, SHIFT_SYMBOL (shiftp, i));        bitset_set (shiftset, SHIFT_SYMBOL (shiftp, i));
235    
236    for (i = 0; i < state->nlookaheads; ++i)    for (i = 0; i < state->nlookaheads; ++i)
237      for (k = 0; k < ntokens; ++k)      bitset_or (lookaheadset, lookaheadset, LA[state->lookaheadsp + i]);
       if (bitset_test (LA[state->lookaheadsp + i], k))  
         bitset_set (lookaheadset, k);  
238    
239    bitset_and (lookaheadset, lookaheadset, shiftset);    bitset_and (lookaheadset, lookaheadset, shiftset);
240    

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69

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