103 |
previous_lhs = rules[rule].lhs; |
previous_lhs = rules[rule].lhs; |
104 |
|
|
105 |
for (sp = rules[rule].rhs; sp < sp1; sp++) |
for (sp = rules[rule].rhs; sp < sp1; sp++) |
106 |
fprintf (out, " %s", symbol_tag_get (symbols[*sp])); |
fprintf (out, " %s", symbols[*sp]->tag); |
107 |
fputs (" .", out); |
fputs (" .", out); |
108 |
for (/* Nothing */; *sp >= 0; ++sp) |
for (/* Nothing */; *sp >= 0; ++sp) |
109 |
fprintf (out, " %s", symbol_tag_get (symbols[*sp])); |
fprintf (out, " %s", symbols[*sp]->tag); |
110 |
|
|
111 |
/* Display the lookaheads? */ |
/* Display the lookaheads? */ |
112 |
if (report_flag & report_lookaheads) |
if (report_flag & report_lookaheads) |
135 |
&& TRANSITION_IS_SHIFT (transitions, i) == display_transitions_p) |
&& TRANSITION_IS_SHIFT (transitions, i) == display_transitions_p) |
136 |
{ |
{ |
137 |
symbol_t *symbol = symbols[TRANSITION_SYMBOL (transitions, i)]; |
symbol_t *symbol = symbols[TRANSITION_SYMBOL (transitions, i)]; |
138 |
max_length (&width, symbol_tag_get (symbol)); |
max_length (&width, symbol->tag); |
139 |
} |
} |
140 |
|
|
141 |
/* Nothing to report. */ |
/* Nothing to report. */ |
151 |
&& TRANSITION_IS_SHIFT (transitions, i) == display_transitions_p) |
&& TRANSITION_IS_SHIFT (transitions, i) == display_transitions_p) |
152 |
{ |
{ |
153 |
symbol_t *symbol = symbols[TRANSITION_SYMBOL (transitions, i)]; |
symbol_t *symbol = symbols[TRANSITION_SYMBOL (transitions, i)]; |
154 |
const char *tag = symbol_tag_get (symbol); |
const char *tag = symbol->tag; |
155 |
state_number_t state1 = transitions->states[i]; |
state_number_t state1 = transitions->states[i]; |
156 |
int j; |
int j; |
157 |
|
|
180 |
/* Compute the width of the lookaheads column. */ |
/* Compute the width of the lookaheads column. */ |
181 |
for (i = 0; i < errp->num; ++i) |
for (i = 0; i < errp->num; ++i) |
182 |
if (errp->symbols[i]) |
if (errp->symbols[i]) |
183 |
max_length (&width, symbol_tag_get (symbols[errp->symbols[i]])); |
max_length (&width, symbols[errp->symbols[i]]->tag); |
184 |
|
|
185 |
/* Nothing to report. */ |
/* Nothing to report. */ |
186 |
if (!width) |
if (!width) |
193 |
for (i = 0; i < errp->num; ++i) |
for (i = 0; i < errp->num; ++i) |
194 |
if (errp->symbols[i]) |
if (errp->symbols[i]) |
195 |
{ |
{ |
196 |
const char *tag = symbol_tag_get (symbols[errp->symbols[i]]); |
const char *tag = symbols[errp->symbols[i]]->tag; |
197 |
int j; |
int j; |
198 |
fprintf (out, " %s", tag); |
fprintf (out, " %s", tag); |
199 |
for (j = width - strlen (tag); j > 0; --j) |
for (j = width - strlen (tag); j > 0; --j) |
288 |
if (!enabled) |
if (!enabled) |
289 |
fputc ('[', out); |
fputc ('[', out); |
290 |
fprintf (out, _("reduce using rule %d (%s)"), |
fprintf (out, _("reduce using rule %d (%s)"), |
291 |
rule->number - 1, symbol_tag_get (rule->lhs)); |
rule->number - 1, rule->lhs->tag); |
292 |
if (!enabled) |
if (!enabled) |
293 |
fputc (']', out); |
fputc (']', out); |
294 |
fputc ('\n', out); |
fputc ('\n', out); |
331 |
if (count == 0) |
if (count == 0) |
332 |
{ |
{ |
333 |
if (state->lookaheads_rule[j] != default_rule) |
if (state->lookaheads_rule[j] != default_rule) |
334 |
max_length (&width, symbol_tag_get (symbols[i])); |
max_length (&width, symbols[i]->tag); |
335 |
count++; |
count++; |
336 |
} |
} |
337 |
else |
else |
338 |
{ |
{ |
339 |
max_length (&width, symbol_tag_get (symbols[i])); |
max_length (&width, symbols[i]->tag); |
340 |
} |
} |
341 |
} |
} |
342 |
} |
} |
361 |
{ |
{ |
362 |
if (state->lookaheads_rule[j] != default_rule) |
if (state->lookaheads_rule[j] != default_rule) |
363 |
print_reduction (out, width, |
print_reduction (out, width, |
364 |
symbol_tag_get (symbols[i]), |
symbols[i]->tag, |
365 |
state->lookaheads_rule[j], TRUE); |
state->lookaheads_rule[j], TRUE); |
366 |
else |
else |
367 |
defaulted = 1; |
defaulted = 1; |
371 |
{ |
{ |
372 |
if (defaulted) |
if (defaulted) |
373 |
print_reduction (out, width, |
print_reduction (out, width, |
374 |
symbol_tag_get (symbols[i]), |
symbols[i]->tag, |
375 |
default_rule, TRUE); |
default_rule, TRUE); |
376 |
defaulted = 0; |
defaulted = 0; |
377 |
print_reduction (out, width, |
print_reduction (out, width, |
378 |
symbol_tag_get (symbols[i]), |
symbols[i]->tag, |
379 |
state->lookaheads_rule[j], FALSE); |
state->lookaheads_rule[j], FALSE); |
380 |
} |
} |
381 |
} |
} |
463 |
for (i = 0; i < max_user_token_number + 1; i++) |
for (i = 0; i < max_user_token_number + 1; i++) |
464 |
if (token_translations[i] != undeftoken->number) |
if (token_translations[i] != undeftoken->number) |
465 |
{ |
{ |
466 |
const char *tag = symbol_tag_get (symbols[token_translations[i]]); |
const char *tag = symbols[token_translations[i]]->tag; |
467 |
rule_number_t r; |
rule_number_t r; |
468 |
item_number_t *rhsp; |
item_number_t *rhsp; |
469 |
|
|
491 |
{ |
{ |
492 |
int left_count = 0, right_count = 0; |
int left_count = 0, right_count = 0; |
493 |
rule_number_t r; |
rule_number_t r; |
494 |
const char *tag = symbol_tag_get (symbols[i]); |
const char *tag = symbols[i]->tag; |
495 |
|
|
496 |
for (r = 1; r < nrules + 1; r++) |
for (r = 1; r < nrules + 1; r++) |
497 |
{ |
{ |