mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 19:51:27 +00:00
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:
parent
5286a7fef3
commit
bcdef59c3c
1 changed files with 6 additions and 12 deletions
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue