1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Improved parser tracing output.

FossilOrigin-Name: 25be5750545b7b0ed9e1a1baca31611b354519688f875aa1590b21bb6ff42f1b
This commit is contained in:
drh
2017-12-24 17:06:41 +00:00
parent 88a921ce60
commit e58f74f680
3 changed files with 36 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
C Simplification\sto\sthe\serror\shandling\slogic\sin\sthe\sextension\sloader. C Improved\sparser\stracing\soutput.
D 2017-12-23T14:39:36.160 D 2017-12-24T17:06:41.289
F Makefile.in ceb40bfcb30ebba8e1202b34c56ff7e13e112f9809e2381d99be32c2726058f5 F Makefile.in ceb40bfcb30ebba8e1202b34c56ff7e13e112f9809e2381d99be32c2726058f5
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 6480671f7c129e61208d69492b3c71ce4310d49fceac83cfb17f1c081e242b69 F Makefile.msc 6480671f7c129e61208d69492b3c71ce4310d49fceac83cfb17f1c081e242b69
@@ -1609,7 +1609,7 @@ F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
F tool/kvtest-speed.sh 4761a9c4b3530907562314d7757995787f7aef8f F tool/kvtest-speed.sh 4761a9c4b3530907562314d7757995787f7aef8f
F tool/lemon.c e6056373044d55296d21f81467dba7632bbb81dc49af072b3f0e76338771497e F tool/lemon.c e6056373044d55296d21f81467dba7632bbb81dc49af072b3f0e76338771497e
F tool/lempar.c 967ebf585cd09b11b89d255d213865109a9c4ff075680d22580a2826de288c89 F tool/lempar.c a427c2375df118fa52e69174ffbbf9e26878096f0a109df6b77062d6032afe18
F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9 F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
F tool/logest.c 11346aa019e2e77a00902aa7d0cabd27bd2e8cca F tool/logest.c 11346aa019e2e77a00902aa7d0cabd27bd2e8cca
@@ -1687,7 +1687,11 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 05fee1a21ea398f1e4d6f1cf361657eff25ed6cd8f85ab398262dcfd30da57e9 P 07c773148d8db185fa54991df09298b64f4fef28879e6c9395759265e8183977
R 7fbfe3e61eca395fa5baf5f121a4d2ad Q +c4951833c2b976223c2393d82fd2606068c71cd19612ca9df4e26debab980e32
R 3f4f31cde41f94adafa8015552d0561b
T *branch * lemon-improvements
T *sym-lemon-improvements *
T -sym-trunk *
U drh U drh
Z d82d9c01768cefc5beb206b92e1398bf Z 3f6d9f274761457d9d7dcc3ca6c0270c

View File

@@ -1 +1 @@
07c773148d8db185fa54991df09298b64f4fef28879e6c9395759265e8183977 25be5750545b7b0ed9e1a1baca31611b354519688f875aa1590b21bb6ff42f1b

View File

@@ -578,20 +578,21 @@ static void yyStackOverflow(yyParser *yypParser){
** Print tracing information for a SHIFT action ** Print tracing information for a SHIFT action
*/ */
#ifndef NDEBUG #ifndef NDEBUG
static void yyTraceShift(yyParser *yypParser, int yyNewState){ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
if( yyTraceFILE ){ if( yyTraceFILE ){
if( yyNewState<YYNSTATE ){ if( yyNewState<YYNSTATE ){
fprintf(yyTraceFILE,"%sShift '%s', go to state %d\n", fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
yyTracePrompt,yyTokenName[yypParser->yytos->major], yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState); yyNewState);
}else{ }else{
fprintf(yyTraceFILE,"%sShift '%s'\n", fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
yyTracePrompt,yyTokenName[yypParser->yytos->major]); yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState - YY_MIN_REDUCE);
} }
} }
} }
#else #else
# define yyTraceShift(X,Y) # define yyTraceShift(X,Y,Z)
#endif #endif
/* /*
@@ -633,7 +634,7 @@ static void yy_shift(
yytos->stateno = (YYACTIONTYPE)yyNewState; yytos->stateno = (YYACTIONTYPE)yyNewState;
yytos->major = (YYCODETYPE)yyMajor; yytos->major = (YYCODETYPE)yyMajor;
yytos->minor.yy0 = yyMinor; yytos->minor.yy0 = yyMinor;
yyTraceShift(yypParser, yyNewState); yyTraceShift(yypParser, yyNewState, "Shift");
} }
/* The following table contains information about every rule that /* The following table contains information about every rule that
@@ -673,8 +674,14 @@ static void yy_reduce(
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
yysize = yyRuleInfo[yyruleno].nrhs; yysize = yyRuleInfo[yyruleno].nrhs;
fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt, if( yysize ){
yyRuleName[yyruleno], yymsp[yysize].stateno); fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
yyTracePrompt,
yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
}else{
fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
}
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
@@ -737,7 +744,7 @@ static void yy_reduce(
yypParser->yytos = yymsp; yypParser->yytos = yymsp;
yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto; yymsp->major = (YYCODETYPE)yygoto;
yyTraceShift(yypParser, yyact); yyTraceShift(yypParser, yyact, "... then shift");
} }
} }
@@ -848,7 +855,14 @@ void Parse(
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sInput '%s'\n",yyTracePrompt,yyTokenName[yymajor]); int stateno = yypParser->yytos->stateno;
if( stateno < YY_MIN_REDUCE ){
fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno);
}else{
fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE);
}
} }
#endif #endif