/[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.43 by akim, Wed Dec 5 09:30:42 2001 UTC revision 1.44 by akim, Wed Dec 5 09:30:56 2001 UTC
# Line 567  print_reductions (FILE *out, int state) Line 567  print_reductions (FILE *out, int state)
567    else if (n - m >= 1)    else if (n - m >= 1)
568      {      {
569        unsigned *fp1, *fp2, *fp3, *fp4;        unsigned *fp1, *fp2, *fp3, *fp4;
570          int k;
571    
572        cmax = 0;        cmax = 0;
573        default_LA = -1;        default_LA = -1;
# Line 575  print_reductions (FILE *out, int state) Line 576  print_reductions (FILE *out, int state)
576        if (!nodefault)        if (!nodefault)
577          for (i = m; i < n; i++)          for (i = m; i < n; i++)
578            {            {
579              fp1 = LA (i);              for (k = 0; k < tokensetsize; ++k)
580              fp2 = shiftset;                lookaheadset[k] = LA (i)[k] & ~shiftset[k];
             fp3 = lookaheadset;  
   
             while (fp3 < fp4)  
               *fp3++ = *fp1++ & (~(*fp2++));  
581    
582              count = 0;              count = 0;
             mask = 1;  
             fp3 = lookaheadset;  
583              for (j = 0; j < ntokens; j++)              for (j = 0; j < ntokens; j++)
584                {                if (BITISSET (lookaheadset, j))
585                  if (mask & *fp3)                  count++;
                   count++;  
   
                 mask <<= 1;  
                 if (mask == 0)  
                   {  
                     mask = 1;  
                     fp3++;  
                   }  
               }  
586    
587              if (count > cmax)              if (count > cmax)
588                {                {
# Line 616  print_reductions (FILE *out, int state) Line 602  print_reductions (FILE *out, int state)
602          shiftset[i] = 0;          shiftset[i] = 0;
603    
604        if (shiftp)        if (shiftp)
605          {          for (i = 0; i < shiftp->nshifts; i++)
606            for (i = 0; i < shiftp->nshifts; i++)            {
607              {              if (!shiftp->shifts[i])
608                if (!shiftp->shifts[i])                continue;
609                  continue;              symbol = state_table[shiftp->shifts[i]].accessing_symbol;
610                symbol = state_table[shiftp->shifts[i]].accessing_symbol;              if (ISVAR (symbol))
611                if (ISVAR (symbol))                break;
612                  break;              SETBIT (shiftset, symbol);
613                SETBIT (shiftset, symbol);            }
             }  
         }  
614    
615        mask = 1;        mask = 1;
616        fp1 = LA (m);        fp1 = LA (m);

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

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