/ Check-in [e72c81db]
Login

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

Overview
Comment:Get LEMON working again when YYSTACKDEPTH is greater than zero. (CVS 3739)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e72c81dbb309709462e49c4e3e90c3e16ead1265
User & Date: drh 2007-03-29 02:26:46
Context
2007-03-29
04:43
Bias the b-tree binary search toward the high end. The common case is to append data and this heuristic makes append run much faster because there are fewer comparisons. (CVS 3740) check-in: a9877f61 user: drh tags: trunk
02:26
Get LEMON working again when YYSTACKDEPTH is greater than zero. (CVS 3739) check-in: e72c81db user: drh tags: trunk
01:44
Lemon change: compile the resulting parser with -DYYSTACKDEPTH=0 or set the "%stack_size" parameter to 0 in the grammar and the parser stack will be dynamically allocated using realloc() and free(). The default behavior is to have a finite depth stack. (CVS 3738) check-in: 06719b74 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lempar.c.

   664    664     int yyendofinput;     /* True if we are at the end of input */
   665    665     int yyerrorhit = 0;   /* True if yymajor has invoked an error */
   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  +#if YYSTACKDEPTH<=0
   671    672       if( yypParser->yystksz <=0 ){
   672    673         yyStackOverflow(yypParser);
   673    674         return;
   674    675       }
          676  +#endif
   675    677       yypParser->yyidx = 0;
   676    678       yypParser->yyerrcnt = -1;
   677    679       yypParser->yystack[0].stateno = 0;
   678    680       yypParser->yystack[0].major = 0;
   679    681     }
   680    682     yyminorunion.yy0 = yyminor;
   681    683     yyendofinput = (yymajor==0);