/[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.81 by akim, Sun Jun 30 17:33:37 2002 UTC revision 1.82 by akim, Sun Jun 30 17:34:31 2002 UTC
# Line 178  print_errs (FILE *out, state_t *state) Line 178  print_errs (FILE *out, state_t *state)
178    int i;    int i;
179    
180    /* Compute the width of the lookaheads column.  */    /* Compute the width of the lookaheads column.  */
181    for (i = 0; i < errp->nerrs; ++i)    for (i = 0; i < errp->num; ++i)
182      if (errp->errs[i])      if (errp->symbols[i])
183        max_length (&width, symbol_tag_get (symbols[errp->errs[i]]));        max_length (&width, symbol_tag_get (symbols[errp->symbols[i]]));
184    
185    /* Nothing to report. */    /* Nothing to report. */
186    if (!width)    if (!width)
# Line 190  print_errs (FILE *out, state_t *state) Line 190  print_errs (FILE *out, state_t *state)
190    width += 2;    width += 2;
191    
192    /* Report lookaheads and errors.  */    /* Report lookaheads and errors.  */
193    for (i = 0; i < errp->nerrs; ++i)    for (i = 0; i < errp->num; ++i)
194      if (errp->errs[i])      if (errp->symbols[i])
195        {        {
196          const char *tag = symbol_tag_get (symbols[errp->errs[i]]);          const char *tag = symbol_tag_get (symbols[errp->symbols[i]]);
197          int j;          int j;
198          fprintf (out, "    %s", tag);          fprintf (out, "    %s", tag);
199          for (j = width - strlen (tag); j > 0; --j)          for (j = width - strlen (tag); j > 0; --j)
# Line 240  state_default_rule (state_t *state) Line 240  state_default_rule (state_t *state)
240       we raise an error (due to %nonassoc).  */       we raise an error (due to %nonassoc).  */
241    {    {
242      errs_t *errp = state->errs;      errs_t *errp = state->errs;
243      for (i = 0; i < errp->nerrs; i++)      for (i = 0; i < errp->num; i++)
244        if (errp->errs[i])        if (errp->symbols[i])
245          bitset_set (shiftset, errp->errs[i]);          bitset_set (shiftset, errp->symbols[i]);
246    }    }
247    
248    for (i = 0; i < state->nlookaheads; ++i)    for (i = 0; i < state->nlookaheads; ++i)
# Line 308  print_reductions (FILE *out, state_t *st Line 308  print_reductions (FILE *out, state_t *st
308    size_t width = 0;    size_t width = 0;
309    int i, j;    int i, j;
310    
311    if (redp->nreds == 0)    if (redp->num == 0)
312      return;      return;
313    
314    default_rule = state_default_rule (state);    default_rule = state_default_rule (state);
# Line 398  print_actions (FILE *out, state_t *state Line 398  print_actions (FILE *out, state_t *state
398    reductions_t *redp = state->reductions;    reductions_t *redp = state->reductions;
399    transitions_t *transitions = state->shifts;    transitions_t *transitions = state->shifts;
400    
401    if (transitions->num == 0 && redp->nreds == 0)    if (transitions->num == 0 && redp->num == 0)
402      {      {
403        fputc ('\n', out);        fputc ('\n', out);
404        if (state->number == final_state->number)        if (state->number == final_state->number)

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82

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