mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Enhance LEMON to show precendence of symbols and all rules in the report
that is generated in parallel to the parser. FossilOrigin-Name: 602fbd8149b53d8f0e9a223cc1aec912e7df03fca35071e8d707776ce225371c
This commit is contained in:
14
tool/lemon.c
14
tool/lemon.c
@ -3254,6 +3254,7 @@ void ReportOutput(struct lemon *lemp)
|
||||
struct state *stp;
|
||||
struct config *cfp;
|
||||
struct action *ap;
|
||||
struct rule *rp;
|
||||
FILE *fp;
|
||||
|
||||
fp = file_open(lemp,".out","wb");
|
||||
@ -3306,8 +3307,21 @@ void ReportOutput(struct lemon *lemp)
|
||||
}
|
||||
}
|
||||
}
|
||||
if( sp->prec>=0 ) fprintf(fp," (precedence=%d)", sp->prec);
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
fprintf(fp, "----------------------------------------------------\n");
|
||||
fprintf(fp, "Rules:\n");
|
||||
for(rp=lemp->rule; rp; rp=rp->next){
|
||||
fprintf(fp, "%4d: ", rp->iRule);
|
||||
rule_print(fp, rp);
|
||||
fprintf(fp,".");
|
||||
if( rp->precsym ){
|
||||
fprintf(fp," [%s precedence=%d]",
|
||||
rp->precsym->name, rp->precsym->prec);
|
||||
}
|
||||
fprintf(fp,"\n");
|
||||
}
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user