aboutsummaryrefslogtreecommitdiff
path: root/tool/lemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'tool/lemon.c')
-rw-r--r--tool/lemon.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tool/lemon.c b/tool/lemon.c
index 1fca8b975..7f0e55753 100644
--- a/tool/lemon.c
+++ b/tool/lemon.c
@@ -4590,13 +4590,20 @@ void ReportTable(
tplt_print(out,lemp,lemp->overflow,&lineno);
tplt_xfer(lemp->name,in,out,&lineno);
- /* Generate the table of rule information
+ /* Generate the tables of rule information. yyRuleInfoLhs[] and
+ ** yyRuleInfoNRhs[].
**
** Note: This code depends on the fact that rules are number
** sequentually beginning with 0.
*/
for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){
- fprintf(out," { %4d, %4d }, /* (%d) ",rp->lhs->index,-rp->nrhs,i);
+ fprintf(out," %4d, /* (%d) ", rp->lhs->index, i);
+ rule_print(out, rp);
+ fprintf(out," */\n"); lineno++;
+ }
+ tplt_xfer(lemp->name,in,out,&lineno);
+ for(i=0, rp=lemp->rule; rp; rp=rp->next, i++){
+ fprintf(out," %3d, /* (%d) ", -rp->nrhs, i);
rule_print(out, rp);
fprintf(out," */\n"); lineno++;
}