Intro: The shiftreduce action is a shift action followed by a reduce action. It is executed in two parts: a shift part, shifting to an anonymous state. In this state, the state number is actually an indication of the reduction to perform, independently of the lookahead symbol.
When performing the shift part, the argument of the action is adjusted before being stored in the state of the anonymous state. Problem: When the shiftreduce action is used in an error context, such as: X -> alpha error. the adjustment is not made. This causes error handling to fail. Solution: Moving the adjustment into the yy_shift function fixes the problem. I think check-in 2c17a1358353a0845b039283be79353f033e2491 is missing this adjustment, and so it would affect releases 3.9.0 and up (3.13.*). The following patch fixes the problem for me, but it is not against the latest trunk, and I think it will not apply to it because the line to be removed has been reformatted. Nevertheless I suppose it will be useful. Index: tool/lempar.c =================================================================== --- tool/lempar.c +++ tool/lempar.c @@ -563,6 +563,7 @@ int yyMajor, /* The major token to shift in */ ParseTOKENTYPE yyMinor /* The minor token to shift in */ ){ + if( yyNewState > YY_MAX_SHIFT ) yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; yyStackEntry *yytos; yypParser->yyidx++; #ifdef YYTRACKMAXSTACKDEPTH @@ -813,7 +814,6 @@ do{ yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); if( yyact <= YY_MAX_SHIFTREDUCE ){ - if( yyact > YY_MAX_SHIFT ) yyact += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; yy_shift(yypParser,yyact,yymajor,yyminor); #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt--; Thanks. Vincent. -- WCC - Smart Search & Match NL +31 30 7503222 vzwe...@wcc-group.com www.wcc-group.com
signature.asc
Description: PGP signature
_______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users