version 1.13, 2014/10/09 03:02:18 |
version 1.14, 2017/05/25 20:11:03 |
|
|
|
|
|
|
void |
void |
print_reductions(action * p, int defred) |
print_reductions(action * p, int pdefred) |
{ |
{ |
int k, anyreds; |
int k, anyreds; |
action *q; |
action *q; |
|
|
fprintf(verbose_file, "\t. error\n"); |
fprintf(verbose_file, "\t. error\n"); |
else { |
else { |
for (; p; p = p->next) { |
for (; p; p = p->next) { |
if (p->action_code == REDUCE && p->number != defred) { |
if (p->action_code == REDUCE && p->number != pdefred) { |
k = p->number - 2; |
k = p->number - 2; |
if (p->suppressed == 0) |
if (p->suppressed == 0) |
fprintf(verbose_file, "\t%s reduce %d\n", |
fprintf(verbose_file, "\t%s reduce %d\n", |
|
|
} |
} |
} |
} |
|
|
if (defred > 0) |
if (pdefred > 0) |
fprintf(verbose_file, "\t. reduce %d\n", defred - 2); |
fprintf(verbose_file, "\t. reduce %d\n", pdefred - 2); |
} |
} |
} |
} |
|
|
|
|
{ |
{ |
int i, k; |
int i, k; |
int as; |
int as; |
short *to_state; |
short *tto_state; |
shifts *sp; |
shifts *sp; |
|
|
putc('\n', verbose_file); |
putc('\n', verbose_file); |
sp = shift_table[stateno]; |
sp = shift_table[stateno]; |
to_state = sp->shift; |
tto_state = sp->shift; |
for (i = 0; i < sp->nshifts; ++i) { |
for (i = 0; i < sp->nshifts; ++i) { |
k = to_state[i]; |
k = tto_state[i]; |
as = accessing_symbol[k]; |
as = accessing_symbol[k]; |
if (ISVAR(as)) |
if (ISVAR(as)) |
fprintf(verbose_file, "\t%s goto %d\n", |
fprintf(verbose_file, "\t%s goto %d\n", |