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

Diff of /bison/src/print_graph.c

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

revision 1.50 by akim, Mon Jul 29 17:31:46 2002 UTC revision 1.51 by akim, Thu Aug 1 18:14:30 2002 UTC
# Line 86  print_core (struct obstack *oout, state_ Line 86  print_core (struct obstack *oout, state_
86          obstack_fgrow1 (oout, " %s", symbols[*sp]->tag);          obstack_fgrow1 (oout, " %s", symbols[*sp]->tag);
87    
88        /* Experimental feature: display the lookaheads. */        /* Experimental feature: display the lookaheads. */
89        if ((report_flag & report_lookaheads)        if (report_flag & report_lookaheads)
           && state->nlookaheads)  
90          {          {
91            int j, k;            /* Find the reduction we are handling.  */
92            bitset_iterator biter;            reductions_t *reds = state->reductions;
93            int nlookaheads = 0;            int redno = state_reduction_find (state, &rules[rule]);
94    
95            /* Look for lookaheads corresponding to this rule. */            /* Print them if there are.  */
96            for (j = 0; j < state->nlookaheads; ++j)            if (reds->lookaheads && redno != -1)
             BITSET_FOR_EACH (biter, state->lookaheads[j], k, 0)  
               if (state->lookaheads_rule[j]->number == rule)  
                 nlookaheads++;  
   
           if (nlookaheads)  
97              {              {
98                obstack_sgrow (oout, "  [");                bitset_iterator biter;
99                for (j = 0; j < state->nlookaheads; ++j)                int k;
100                  BITSET_FOR_EACH (biter, state->lookaheads[j], k, 0)                int not_first = 0;
101                    if (state->lookaheads_rule[j]->number == rule)                obstack_sgrow (oout, "[");
102                      obstack_fgrow2 (oout, "%s%s",                BITSET_FOR_EACH (biter, reds->lookaheads[redno], k, 0)
103                                      symbols[k]->tag,                  obstack_fgrow2 (oout, "%s%s",
104                                      --nlookaheads ? ", " : "");                                  not_first++ ? ", " : "",
105                                    symbols[k]->tag);
106                obstack_sgrow (oout, "]");                obstack_sgrow (oout, "]");
107              }              }
108          }          }

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

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