/ Check-in [3fe96487]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the lemon-generated parser, do not report the End-of-input character and the wildcard character as missed coverage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | lemon-improvements
Files: files | file ages | folders
SHA3-256: 3fe964873da16c0e0b1c4f1945f965d4137df7a307acd6a3eb6585ffbaa2afd1
User & Date: drh 2017-12-27 16:13:22
Context
2017-12-27
17:14
Change the coverage measurement logic in the lemon-generated parser so that it only checks for coverage of state/lookahead pairs that are valid syntax. It turns out that some states are unreachable if the lookahead is not valid syntax, because the states are only reachable through a shift following a reduce, and the reduce does not happen if the lookahead is a syntax error. check-in: 9dce4650 user: drh tags: lemon-improvements
16:13
In the lemon-generated parser, do not report the End-of-input character and the wildcard character as missed coverage. check-in: 3fe96487 user: drh tags: lemon-improvements
15:21
In LEMON, fix an off-by-one error that can make the lookahead table one byte too smal. check-in: 93792bc5 user: drh tags: lemon-improvements
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lempar.c.

   471    471   ** missed state/lookahead combinations.
   472    472   */
   473    473   #if defined(YYCOVERAGE)
   474    474   int ParseCoverage(FILE *out){
   475    475     int i, j;
   476    476     int nMissed = 0;
   477    477     for(i=0; i<YYNSTATE; i++){
   478         -    for(j=0; j<YYNTOKEN; j++){
          478  +    for(j=1; j<YYNTOKEN; j++){
          479  +      if( j==YYWILDCARD ) continue;
   479    480         if( !yycoverage[i][j] ) nMissed++;
   480    481         if( out ){
   481    482           fprintf(out,"State %d lookahead %s %s\n",
   482    483              i, yyTokenName[j], yycoverage[i][j] ? "ok" : "missed");
   483    484         }
   484    485       }
   485    486     }