]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the -p option to lemon to cause conflicts resolved by precedence rules
authordrh <drh@noemail.net>
Sun, 18 Jul 2010 11:35:53 +0000 (11:35 +0000)
committerdrh <drh@noemail.net>
Sun, 18 Jul 2010 11:35:53 +0000 (11:35 +0000)
to appear in the parse.out file.

FossilOrigin-Name: fb6a59b0a905ddea071948f9a527483a1b1b219f

manifest
manifest.uuid
tool/lemon.c

index 6dfd9869ce627e40d939d20e59f8fd405ce3dc6a..4db31e246ece9cbb0186dd45cf0818542cb6a0c8 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,8 @@
-C Add\snew\stest\sfile\se_expr.test.
-D 2010-07-17T18:44:49
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+C Add\sthe\s-p\soption\sto\slemon\sto\scause\sconflicts\sresolved\sby\sprecedence\srules\nto\sappear\sin\sthe\sparse.out\sfile.
+D 2010-07-18T11:35:53
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -811,7 +814,7 @@ F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
 F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
-F tool/lemon.c 6958cb9935be265bf51dbc718ef325e3b77685b6
+F tool/lemon.c c6b68d7a836ac4d354e5e9123d43a1a19b629ebd
 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
 F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309
 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
@@ -837,7 +840,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P e1d228e992fe8da1fc5aef95d9bc8be62c6b46c7
-R 052d9ddc87605f8176899391baedd484
-U dan
-Z a94751afe56623aed508c4e989148fe1
+P cbcf8abbb2cb3e603cc3da45075f6b076e5cad56
+R 09f5c2286bdd34eb2a3dded11c097670
+U drh
+Z aa387c903e18d67037182a72c6857c12
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iD8DBQFMQuceoxKgR168RlERAtrXAJ91h/0ADiDZhUbyHiJKxfGJP7E3VwCdEnck
+SWnWkJuxuRRENtqIsvKGCdc=
+=7eTj
+-----END PGP SIGNATURE-----
index 080a5dea7ed3c4c4631f9202de4aea6ca0298c1e..72e2bdb6be5babdc6eac9f494c66fd34c4dc3606 100644 (file)
@@ -1 +1 @@
-cbcf8abbb2cb3e603cc3da45075f6b076e5cad56
\ No newline at end of file
+fb6a59b0a905ddea071948f9a527483a1b1b219f
\ No newline at end of file
index 49db0e64db3df05c5cd3f1e9b07ac0aed85efc78..6d8b220ea097a01a8a2b993ccc6bee8755490efa 100644 (file)
@@ -34,6 +34,7 @@ extern int access();
 #define MAXRHS 1000
 #endif
 
+static int showPrecedenceConflict = 0;
 static const char **made_files = NULL;
 static int made_files_count = 0;
 static int successful_exit = 0;
@@ -1412,6 +1413,8 @@ int main(int argc, char **argv)
     {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."},
     {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."},
     {OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."},
+    {OPT_FLAG, "p", (char*)&showPrecedenceConflict,
+                    "Show conflicts resolved by precedence rules"},
     {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
     {OPT_FLAG, "s", (char*)&statistics,
                                    "Print parser stats to standard output."},
@@ -2900,7 +2903,21 @@ int PrintAction(struct action *ap, FILE *fp, int indent){
         indent,ap->sp->name,ap->x.stp->statenum);
       break;
     case SH_RESOLVED:
+      if( showPrecedenceConflict ){
+        fprintf(fp,"%*s shift  %d -- dropped by precedence",
+                indent,ap->sp->name,ap->x.stp->statenum);
+      }else{
+        result = 0;
+      }
+      break;
     case RD_RESOLVED:
+      if( showPrecedenceConflict ){
+        fprintf(fp,"%*s reduce %d -- dropped by precedence",
+                indent,ap->sp->name,ap->x.rp->index);
+      }else{
+        result = 0;
+      }
+      break;
     case NOT_USED:
       result = 0;
       break;