/ Check-in [70c8c7e2]
Login

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

Overview
Comment:Make yypMinor available to the stack overflow callbacks in lemon generated parsers. This does not effect SQLite. (CVS 3761)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:70c8c7e2ce5213778e63c200a6637849920deea6
User & Date: drh 2007-03-30 13:35:06
Context
2007-03-30
14:06
Refactoring the btree and pager routines into distinct two-phase commit routines. We've always done a two-phase commit - this change is just making that more apparent in the code. (CVS 3762) check-in: 66b3ad09 user: drh tags: trunk
13:35
Make yypMinor available to the stack overflow callbacks in lemon generated parsers. This does not effect SQLite. (CVS 3761) check-in: 70c8c7e2 user: drh tags: trunk
13:01
Avoid using the "clock" command in test scripts since it is a proc in Tcl8.5 and is thus not available to testfixture. (CVS 3760) check-in: 339941d8 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lempar.c.

   433    433       return yy_action[i];
   434    434     }
   435    435   }
   436    436   
   437    437   /*
   438    438   ** The following routine is called if the stack overflows.
   439    439   */
   440         -static void yyStackOverflow(yyParser *yypParser){
          440  +static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
   441    441      ParseARG_FETCH;
   442    442      yypParser->yyidx--;
   443    443   #ifndef NDEBUG
   444    444      if( yyTraceFILE ){
   445    445        fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
   446    446      }
   447    447   #endif
................................................................................
   461    461     int yyMajor,                  /* The major token to shift in */
   462    462     YYMINORTYPE *yypMinor         /* Pointer ot the minor token to shift in */
   463    463   ){
   464    464     yyStackEntry *yytos;
   465    465     yypParser->yyidx++;
   466    466   #if YYSTACKDEPTH>0 
   467    467     if( yypParser->yyidx>=YYSTACKDEPTH ){
   468         -    yyStackOverflow(yypParser);
          468  +    yyStackOverflow(yypParser, yypMinor);
   469    469       return;
   470    470     }
   471    471   #else
   472    472     if( yypParser->yyidx>=yypParser->yystksz ){
   473    473       yyGrowStack(yypParser);
   474    474       if( yypParser->yyidx>=yypParser->yystksz ){
   475         -      yyStackOverflow(yypParser);
          475  +      yyStackOverflow(yypParser, yypMinor);
   476    476         return;
   477    477       }
   478    478     }
   479    479   #endif
   480    480     yytos = &yypParser->yystack[yypParser->yyidx];
   481    481     yytos->stateno = yyNewState;
   482    482     yytos->major = yyMajor;
................................................................................
   666    666     yyParser *yypParser;  /* The parser */
   667    667   
   668    668     /* (re)initialize the parser, if necessary */
   669    669     yypParser = (yyParser*)yyp;
   670    670     if( yypParser->yyidx<0 ){
   671    671   #if YYSTACKDEPTH<=0
   672    672       if( yypParser->yystksz <=0 ){
   673         -      yyStackOverflow(yypParser);
          673  +      memset(&yyminorunion, 0, sizeof(yyminorunion));
          674  +      yyStackOverflow(yypParser, &yyminorunion);
   674    675         return;
   675    676       }
   676    677   #endif
   677    678       yypParser->yyidx = 0;
   678    679       yypParser->yyerrcnt = -1;
   679    680       yypParser->yystack[0].stateno = 0;
   680    681       yypParser->yystack[0].major = 0;