23 |
The entry point is generate_states. */ |
The entry point is generate_states. */ |
24 |
|
|
25 |
#include "system.h" |
#include "system.h" |
26 |
|
#include "getargs.h" |
27 |
#include "gram.h" |
#include "gram.h" |
28 |
#include "state.h" |
#include "state.h" |
29 |
#include "complain.h" |
#include "complain.h" |
148 |
int i; |
int i; |
149 |
int shiftcount; |
int shiftcount; |
150 |
|
|
151 |
#if TRACE |
if (trace_flag) |
152 |
fprintf (stderr, "Entering new_itemsets, state = %d\n", |
fprintf (stderr, "Entering new_itemsets, state = %d\n", nstates); |
|
this_state->number); |
|
|
#endif |
|
153 |
|
|
154 |
for (i = 0; i < nsyms; i++) |
for (i = 0; i < nsyms; i++) |
155 |
kernel_end[i] = NULL; |
kernel_end[i] = NULL; |
191 |
int n; |
int n; |
192 |
core *p; |
core *p; |
193 |
|
|
194 |
#if TRACE |
if (trace_flag) |
195 |
fprintf (stderr, "Entering new_state, symbol = %d, state = %d\n", |
fprintf (stderr, "Entering new_state, state = %d, symbol = %d\n", |
196 |
symbol, nstates); |
nstates, symbol); |
|
#endif |
|
197 |
|
|
198 |
if (nstates >= MAXSHORT) |
if (nstates >= MAXSHORT) |
199 |
fatal (_("too many states (max %d)"), MAXSHORT); |
fatal (_("too many states (max %d)"), MAXSHORT); |
231 |
|
|
232 |
int n = kernel_end[symbol] - kernel_base[symbol]; |
int n = kernel_end[symbol] - kernel_base[symbol]; |
233 |
|
|
234 |
#if TRACE |
if (trace_flag) |
235 |
fprintf (stderr, "Entering get_state, state = %d, symbol = %d\n", |
fprintf (stderr, "Entering get_state, state = %d, symbol = %d\n", |
236 |
nstates, symbol); |
nstates, symbol); |
|
#endif |
|
237 |
|
|
238 |
/* Add up the target state's active item numbers to get a hash key. |
/* Add up the target state's active item numbers to get a hash key. |
239 |
*/ |
*/ |
293 |
int j; |
int j; |
294 |
int symbol; |
int symbol; |
295 |
|
|
296 |
#if TRACE |
if (trace_flag) |
297 |
fprintf (stderr, "Entering append_states\n"); |
fprintf (stderr, "Entering append_states\n"); |
298 |
#endif |
|
299 |
|
|
300 |
/* first sort shift_symbol into increasing order */ |
/* first sort shift_symbol into increasing order */ |
301 |
|
|