/[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.77 by akim, Wed Jul 3 06:51:43 2002 UTC revision 1.78 by akim, Thu Jul 25 21:21:02 2002 UTC
# Line 105  allocate_itemsets (void) Line 105  allocate_itemsets (void)
105    int count = 0;    int count = 0;
106    short *symbol_count = XCALLOC (short, nsyms + nuseless_nonterminals);    short *symbol_count = XCALLOC (short, nsyms + nuseless_nonterminals);
107    
108    for (r = 1; r < nrules + 1; ++r)    for (r = 0; r < nrules; ++r)
109      for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)      for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)
110        {        {
111          count++;          count++;
# Line 140  allocate_storage (void) Line 140  allocate_storage (void)
140    allocate_itemsets ();    allocate_itemsets ();
141    
142    shiftset = XCALLOC (state_number_t, nsyms);    shiftset = XCALLOC (state_number_t, nsyms);
143    redset = XCALLOC (short, nrules + 1);    redset = XCALLOC (short, nrules);
144    state_hash_new ();    state_hash_new ();
145    shift_symbol = XCALLOC (symbol_number_t, nsyms);    shift_symbol = XCALLOC (symbol_number_t, nsyms);
146  }  }
# Line 233  get_state (symbol_number_t symbol, size_ Line 233  get_state (symbol_number_t symbol, size_
233  | Use the information computed by new_itemsets to find the state    |  | Use the information computed by new_itemsets to find the state    |
234  | numbers reached by each shift transition from STATE.              |  | numbers reached by each shift transition from STATE.              |
235  |                                                                   |  |                                                                   |
236  | TRANSITIONSET is set up as a vector of state numbers of those states.  |  | SHIFTSET is set up as a vector of state numbers of those states.  |
237  `------------------------------------------------------------------*/  `------------------------------------------------------------------*/
238    
239  static void  static void
# Line 292  save_reductions (state_t *state) Line 292  save_reductions (state_t *state)
292      {      {
293        int item = ritem[itemset[i]];        int item = ritem[itemset[i]];
294        if (item < 0)        if (item < 0)
295          redset[count++] = -item;          redset[count++] = item_number_as_rule_number (item);
296      }      }
297    
298    /* Make a reductions structure and copy the data into it.  */    /* Make a reductions structure and copy the data into it.  */

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78

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