49 |
print_core (FILE *out, int state) |
print_core (FILE *out, int state) |
50 |
{ |
{ |
51 |
int i; |
int i; |
52 |
short *sitems = state_table[state].state->items; |
short *sitems = state_table[state]->items; |
53 |
int snitems = state_table[state].state->nitems; |
int snitems = state_table[state]->nitems; |
54 |
|
|
55 |
/* New experimental feature: if TRACE_FLAGS output all the items of |
/* New experimental feature: if TRACE_FLAGS output all the items of |
56 |
a state, not only its kernel. */ |
a state, not only its kernel. */ |
98 |
{ |
{ |
99 |
int i; |
int i; |
100 |
|
|
101 |
shifts *shiftp = state_table[state].shifts; |
shifts *shiftp = state_table[state]->shifts; |
102 |
reductions *redp = state_table[state].reductions; |
reductions *redp = state_table[state]->reductions; |
103 |
errs *errp = state_table[state].errs; |
errs *errp = state_table[state]->errs; |
104 |
|
|
105 |
if (!shiftp->nshifts && !redp) |
if (!shiftp->nshifts && !redp) |
106 |
{ |
{ |
115 |
if (!SHIFT_IS_DISABLED (shiftp, i)) |
if (!SHIFT_IS_DISABLED (shiftp, i)) |
116 |
{ |
{ |
117 |
int state1 = shiftp->shifts[i]; |
int state1 = shiftp->shifts[i]; |
118 |
int symbol = state_table[state1].accessing_symbol; |
int symbol = state_table[state1]->accessing_symbol; |
119 |
/* The following line used to be turned off. */ |
/* The following line used to be turned off. */ |
120 |
if (ISVAR (symbol)) |
if (ISVAR (symbol)) |
121 |
break; |
break; |
147 |
fputc ('\n', out); |
fputc ('\n', out); |
148 |
} |
} |
149 |
|
|
150 |
if (state_table[state].consistent && redp) |
if (state_table[state]->consistent && redp) |
151 |
{ |
{ |
152 |
int rule = redp->rules[0]; |
int rule = redp->rules[0]; |
153 |
int symbol = rule_table[rule].lhs; |
int symbol = rule_table[rule].lhs; |
165 |
if (!SHIFT_IS_DISABLED (shiftp, i)) |
if (!SHIFT_IS_DISABLED (shiftp, i)) |
166 |
{ |
{ |
167 |
int state1 = shiftp->shifts[i]; |
int state1 = shiftp->shifts[i]; |
168 |
int symbol = state_table[state1].accessing_symbol; |
int symbol = state_table[state1]->accessing_symbol; |
169 |
fprintf (out, _(" %-4s\tgo to state %d\n"), |
fprintf (out, _(" %-4s\tgo to state %d\n"), |
170 |
tags[symbol], state1); |
tags[symbol], state1); |
171 |
} |
} |