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++; |
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 |
} |
} |
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 |
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. */ |