/ Check-in [3fe96487]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 Unified Diffs Ignore Whitespace Patch

Changes to tool/lempar.c.

471
472
473
474
475
476
477
478

479
480
481
482
483
484
485
** missed state/lookahead combinations.
*/
#if defined(YYCOVERAGE)
int ParseCoverage(FILE *out){
  int i, j;
  int nMissed = 0;
  for(i=0; i<YYNSTATE; i++){
    for(j=0; j<YYNTOKEN; j++){

      if( !yycoverage[i][j] ) nMissed++;
      if( out ){
        fprintf(out,"State %d lookahead %s %s\n",
           i, yyTokenName[j], yycoverage[i][j] ? "ok" : "missed");
      }
    }
  }







|
>







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