/[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.40 by akim, Fri Nov 30 10:49:01 2001 UTC revision 1.41 by akim, Wed Dec 5 09:30:13 2001 UTC
# Line 502  print_reductions (FILE *out, int state) Line 502  print_reductions (FILE *out, int state)
502  {  {
503    int i;    int i;
504    int j;    int j;
   int k;  
   unsigned *fp1;  
   unsigned *fp2;  
   unsigned *fp3;  
   unsigned *fp4;  
505    int rule;    int rule;
506    int symbol;    int symbol;
507    unsigned mask;    unsigned mask;
# Line 525  print_reductions (FILE *out, int state) Line 520  print_reductions (FILE *out, int state)
520    
521    shiftp = state_table[state].shift_table;    shiftp = state_table[state].shift_table;
522    if (shiftp)    if (shiftp)
523      {      for (i = 0; i < shiftp->nshifts; i++)
524        k = shiftp->nshifts;        {
525        for (i = 0; i < k; i++)          if (!shiftp->shifts[i])
526          {            continue;
527            if (!shiftp->shifts[i])          symbol = state_table[shiftp->shifts[i]].accessing_symbol;
528              continue;          if (ISVAR (symbol))
529            symbol = state_table[shiftp->shifts[i]].accessing_symbol;            break;
530            if (ISVAR (symbol))          /* if this state has a shift for the error token,
531              break;             don't use a default rule.  */
532            /* if this state has a shift for the error token,          if (symbol == error_token_number)
533               don't use a default rule.  */            nodefault = 1;
534            if (symbol == error_token_number)          SETBIT (shiftset, symbol);
535              nodefault = 1;        }
           SETBIT (shiftset, symbol);  
         }  
     }  
536    
537    errp = err_table[state];    errp = err_table[state];
538    if (errp)    if (errp)
539      {      {
540        k = errp->nerrs;        for (i = 0; i < errp->nerrs; i++)
       for (i = 0; i < k; i++)  
541          {          {
542            if (!errp->errs[i])            if (!errp->errs[i])
543              continue;              continue;
# Line 560  print_reductions (FILE *out, int state) Line 551  print_reductions (FILE *out, int state)
551    
552    if (n - m == 1 && !nodefault)    if (n - m == 1 && !nodefault)
553      {      {
554        default_rule = LAruleno[m];        unsigned *fp1 = LA (m);
555          unsigned *fp2 = shiftset;
556          unsigned *fp3 = lookaheadset;
557          unsigned *fp4 = lookaheadset + tokensetsize;
558    
559        fp1 = LA (m);        default_rule = LAruleno[m];
       fp2 = shiftset;  
       fp3 = lookaheadset;  
       fp4 = lookaheadset + tokensetsize;  
560    
561        while (fp3 < fp4)        while (fp3 < fp4)
562          *fp3++ = *fp1++ & *fp2++;          *fp3++ = *fp1++ & *fp2++;
# Line 593  print_reductions (FILE *out, int state) Line 584  print_reductions (FILE *out, int state)
584      }      }
585    else if (n - m >= 1)    else if (n - m >= 1)
586      {      {
587          unsigned *fp1, *fp2, *fp3, *fp4;
588    
589        cmax = 0;        cmax = 0;
590        default_LA = -1;        default_LA = -1;
591        fp4 = lookaheadset + tokensetsize;        fp4 = lookaheadset + tokensetsize;
# Line 642  print_reductions (FILE *out, int state) Line 635  print_reductions (FILE *out, int state)
635    
636        if (shiftp)        if (shiftp)
637          {          {
638            k = shiftp->nshifts;            for (i = 0; i < shiftp->nshifts; i++)
           for (i = 0; i < k; i++)  
639              {              {
640                if (!shiftp->shifts[i])                if (!shiftp->shifts[i])
641                  continue;                  continue;

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

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