/[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.63 by akim, Mon Apr 22 08:21:54 2002 UTC revision 1.64 by akim, Sun May 5 11:56:49 2002 UTC
# Line 105  print_core (FILE *out, state_t *state) Line 105  print_core (FILE *out, state_t *state)
105            for (/* Nothing */; *sp >= 0; ++sp)            for (/* Nothing */; *sp >= 0; ++sp)
106              fprintf (out, " %s", escape (symbols[*sp]->tag));              fprintf (out, " %s", escape (symbols[*sp]->tag));
107    
108              /* Experimental feature: display the lookaheads. */
109              if (trace_flag && state->nlookaheads)
110                {
111                  int j, k;
112                  int nlookaheads = 0;
113                  /* Look for lookaheads corresponding to this rule. */
114                  for (j = 0; j < state->nlookaheads; ++j)
115                    for (k = 0; k < ntokens; ++k)
116                      if (bitset_test (LA[state->lookaheadsp + j], k)
117                          && LArule[state->lookaheadsp + j]->number == rule)
118                        nlookaheads++;
119                  if (nlookaheads)
120                    {
121                      fprintf (out, "  [");
122                      for (j = 0; j < state->nlookaheads; ++j)
123                        for (k = 0; k < ntokens; ++k)
124                          if (bitset_test (LA[state->lookaheadsp + j], k)
125                              && LArule[state->lookaheadsp + j]->number == rule)
126                            fprintf (out, "%s%s",
127                                     quotearg_style (escape_quoting_style,
128                                                     symbols[k]->tag),
129                                     --nlookaheads ? ", " : "");
130                      fprintf (out, "]");
131                    }
132                }
133    
134            fprintf (out, _("   (rule %d)"), rule - 1);            fprintf (out, _("   (rule %d)"), rule - 1);
135            fputc ('\n', out);            fputc ('\n', out);
136          }          }

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64

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