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

Diff of /bison/src/output.c

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

revision 1.39.2.14 by akim, Wed Dec 5 09:21:55 2001 UTC revision 1.39.2.15 by akim, Wed Dec 5 09:22:14 2001 UTC
# Line 529  action_row (int state) Line 529  action_row (int state)
529    int k;    int k;
530    int m = 0;    int m = 0;
531    int n = 0;    int n = 0;
   int count;  
532    int default_rule;    int default_rule;
533    int nreds;    int nreds;
   int max;  
534    int rule;    int rule;
535    int shift_state;    int shift_state;
536    int symbol;    int symbol;
   unsigned mask;  
   unsigned *wordp;  
537    reductions *redp;    reductions *redp;
538    shifts *shiftp;    shifts *shiftp;
539    errs *errp;    errs *errp;
# Line 562  action_row (int state) Line 558  action_row (int state)
558            n = state_table[state + 1].lookaheads;            n = state_table[state + 1].lookaheads;
559    
560            for (i = n - 1; i >= m; i--)            for (i = n - 1; i >= m; i--)
561              {              /* and find each token which the rule finds acceptable
562                rule = -LAruleno[i];                 to come next */
563                wordp = LA (i);              for (j = 0; j < ntokens; j++)
564                mask = 1;                /* and record this rule as the rule to use if that
565                     token follows.  */
566                /* and find each token which the rule finds acceptable                if (BITISSET (LA (i), j))
567                   to come next */                  actrow[j] = -LAruleno[i];
               for (j = 0; j < ntokens; j++)  
                 {  
                   /* and record this rule as the rule to use if that  
                      token follows.  */  
                   if (mask & *wordp)  
                     actrow[j] = rule;  
   
                   mask <<= 1;  
                   if (mask == 0)  
                     {  
                       mask = 1;  
                       wordp++;  
                     }  
                 }  
             }  
568          }          }
569      }      }
570    
# Line 591  action_row (int state) Line 572  action_row (int state)
572       them, record the shift as the thing to do.  So shift is preferred       them, record the shift as the thing to do.  So shift is preferred
573       to reduce.  */       to reduce.  */
574    shiftp = state_table[state].shift_table;    shiftp = state_table[state].shift_table;
   
575    for (i = 0; i < shiftp->nshifts; i++)    for (i = 0; i < shiftp->nshifts; i++)
576      {      {
577        shift_state = shiftp->shifts[i];        shift_state = shiftp->shifts[i];
# Line 635  action_row (int state) Line 615  action_row (int state)
615          default_rule = redp->rules[0];          default_rule = redp->rules[0];
616        else        else
617          {          {
618            max = 0;            int max = 0;
619            for (i = m; i < n; i++)            for (i = m; i < n; i++)
620              {              {
621                count = 0;                int count = 0;
622                rule = -LAruleno[i];                rule = -LAruleno[i];
623    
624                for (j = 0; j < ntokens; j++)                for (j = 0; j < ntokens; j++)

Legend:
Removed from v.1.39.2.14  
changed lines
  Added in v.1.39.2.15

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