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

Diff of /bison/src/closure.c

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

revision 1.36 by akim, Sat Dec 29 14:18:52 2001 UTC revision 1.37 by akim, Sat Dec 29 14:20:13 2001 UTC
# Line 103  print_fderives (void) Line 103  print_fderives (void)
103            {            {
104              short *rhsp;              short *rhsp;
105              fprintf (stderr, "\t\t%d:", j - 1);              fprintf (stderr, "\t\t%d:", j - 1);
106              for (rhsp = &ritem[rule_table[j].rhs]; *rhsp >= 0; ++rhsp)              for (rhsp = &ritem[rules[j].rhs]; *rhsp >= 0; ++rhsp)
107                fprintf (stderr, " %s", symbols[*rhsp]->tag);                fprintf (stderr, " %s", symbols[*rhsp]->tag);
108              fputc ('\n', stderr);              fputc ('\n', stderr);
109            }            }
# Line 133  set_firsts (void) Line 133  set_firsts (void)
133    for (i = ntokens; i < nsyms; i++)    for (i = ntokens; i < nsyms; i++)
134      for (j = 0; derives[i][j] >= 0; ++j)      for (j = 0; derives[i][j] >= 0; ++j)
135        {        {
136          int symbol = ritem[rule_table[derives[i][j]].rhs];          int symbol = ritem[rules[derives[i][j]].rhs];
137          if (ISVAR (symbol))          if (ISVAR (symbol))
138            SETBIT (FIRSTS (i), symbol - ntokens);            SETBIT (FIRSTS (i), symbol - ntokens);
139        }        }
# Line 225  closure (short *core, int n) Line 225  closure (short *core, int n)
225    for (ruleno = 0; ruleno < nrules + 1; ++ruleno)    for (ruleno = 0; ruleno < nrules + 1; ++ruleno)
226      if (BITISSET (ruleset, ruleno))      if (BITISSET (ruleset, ruleno))
227        {        {
228          int itemno = rule_table[ruleno].rhs;          int itemno = rules[ruleno].rhs;
229          while (c < n && core[c] < itemno)          while (c < n && core[c] < itemno)
230            {            {
231              itemset[nitemset] = core[c];              itemset[nitemset] = core[c];

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

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