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

Diff of /bison/src/LR0.c

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

revision 1.57 by akim, Mon Mar 4 12:03:35 2002 UTC revision 1.58 by akim, Sun Apr 7 17:38:37 2002 UTC
# Line 68  static state_t **state_hash = NULL; Line 68  static state_t **state_hash = NULL;
68  static void  static void
69  allocate_itemsets (void)  allocate_itemsets (void)
70  {  {
71    int i;    int i, r;
72      short *rhsp;
73    
74    /* Count the number of occurrences of all the symbols in RITEMS.    /* Count the number of occurrences of all the symbols in RITEMS.
75       Note that useless productions (hence useless nonterminals) are       Note that useless productions (hence useless nonterminals) are
# Line 77  allocate_itemsets (void) Line 78  allocate_itemsets (void)
78    int count = 0;    int count = 0;
79    short *symbol_count = XCALLOC (short, nsyms + nuseless_nonterminals);    short *symbol_count = XCALLOC (short, nsyms + nuseless_nonterminals);
80    
81    for (i = 0; i < nritems; ++i)    for (r = 1; r < nrules + 1; ++r)
82      if (ritem[i] >= 0)      for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)
83        {        {
84          count++;          count++;
85          symbol_count[ritem[i]]++;          symbol_count[*rhsp]++;
86        }        }
87    
88    /* See comments before new_itemsets.  All the vectors of items    /* See comments before new_itemsets.  All the vectors of items

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

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