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

Diff of /bison/src/print.c

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

revision 1.27 by akim, Mon Nov 19 10:28:43 2001 UTC revision 1.28 by akim, Mon Nov 19 10:39:35 2001 UTC
# Line 87  print_actions (FILE *out, int state) Line 87  print_actions (FILE *out, int state)
87  {  {
88    int i;    int i;
89    int k;    int k;
90    int state1;  
91    int symbol;    shifts   *shiftp = state_table[state].shift_table;
92    shifts *shiftp;    reductions *redp = state_table[state].reduction_table;
93    errs *errp;    errs       *errp = err_table[state];
   reductions *redp;  
   int rule;  
   
   shiftp = state_table[state].shift_table;  
   redp = state_table[state].reduction_table;  
   errp = err_table[state];  
94    
95    if (!shiftp && !redp)    if (!shiftp && !redp)
96      {      {
# Line 113  print_actions (FILE *out, int state) Line 107  print_actions (FILE *out, int state)
107    
108        for (i = 0; i < k; i++)        for (i = 0; i < k; i++)
109          {          {
110            if (!shiftp->shifts[i])            int symbol;
111              int state1 = shiftp->shifts[i];
112              if (!state1)
113              continue;              continue;
           state1 = shiftp->shifts[i];  
114            symbol = state_table[state1].accessing_symbol;            symbol = state_table[state1].accessing_symbol;
115            /* The following line used to be turned off.  */            /* The following line used to be turned off.  */
116            if (ISVAR (symbol))            if (ISVAR (symbol))
# Line 140  print_actions (FILE *out, int state) Line 135  print_actions (FILE *out, int state)
135    
136    if (errp)    if (errp)
137      {      {
138        int j, nerrs;        int j;
139          for (j = 0; j < errp->nerrs; j++)
       nerrs = errp->nerrs;  
   
       for (j = 0; j < nerrs; j++)  
140          {          {
141            if (!errp->errs[j])            int symbol = errp->errs[j];
142              if (!symbol)
143              continue;              continue;
           symbol = errp->errs[j];  
144            fprintf (out, _("    %-4s\terror (nonassociative)\n"),            fprintf (out, _("    %-4s\terror (nonassociative)\n"),
145                     tags[symbol]);                     tags[symbol]);
146          }          }
# Line 159  print_actions (FILE *out, int state) Line 151  print_actions (FILE *out, int state)
151    
152    if (state_table[state].consistent && redp)    if (state_table[state].consistent && redp)
153      {      {
154        rule = redp->rules[0];        int rule = redp->rules[0];
155        symbol = rule_table[rule].lhs;        int symbol = rule_table[rule].lhs;
156        fprintf (out, _("    $default\treduce using rule %d (%s)\n\n"),        fprintf (out, _("    $default\treduce using rule %d (%s)\n\n"),
157                 rule, tags[symbol]);                 rule, tags[symbol]);
158      }      }
# Line 173  print_actions (FILE *out, int state) Line 165  print_actions (FILE *out, int state)
165      {      {
166        for (; i < k; i++)        for (; i < k; i++)
167          {          {
168            if (!shiftp->shifts[i])            int symbol;
169              int state1 = shiftp->shifts[i];
170              if (!state1)
171              continue;              continue;
           state1 = shiftp->shifts[i];  
172            symbol = state_table[state1].accessing_symbol;            symbol = state_table[state1].accessing_symbol;
173            fprintf (out, _("    %-4s\tgo to state %d\n"),            fprintf (out, _("    %-4s\tgo to state %d\n"),
174                     tags[symbol], state1);                     tags[symbol], state1);

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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