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

Diff of /bison/src/state.c

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

revision 1.12 by akim, Sun Jun 30 17:31:37 2002 UTC revision 1.13 by akim, Sun Jun 30 17:32:17 2002 UTC
# Line 198  state_rule_lookaheads_print (state_t *st Line 198  state_rule_lookaheads_print (state_t *st
198    int nlookaheads = 0;    int nlookaheads = 0;
199    /* Count the number of lookaheads corresponding to this rule.  */    /* Count the number of lookaheads corresponding to this rule.  */
200    for (j = 0; j < state->nlookaheads; ++j)    for (j = 0; j < state->nlookaheads; ++j)
201      for (k = 0; k < ntokens; ++k)      BITSET_EXECUTE (state->lookaheads[j], 0, k,
202        if (bitset_test (state->lookaheads[j], k)      {
203            && state->lookaheads_rule[j]->number == rule->number)        if (state->lookaheads_rule[j]->number == rule->number)
204          nlookaheads++;          nlookaheads++;
205        });
206    
207    /* Print them if there are.  */    /* Print them if there are.  */
208    if (nlookaheads)    if (nlookaheads)
209      {      {
210        fprintf (out, "  [");        fprintf (out, "  [");
211        for (j = 0; j < state->nlookaheads; ++j)        for (j = 0; j < state->nlookaheads; ++j)
212          for (k = 0; k < ntokens; ++k)          BITSET_EXECUTE (state->lookaheads[j], 0, k,
213            if (bitset_test (state->lookaheads[j], k)          {
214                && state->lookaheads_rule[j]->number == rule->number)            if (state->lookaheads_rule[j]->number == rule->number)
215              fprintf (out, "%s%s",              fprintf (out, "%s%s",
216                       symbol_tag_get (symbols[k]),                       symbol_tag_get (symbols[k]),
217                       --nlookaheads ? ", " : "");                       --nlookaheads ? ", " : "");
218            });
219        fprintf (out, "]");        fprintf (out, "]");
220      }      }
221  }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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