forked from osmocom/wireshark
Align a bit more with upstream.
svn path=/trunk/; revision=48559
This commit is contained in:
parent
a6fbd905a5
commit
3dc702e2a8
|
@ -3416,7 +3416,7 @@ PRIVATE void translate_code(struct lemon *lemp, struct rule *rp){
|
|||
lemp->errorcnt++;
|
||||
}else if( rp->rhsalias[i]==0 ){
|
||||
if( has_destructor(rp->rhs[i],lemp) ){
|
||||
append_str(" yy_destructor(%d,&yymsp[%d].minor);\n", 0,
|
||||
append_str(" yy_destructor(yypParser,%d,&yymsp[%d].minor);\n", 0,
|
||||
rp->rhs[i]->index,i-rp->nrhs+1);
|
||||
}else{
|
||||
/* No destructor defined for this term */
|
||||
|
|
|
@ -300,6 +300,8 @@ void *ParseAlloc(void *(*mallocProc)(gulong)){
|
|||
pParser->yyidxMax = 0;
|
||||
#endif
|
||||
#if YYSTACKDEPTH<=0
|
||||
pParser->yystack = NULL;
|
||||
pParser->yystksz = 0;
|
||||
yyGrowStack(pParser);
|
||||
#endif
|
||||
}
|
||||
|
@ -311,7 +313,8 @@ void *ParseAlloc(void *(*mallocProc)(gulong)){
|
|||
** "yymajor" is the symbol code, and "yypminor" is a pointer to
|
||||
** the value.
|
||||
*/
|
||||
static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
|
||||
static void yy_destructor(yyParser *yypParser, YYCODETYPE yymajor, YYMINORTYPE *yypminor){
|
||||
ParseARG_FETCH;
|
||||
switch( yymajor ){
|
||||
/* Here is inserted the actions which take place when a
|
||||
** terminal or non-terminal is destroyed. This can happen
|
||||
|
@ -338,18 +341,18 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
|
|||
*/
|
||||
static int yy_pop_parser_stack(yyParser *pParser){
|
||||
YYCODETYPE yymajor;
|
||||
yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];;
|
||||
yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
|
||||
|
||||
if( pParser->yyidx<0 ) return 0;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE ){
|
||||
if( yyTraceFILE && pParser->yyidx>=0 ){
|
||||
fprintf(yyTraceFILE,"%sPopping %s\n",
|
||||
yyTracePrompt,
|
||||
yyTokenName[yytos->major]);
|
||||
}
|
||||
#endif
|
||||
yymajor = yytos->major;
|
||||
yy_destructor( yymajor, &yytos->minor);
|
||||
yy_destructor(pParser, yymajor, &yytos->minor);
|
||||
pParser->yyidx--;
|
||||
return yymajor;
|
||||
}
|
||||
|
@ -404,7 +407,8 @@ static int yy_find_shift_action(
|
|||
int i;
|
||||
int stateno = pParser->yystack[pParser->yyidx].stateno;
|
||||
|
||||
if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
|
||||
if( stateno>YY_SHIFT_MAX
|
||||
|| (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
|
||||
return yy_default[stateno];
|
||||
}
|
||||
assert( iLookAhead!=YYNOCODE );
|
||||
|
@ -529,8 +533,8 @@ static void yy_shift(
|
|||
}
|
||||
#endif
|
||||
yytos = &yypParser->yystack[yypParser->yyidx];
|
||||
yytos->stateno = yyNewState;
|
||||
yytos->major = yyMajor;
|
||||
yytos->stateno = (YYACTIONTYPE)yyNewState;
|
||||
yytos->major = (YYCODETYPE)yyMajor;
|
||||
yytos->minor = *yypMinor;
|
||||
#ifndef NDEBUG
|
||||
if( yyTraceFILE && yypParser->yyidx>0 ){
|
||||
|
@ -619,8 +623,8 @@ static void yy_reduce(
|
|||
if( yysize ){
|
||||
yypParser->yyidx++;
|
||||
yymsp -= yysize-1;
|
||||
yymsp->stateno = yyact;
|
||||
yymsp->major = yygoto;
|
||||
yymsp->stateno = (YYACTIONTYPE)yyact;
|
||||
yymsp->major = (YYCODETYPE)yygoto;
|
||||
yymsp->minor = yygotominor;
|
||||
}else
|
||||
#endif
|
||||
|
@ -794,7 +798,7 @@ void Parse(
|
|||
yyTracePrompt,yyTokenName[yymajor]);
|
||||
}
|
||||
#endif
|
||||
yy_destructor((YYCODETYPE)yymajor,&yyminorunion);
|
||||
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
|
||||
yymajor = YYNOCODE;
|
||||
}else{
|
||||
while(
|
||||
|
@ -807,7 +811,7 @@ void Parse(
|
|||
yy_pop_parser_stack(yypParser);
|
||||
}
|
||||
if( yypParser->yyidx < 0 || yymajor==0 ){
|
||||
yy_destructor((YYCODETYPE)yymajor,&yyminorunion);
|
||||
yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
|
||||
yy_parse_failed(yypParser);
|
||||
yymajor = YYNOCODE;
|
||||
}else if( yymx!=YYERRORSYMBOL ){
|
||||
|
@ -832,7 +836,7 @@ void Parse(
|
|||
yy_syntax_error(yypParser,yymajor,yyminorunion);
|
||||
}
|
||||
yypParser->yyerrcnt = 3;
|
||||
yy_destructor((YYCODETYPE)yymajor,&yyminorunion);
|
||||
yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
|
||||
if( yyendofinput ){
|
||||
yy_parse_failed(yypParser);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue