/ Check-in [e9d604b4]
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:Fix an unreachable branch in the new parse automaton.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | lemon-update
Files: files | file ages | folders
SHA1: e9d604b4306a86faae315ac3cba59bf07d1b665c
User & Date: drh 2015-09-07 20:02:39
Context
2015-09-07
20:11
Enhance the Lemon parser generator to add SHIFTREDUCE states that reduce the sizes of some of the parser tables. check-in: 99b992fa user: drh tags: trunk
20:02
Fix an unreachable branch in the new parse automaton. Closed-Leaf check-in: e9d604b4 user: drh tags: lemon-update
19:52
Change the parser engine so that it (once again) waits for a lookahead token before reducing, even in a SHIFTREDUCE action. check-in: 2c17a135 user: drh tags: lemon-update
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/lempar.c.

   404    404     yyParser *pParser,        /* The parser */
   405    405     YYCODETYPE iLookAhead     /* The look-ahead token */
   406    406   ){
   407    407     int i;
   408    408     int stateno = pParser->yystack[pParser->yyidx].stateno;
   409    409    
   410    410     if( stateno>=YY_MIN_REDUCE ) return stateno;
   411         -  if( stateno>YY_SHIFT_COUNT
   412         -   || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
   413         -    return yy_default[stateno];
   414         -  }
          411  +  assert( stateno <= YY_SHIFT_COUNT );
          412  +  i = yy_shift_ofst[stateno];
          413  +  if( i==YY_SHIFT_USE_DFLT ) return yy_default[stateno];
   415    414     assert( iLookAhead!=YYNOCODE );
   416    415     i += iLookAhead;
   417    416     if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
   418    417       if( iLookAhead>0 ){
   419    418   #ifdef YYFALLBACK
   420    419         YYCODETYPE iFallback;            /* Fallback token */
   421    420         if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])

Changes to tool/lempar.c.

   394    394     yyParser *pParser,        /* The parser */
   395    395     YYCODETYPE iLookAhead     /* The look-ahead token */
   396    396   ){
   397    397     int i;
   398    398     int stateno = pParser->yystack[pParser->yyidx].stateno;
   399    399   
   400    400     if( stateno>=YY_MIN_REDUCE ) return stateno; 
   401         -  if( stateno>YY_SHIFT_COUNT
   402         -   || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
   403         -    return yy_default[stateno];
   404         -  }
          401  +  assert( stateno <= YY_SHIFT_COUNT );
          402  +  i = yy_shift_ofst[stateno];
          403  +  if( i==YY_SHIFT_USE_DFLT ) return yy_default[stateno];
   405    404     assert( iLookAhead!=YYNOCODE );
   406    405     i += iLookAhead;
   407    406     if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
   408    407       if( iLookAhead>0 ){
   409    408   #ifdef YYFALLBACK
   410    409         YYCODETYPE iFallback;            /* Fallback token */
   411    410         if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])