212 |
|
|
213 |
table = XREALLOC (table, base_t, table_size); |
table = XREALLOC (table, base_t, table_size); |
214 |
check = XREALLOC (check, base_t, table_size); |
check = XREALLOC (check, base_t, table_size); |
215 |
if (glr_parser) |
conflict_table = XREALLOC (conflict_table, unsigned int, table_size); |
|
conflict_table = XREALLOC (conflict_table, unsigned int, table_size); |
|
216 |
|
|
217 |
for (/* Nothing. */; old_size < table_size; ++old_size) |
for (/* Nothing. */; old_size < table_size; ++old_size) |
218 |
{ |
{ |
469 |
symbol_number_t j; |
symbol_number_t j; |
470 |
rule_number_t r; |
rule_number_t r; |
471 |
|
|
472 |
int nconflict = conflicts_total_count (); |
int nconflict = glr_parser ? conflicts_total_count () : 0; |
473 |
|
|
474 |
yydefact = XCALLOC (rule_number_t, nstates); |
yydefact = XCALLOC (rule_number_t, nstates); |
475 |
|
|
476 |
actrow = XCALLOC (action_t, ntokens); |
actrow = XCALLOC (action_t, ntokens); |
477 |
conflrow = XCALLOC (unsigned int, ntokens); |
conflrow = XCALLOC (unsigned int, ntokens); |
478 |
|
|
479 |
|
conflict_list = XCALLOC (unsigned int, 1 + 2 * nconflict); |
480 |
|
conflict_list_free = 2 * nconflict; |
481 |
|
conflict_list_cnt = 1; |
482 |
|
|
483 |
/* Find the rules which are reduced. */ |
/* Find the rules which are reduced. */ |
484 |
if (!glr_parser) |
if (!glr_parser) |
485 |
for (r = 0; r < nrules; ++r) |
for (r = 0; r < nrules; ++r) |
486 |
rules[r].useful = FALSE; |
rules[r].useful = FALSE; |
487 |
|
|
|
if (glr_parser) |
|
|
{ |
|
|
conflict_list = XCALLOC (unsigned int, 1 + 2 * nconflict); |
|
|
conflict_list_free = 2 * nconflict; |
|
|
conflict_list_cnt = 1; |
|
|
} |
|
|
else |
|
|
conflict_list_free = conflict_list_cnt = 0; |
|
|
|
|
488 |
for (i = 0; i < nstates; ++i) |
for (i = 0; i < nstates; ++i) |
489 |
{ |
{ |
490 |
rule_t *default_rule = action_row (states[i]); |
rule_t *default_rule = action_row (states[i]); |
793 |
base = XCALLOC (base_t, nvectors); |
base = XCALLOC (base_t, nvectors); |
794 |
pos = XCALLOC (base_t, nentries); |
pos = XCALLOC (base_t, nentries); |
795 |
table = XCALLOC (base_t, table_size); |
table = XCALLOC (base_t, table_size); |
796 |
if (glr_parser) |
conflict_table = XCALLOC (unsigned int, table_size); |
|
conflict_table = XCALLOC (unsigned int, table_size); |
|
797 |
check = XCALLOC (base_t, table_size); |
check = XCALLOC (base_t, table_size); |
798 |
|
|
799 |
lowzero = 0; |
lowzero = 0; |