Improvements to the formatting of parse.out file from Lemon. Add the -r option
to Lemon to disable the state sorting, making debugging easier. FossilOrigin-Name: a2eaf8294f6d3fb39548987d632e934bb5d71cc9
This commit is contained in:
parent
f5c4e0f12a
commit
dd7e9dba97
18
manifest
18
manifest
@ -1,8 +1,8 @@
|
|||||||
-----BEGIN PGP SIGNED MESSAGE-----
|
-----BEGIN PGP SIGNED MESSAGE-----
|
||||||
Hash: SHA1
|
Hash: SHA1
|
||||||
|
|
||||||
C Add\sthe\s-p\soption\sto\slemon\sto\scause\sconflicts\sresolved\sby\sprecedence\srules\nto\sappear\sin\sthe\sparse.out\sfile.
|
C Improvements\sto\sthe\sformatting\sof\sparse.out\sfile\sfrom\sLemon.\s\sAdd\sthe\s-r\soption\nto\sLemon\sto\sdisable\sthe\sstate\ssorting,\smaking\sdebugging\seasier.
|
||||||
D 2010-07-18T11:35:53
|
D 2010-07-19T01:52:07
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
|
F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@ -814,7 +814,7 @@ F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
|
|||||||
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
|
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
|
||||||
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
|
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
|
||||||
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
|
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
|
||||||
F tool/lemon.c c6b68d7a836ac4d354e5e9123d43a1a19b629ebd
|
F tool/lemon.c fe890e2d8d2db1e3f57e2a22503dbb0f6843e517
|
||||||
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
|
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
|
||||||
F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309
|
F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309
|
||||||
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
|
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
|
||||||
@ -840,14 +840,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
|||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||||
P cbcf8abbb2cb3e603cc3da45075f6b076e5cad56
|
P fb6a59b0a905ddea071948f9a527483a1b1b219f
|
||||||
R 09f5c2286bdd34eb2a3dded11c097670
|
R 51c841f76c69bf5e6556ec5daf09968e
|
||||||
U drh
|
U drh
|
||||||
Z aa387c903e18d67037182a72c6857c12
|
Z 24cc80027c5e0d723abf48a04029c8ab
|
||||||
-----BEGIN PGP SIGNATURE-----
|
-----BEGIN PGP SIGNATURE-----
|
||||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
Version: GnuPG v1.4.6 (GNU/Linux)
|
||||||
|
|
||||||
iD8DBQFMQuceoxKgR168RlERAtrXAJ91h/0ADiDZhUbyHiJKxfGJP7E3VwCdEnck
|
iD8DBQFMQ6/KoxKgR168RlERAgAeAJ9Oh7vCPcQVE0i0ruNeTvg193wLIACePi9m
|
||||||
SWnWkJuxuRRENtqIsvKGCdc=
|
uvJRIi8nuCTaVs/JJFjJ3W4=
|
||||||
=7eTj
|
=hKG0
|
||||||
-----END PGP SIGNATURE-----
|
-----END PGP SIGNATURE-----
|
||||||
|
@ -1 +1 @@
|
|||||||
fb6a59b0a905ddea071948f9a527483a1b1b219f
|
a2eaf8294f6d3fb39548987d632e934bb5d71cc9
|
15
tool/lemon.c
15
tool/lemon.c
@ -1085,7 +1085,7 @@ static int resolve_conflict(
|
|||||||
/* Not enough precedence information. */
|
/* Not enough precedence information. */
|
||||||
apy->type = SRCONFLICT;
|
apy->type = SRCONFLICT;
|
||||||
errcnt++;
|
errcnt++;
|
||||||
}else if( spx->prec>spy->prec ){ /* Lower precedence wins */
|
}else if( spx->prec>spy->prec ){ /* higher precedence wins */
|
||||||
apy->type = RD_RESOLVED;
|
apy->type = RD_RESOLVED;
|
||||||
}else if( spx->prec<spy->prec ){
|
}else if( spx->prec<spy->prec ){
|
||||||
apx->type = SH_RESOLVED;
|
apx->type = SH_RESOLVED;
|
||||||
@ -1405,6 +1405,7 @@ int main(int argc, char **argv)
|
|||||||
static int statistics = 0;
|
static int statistics = 0;
|
||||||
static int mhflag = 0;
|
static int mhflag = 0;
|
||||||
static int nolinenosflag = 0;
|
static int nolinenosflag = 0;
|
||||||
|
static int noResort = 0;
|
||||||
static struct s_options options[] = {
|
static struct s_options options[] = {
|
||||||
{OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."},
|
{OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."},
|
||||||
{OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."},
|
{OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."},
|
||||||
@ -1416,6 +1417,7 @@ int main(int argc, char **argv)
|
|||||||
{OPT_FLAG, "p", (char*)&showPrecedenceConflict,
|
{OPT_FLAG, "p", (char*)&showPrecedenceConflict,
|
||||||
"Show conflicts resolved by precedence rules"},
|
"Show conflicts resolved by precedence rules"},
|
||||||
{OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
|
{OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
|
||||||
|
{OPT_FLAG, "r", (char*)&noResort, "Do not sort or renumber states"},
|
||||||
{OPT_FLAG, "s", (char*)&statistics,
|
{OPT_FLAG, "s", (char*)&statistics,
|
||||||
"Print parser stats to standard output."},
|
"Print parser stats to standard output."},
|
||||||
{OPT_FLAG, "x", (char*)&version, "Print the version number."},
|
{OPT_FLAG, "x", (char*)&version, "Print the version number."},
|
||||||
@ -1502,8 +1504,9 @@ int main(int argc, char **argv)
|
|||||||
if( compress==0 ) CompressTables(&lem);
|
if( compress==0 ) CompressTables(&lem);
|
||||||
|
|
||||||
/* Reorder and renumber the states so that states with fewer choices
|
/* Reorder and renumber the states so that states with fewer choices
|
||||||
** occur at the end. */
|
** occur at the end. This is an optimization that helps make the
|
||||||
ResortStates(&lem);
|
** generated parser tables smaller. */
|
||||||
|
if( noResort==0 ) ResortStates(&lem);
|
||||||
|
|
||||||
/* Generate a report of the parser generated. (the "y.output" file) */
|
/* Generate a report of the parser generated. (the "y.output" file) */
|
||||||
if( !quiet ) ReportOutput(&lem);
|
if( !quiet ) ReportOutput(&lem);
|
||||||
@ -2899,12 +2902,12 @@ int PrintAction(struct action *ap, FILE *fp, int indent){
|
|||||||
indent,ap->sp->name,ap->x.rp->index);
|
indent,ap->sp->name,ap->x.rp->index);
|
||||||
break;
|
break;
|
||||||
case SSCONFLICT:
|
case SSCONFLICT:
|
||||||
fprintf(fp,"%*s shift %d ** Parsing conflict **",
|
fprintf(fp,"%*s shift %-3d ** Parsing conflict **",
|
||||||
indent,ap->sp->name,ap->x.stp->statenum);
|
indent,ap->sp->name,ap->x.stp->statenum);
|
||||||
break;
|
break;
|
||||||
case SH_RESOLVED:
|
case SH_RESOLVED:
|
||||||
if( showPrecedenceConflict ){
|
if( showPrecedenceConflict ){
|
||||||
fprintf(fp,"%*s shift %d -- dropped by precedence",
|
fprintf(fp,"%*s shift %-3d -- dropped by precedence",
|
||||||
indent,ap->sp->name,ap->x.stp->statenum);
|
indent,ap->sp->name,ap->x.stp->statenum);
|
||||||
}else{
|
}else{
|
||||||
result = 0;
|
result = 0;
|
||||||
@ -2912,7 +2915,7 @@ int PrintAction(struct action *ap, FILE *fp, int indent){
|
|||||||
break;
|
break;
|
||||||
case RD_RESOLVED:
|
case RD_RESOLVED:
|
||||||
if( showPrecedenceConflict ){
|
if( showPrecedenceConflict ){
|
||||||
fprintf(fp,"%*s reduce %d -- dropped by precedence",
|
fprintf(fp,"%*s reduce %-3d -- dropped by precedence",
|
||||||
indent,ap->sp->name,ap->x.rp->index);
|
indent,ap->sp->name,ap->x.rp->index);
|
||||||
}else{
|
}else{
|
||||||
result = 0;
|
result = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user