/ Check-in [91889fa3]
Login

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

Overview
Comment:Attempt to reset the error count in the Lemon-generated parser after a parse failure.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 91889fa30e84760e0d4b3d429c4abdef5a3f7931
User & Date: drh 2016-07-05 12:47:28
Context
2016-07-05
16:11
More fixes to Lemon so that it automatically resets its error counter at the end of a parse. check-in: 2683b375 user: drh tags: trunk
12:47
Attempt to reset the error count in the Lemon-generated parser after a parse failure. check-in: 91889fa3 user: drh tags: trunk
2016-07-04
11:47
Add the sqlite3rbu_state() API. Used to determine the current state (creating OAL, ready to move OAL, incremental-checkpoint, finished or error) of an RBU operation. check-in: 0357875f user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lempar.c.

   386    386   **
   387    387   ** If there is a destructor routine associated with the token which
   388    388   ** is popped from the stack, then call it.
   389    389   */
   390    390   static void yy_pop_parser_stack(yyParser *pParser){
   391    391     yyStackEntry *yytos;
   392    392     assert( pParser->yytos!=0 );
          393  +  assert( pParser->yytos > pParser->yystack );
   393    394     yytos = pParser->yytos--;
   394    395   #ifndef NDEBUG
   395    396     if( yyTraceFILE ){
   396    397       fprintf(yyTraceFILE,"%sPopping %s\n",
   397    398         yyTracePrompt,
   398    399         yyTokenName[yytos->major]);
   399    400     }
................................................................................
   795    796     int yyendofinput;     /* True if we are at the end of input */
   796    797   #endif
   797    798   #ifdef YYERRORSYMBOL
   798    799     int yyerrorhit = 0;   /* True if yymajor has invoked an error */
   799    800   #endif
   800    801     yyParser *yypParser;  /* The parser */
   801    802   
   802         -  /* (re)initialize the parser, if necessary */
   803    803     yypParser = (yyParser*)yyp;
   804    804     assert( yypParser->yytos!=0 );
   805    805   #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
   806    806     yyendofinput = (yymajor==0);
   807    807   #endif
   808    808     ParseARG_STORE;
   809    809   
................................................................................
   875    875                           YYERRORSYMBOL)) >= YY_MIN_REDUCE
   876    876           ){
   877    877             yy_pop_parser_stack(yypParser);
   878    878           }
   879    879           if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
   880    880             yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
   881    881             yy_parse_failed(yypParser);
          882  +#ifndef YYNOERRORRECOVERY
          883  +          yypParser->yyerrcnt = -1;
          884  +#endif
   882    885             yymajor = YYNOCODE;
   883    886           }else if( yymx!=YYERRORSYMBOL ){
   884    887             yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
   885    888           }
   886    889         }
   887    890         yypParser->yyerrcnt = 3;
   888    891         yyerrorhit = 1;