87 |
{ |
{ |
88 |
int i; |
int i; |
89 |
int k; |
int k; |
90 |
int state1; |
|
91 |
int symbol; |
shifts *shiftp = state_table[state].shift_table; |
92 |
shifts *shiftp; |
reductions *redp = state_table[state].reduction_table; |
93 |
errs *errp; |
errs *errp = err_table[state]; |
|
reductions *redp; |
|
|
int rule; |
|
|
|
|
|
shiftp = state_table[state].shift_table; |
|
|
redp = state_table[state].reduction_table; |
|
|
errp = err_table[state]; |
|
94 |
|
|
95 |
if (!shiftp && !redp) |
if (!shiftp && !redp) |
96 |
{ |
{ |
107 |
|
|
108 |
for (i = 0; i < k; i++) |
for (i = 0; i < k; i++) |
109 |
{ |
{ |
110 |
if (!shiftp->shifts[i]) |
int symbol; |
111 |
|
int state1 = shiftp->shifts[i]; |
112 |
|
if (!state1) |
113 |
continue; |
continue; |
|
state1 = shiftp->shifts[i]; |
|
114 |
symbol = state_table[state1].accessing_symbol; |
symbol = state_table[state1].accessing_symbol; |
115 |
/* The following line used to be turned off. */ |
/* The following line used to be turned off. */ |
116 |
if (ISVAR (symbol)) |
if (ISVAR (symbol)) |
135 |
|
|
136 |
if (errp) |
if (errp) |
137 |
{ |
{ |
138 |
int j, nerrs; |
int j; |
139 |
|
for (j = 0; j < errp->nerrs; j++) |
|
nerrs = errp->nerrs; |
|
|
|
|
|
for (j = 0; j < nerrs; j++) |
|
140 |
{ |
{ |
141 |
if (!errp->errs[j]) |
int symbol = errp->errs[j]; |
142 |
|
if (!symbol) |
143 |
continue; |
continue; |
|
symbol = errp->errs[j]; |
|
144 |
fprintf (out, _(" %-4s\terror (nonassociative)\n"), |
fprintf (out, _(" %-4s\terror (nonassociative)\n"), |
145 |
tags[symbol]); |
tags[symbol]); |
146 |
} |
} |
151 |
|
|
152 |
if (state_table[state].consistent && redp) |
if (state_table[state].consistent && redp) |
153 |
{ |
{ |
154 |
rule = redp->rules[0]; |
int rule = redp->rules[0]; |
155 |
symbol = rule_table[rule].lhs; |
int symbol = rule_table[rule].lhs; |
156 |
fprintf (out, _(" $default\treduce using rule %d (%s)\n\n"), |
fprintf (out, _(" $default\treduce using rule %d (%s)\n\n"), |
157 |
rule, tags[symbol]); |
rule, tags[symbol]); |
158 |
} |
} |
165 |
{ |
{ |
166 |
for (; i < k; i++) |
for (; i < k; i++) |
167 |
{ |
{ |
168 |
if (!shiftp->shifts[i]) |
int symbol; |
169 |
|
int state1 = shiftp->shifts[i]; |
170 |
|
if (!state1) |
171 |
continue; |
continue; |
|
state1 = shiftp->shifts[i]; |
|
172 |
symbol = state_table[state1].accessing_symbol; |
symbol = state_table[state1].accessing_symbol; |
173 |
fprintf (out, _(" %-4s\tgo to state %d\n"), |
fprintf (out, _(" %-4s\tgo to state %d\n"), |
174 |
tags[symbol], state1); |
tags[symbol], state1); |