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) {
|
||||
fprintf(f, "s%lu", action->nextstate);
|
||||
} else {
|
||||
fputs("r(", f);
|
||||
h_pprint_symbol(f, g, action->production.lhs);
|
||||
fputs(" -> ", f);
|
||||
#ifdef NDEBUG
|
||||
// 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
|
||||
fputs("r(", f);
|
||||
HCFSequence seq = {action->production.rhs};
|
||||
h_pprint_sequence(f, g, &seq);
|
||||
fputc(')', f);
|
||||
#endif
|
||||
fputc(')', f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue