Lemon update 2015-11-09 14:11:37 on branch trunk

- Size reduction and performance improvement in the stack-popping logic of the Lemon-generated parser. (user: drh)
This commit is contained in:
Randy Heit 2016-03-20 12:05:07 -05:00
parent 5286a7fef3
commit bcdef59c3c

View file

@ -334,25 +334,19 @@ static void yy_destructor(
** **
** If there is a destructor routine associated with the token which ** If there is a destructor routine associated with the token which
** is popped from the stack, then call it. ** is popped from the stack, then call it.
**
** Return the major token number for the symbol popped.
*/ */
static int yy_pop_parser_stack(yyParser *pParser){ static void yy_pop_parser_stack(yyParser *pParser){
YYCODETYPE yymajor; yyStackEntry *yytos;
yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; assert( pParser->yyidx>=0 );
yytos = &pParser->yystack[pParser->yyidx--];
if( pParser->yyidx<0 ) return 0;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE && pParser->yyidx>=0 ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sPopping %s\n", fprintf(yyTraceFILE,"%sPopping %s\n",
yyTracePrompt, yyTracePrompt,
yyTokenName[yytos->major]); yyTokenName[yytos->major]);
} }
#endif #endif
yymajor = yytos->major; yy_destructor(pParser, yytos->major, &yytos->minor);
yy_destructor(pParser, yymajor, &yytos->minor);
pParser->yyidx--;
return yymajor;
} }
/* /*