/[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.55 by akim, Mon Dec 17 17:32:20 2001 UTC revision 1.56 by akim, Mon Dec 17 17:32:58 2001 UTC
# Line 172  set_conflicts (int state) Line 172  set_conflicts (int state)
172    /* Loop over all rules which require lookahead in this state.  First    /* Loop over all rules which require lookahead in this state.  First
173       check for shift-reduce conflict, and try to resolve using       check for shift-reduce conflict, and try to resolve using
174       precedence */       precedence */
175    for (i = state_table[state]->lookaheads;    for (i = state_table[state]->lookaheadsp;
176         i < state_table[state + 1]->lookaheads;         i < state_table[state + 1]->lookaheadsp;
177         ++i)         ++i)
178      if (rule_table[LAruleno[i]].prec)      if (rule_table[LAruleno[i]].prec)
179        for (j = 0; j < tokensetsize; ++j)        for (j = 0; j < tokensetsize; ++j)
# Line 186  set_conflicts (int state) Line 186  set_conflicts (int state)
186    
187    /* Loop over all rules which require lookahead in this state.  Check    /* Loop over all rules which require lookahead in this state.  Check
188       for conflicts not resolved above.  */       for conflicts not resolved above.  */
189    for (i = state_table[state]->lookaheads;    for (i = state_table[state]->lookaheadsp;
190         i < state_table[state + 1]->lookaheads;         i < state_table[state + 1]->lookaheadsp;
191         ++i)         ++i)
192      {      {
193        for (j = 0; j < tokensetsize; ++j)        for (j = 0; j < tokensetsize; ++j)
# Line 237  count_sr_conflicts (int state) Line 237  count_sr_conflicts (int state)
237      if (!SHIFT_IS_DISABLED (shiftp, i))      if (!SHIFT_IS_DISABLED (shiftp, i))
238        SETBIT (shiftset, SHIFT_SYMBOL (shiftp, i));        SETBIT (shiftset, SHIFT_SYMBOL (shiftp, i));
239    
240    for (i = state_table[state]->lookaheads;    for (i = state_table[state]->lookaheadsp;
241         i < state_table[state + 1]->lookaheads;         i < state_table[state + 1]->lookaheadsp;
242         ++i)         ++i)
243      for (k = 0; k < tokensetsize; ++k)      for (k = 0; k < tokensetsize; ++k)
244        lookaheadset[k] |= LA (i)[k];        lookaheadset[k] |= LA (i)[k];
# Line 264  count_rr_conflicts (int state) Line 264  count_rr_conflicts (int state)
264    int i;    int i;
265    int rrc_count = 0;    int rrc_count = 0;
266    
267    int m = state_table[state]->lookaheads;    int m = state_table[state]->lookaheadsp;
268    int n = state_table[state + 1]->lookaheads;    int n = state_table[state + 1]->lookaheadsp;
269    
270    if (n - m < 2)    if (n - m < 2)
271      return 0;      return 0;
# Line 414  print_reductions (FILE *out, int state) Line 414  print_reductions (FILE *out, int state)
414  {  {
415    int i;    int i;
416    int j;    int j;
417    int m = state_table[state]->lookaheads;    int m = state_table[state]->lookaheadsp;
418    int n = state_table[state + 1]->lookaheads;    int n = state_table[state + 1]->lookaheadsp;
419    shifts *shiftp = state_table[state]->shifts;    shifts *shiftp = state_table[state]->shifts;
420    errs *errp = state_table[state]->errs;    errs *errp = state_table[state]->errs;
421    int nodefault = 0;    int nodefault = 0;

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

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