why not include the lhs in pretty-printed reduce entries?
This commit is contained in:
parent
4b5a936667
commit
ddfd3796a7
1 changed files with 5 additions and 3 deletions
|
|
@ -836,15 +836,17 @@ void pprint_lraction(FILE *f, const HCFGrammar *g, const HLRAction *action)
|
||||||
if(action->type == HLR_SHIFT) {
|
if(action->type == HLR_SHIFT) {
|
||||||
fprintf(f, "s%lu", action->nextstate);
|
fprintf(f, "s%lu", action->nextstate);
|
||||||
} else {
|
} else {
|
||||||
|
fputs("r(", f);
|
||||||
|
h_pprint_symbol(f, g, action->production.lhs);
|
||||||
|
fputs(" -> ", f);
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
// if we can't print the production, at least print its length
|
// if we can't print the production, at least print its length
|
||||||
fprintf(f, "r[%lu]", action->production.length);
|
fprintf(f, "[%lu]", action->production.length);
|
||||||
#else
|
#else
|
||||||
fputs("r(", f);
|
|
||||||
HCFSequence seq = {action->production.rhs};
|
HCFSequence seq = {action->production.rhs};
|
||||||
h_pprint_sequence(f, g, &seq);
|
h_pprint_sequence(f, g, &seq);
|
||||||
fputc(')', f);
|
|
||||||
#endif
|
#endif
|
||||||
|
fputc(')', f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue