diff options
author | drh <drh@noemail.net> | 2018-12-03 23:57:27 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-12-03 23:57:27 +0000 |
commit | cfc45b1021d779cd3031bdfb8480173bb84f0e47 (patch) | |
tree | 6021a6cf3ff75087bad0bcac193981a6a7a45722 /tool/lemon.c | |
parent | f8c2fea1951034982bb52ea279d154b33203c9f2 (diff) | |
download | sqlite-cfc45b1021d779cd3031bdfb8480173bb84f0e47.tar.gz sqlite-cfc45b1021d779cd3031bdfb8480173bb84f0e47.zip |
Reduce the size of the parser tables generated by Lemon by splitting the
yyRuleInfo structure into separate yyRuleInfoLhs and yyRuleInfoNRhs arrays.
FossilOrigin-Name: 70fe8ec2ae3099b8773834c7ac2e56768addbecd57956ac523e71a7dc264049c
Diffstat (limited to 'tool/lemon.c')
-rw-r--r-- | tool/lemon.c | 11 |
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++; } |