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
1 changed files with 6 additions and 12 deletions

View File

@ -334,25 +334,19 @@ static void yy_destructor(
**
** If there is a destructor routine associated with the token which
** 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){
YYCODETYPE yymajor;
yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
if( pParser->yyidx<0 ) return 0;
static void yy_pop_parser_stack(yyParser *pParser){
yyStackEntry *yytos;
assert( pParser->yyidx>=0 );
yytos = &pParser->yystack[pParser->yyidx--];
#ifndef NDEBUG
if( yyTraceFILE && pParser->yyidx>=0 ){
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sPopping %s\n",
yyTracePrompt,
yyTokenName[yytos->major]);
}
#endif
yymajor = yytos->major;
yy_destructor(pParser, yymajor, &yytos->minor);
pParser->yyidx--;
return yymajor;
yy_destructor(pParser, yytos->major, &yytos->minor);
}
/*