/[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.31 by akim, Fri Nov 30 10:49:24 2001 UTC revision 1.32 by akim, Wed Dec 5 09:34:55 2001 UTC
# Line 86  static void Line 86  static void
86  print_actions (FILE *out, int state)  print_actions (FILE *out, int state)
87  {  {
88    int i;    int i;
   int k;  
89    
90    shifts   *shiftp = state_table[state].shift_table;    shifts   *shiftp = state_table[state].shift_table;
91    reductions *redp = state_table[state].reduction_table;    reductions *redp = state_table[state].reduction_table;
92    errs       *errp = err_table[state];    errs       *errp = err_table[state];
93    
94    if (!shiftp && !redp)    if (!shiftp->nshifts && !redp)
95      {      {
96        if (final_state == state)        if (final_state == state)
97          fprintf (out, _("    $default\taccept\n"));          fprintf (out, _("    $default\taccept\n"));
# Line 101  print_actions (FILE *out, int state) Line 100  print_actions (FILE *out, int state)
100        return;        return;
101      }      }
102    
103    if (shiftp)    for (i = 0; i < shiftp->nshifts; i++)
104      {      if (!SHIFT_IS_DISABLED (shiftp, i))
105        k = shiftp->nshifts;        {
106            int state1 = shiftp->shifts[i];
107        for (i = 0; i < k; i++)          int symbol = state_table[state1].accessing_symbol;
108          {          /* The following line used to be turned off.  */
109            int symbol;          if (ISVAR (symbol))
110            int state1 = shiftp->shifts[i];            break;
111            if (!state1)          if (symbol == 0)        /* I.e. strcmp(tags[symbol],"$")==0 */
112              continue;            fprintf (out,
113            symbol = state_table[state1].accessing_symbol;                     _("    $   \tgo to state %d\n"), state1);
114            /* The following line used to be turned off.  */          else
115            if (ISVAR (symbol))            fprintf (out,
116              break;                     _("    %-4s\tshift, and go to state %d\n"),
117            if (symbol == 0)      /* I.e. strcmp(tags[symbol],"$")==0 */                     tags[symbol], state1);
118              fprintf (out,        }
                      _("    $   \tgo to state %d\n"), state1);  
           else  
             fprintf (out,  
                      _("    %-4s\tshift, and go to state %d\n"),  
                      tags[symbol], state1);  
         }  
119    
120        if (i > 0)    if (i > 0)
121          fputc ('\n', out);      fputc ('\n', out);
     }  
   else  
     {  
       i = 0;  
       k = 0;  
     }  
122    
123    if (errp)    if (errp)
124      {      {
# Line 161  print_actions (FILE *out, int state) Line 148  print_actions (FILE *out, int state)
148        print_reductions (out, state);        print_reductions (out, state);
149      }      }
150    
151    if (i < k)    if (i < shiftp->nshifts)
152      {      {
153        for (; i < k; i++)        for (; i < shiftp->nshifts; i++)
154          {          if (!SHIFT_IS_DISABLED (shiftp, i))
155            int symbol;            {
156            int state1 = shiftp->shifts[i];              int state1 = shiftp->shifts[i];
157            if (!state1)              int symbol = state_table[state1].accessing_symbol;
158              continue;              fprintf (out, _("    %-4s\tgo to state %d\n"),
159            symbol = state_table[state1].accessing_symbol;                       tags[symbol], state1);
160            fprintf (out, _("    %-4s\tgo to state %d\n"),            }
                    tags[symbol], state1);  
         }  
161    
162        fputc ('\n', out);        fputc ('\n', out);
163      }      }

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

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