mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Enable push parsers to operate in impure mode. Thus, %push-parser no
longer implies %pure-parser. The point of this change is to move towards being able to test the push parser code by running the entire test suite as if %push-parser had been declared. * data/push.c (yypush_parse): For impure mode, remove the yypushed_char, yypushed_val, and yypushed_loc arguments. Instead, declare these as local variables initialized to the global yychar, yylval, and yylloc. For the first yypush_parse invocation only, restore the initial values of these global variables when it's time to read a token since they have been overwritten. * src/parse-gram.y (prologue_declaration): Don't set pure_parser for %push-parser. * tests/calc.at (Simple LALR(1) Calculator): Always declare %pure-parser along with %push-parser since this test case was designed for pure push parsers. * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused. (AT_YACC_OR_PUSH_IF): New. (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but add a note that it's still wrong for some cases (as it has been for a while). (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since %push-parser no longer implies %pure-parser.
This commit is contained in:
@@ -168,7 +168,7 @@
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 1487 of yacc.c */
|
||||
/* Line 1535 of yacc.c */
|
||||
#line 97 "parse-gram.y"
|
||||
|
||||
symbol *symbol;
|
||||
@@ -181,7 +181,7 @@ typedef union YYSTYPE
|
||||
unsigned char character;
|
||||
}
|
||||
|
||||
/* Line 1487 of yacc.c */
|
||||
/* Line 1535 of yacc.c */
|
||||
#line 186 "parse-gram.h"
|
||||
YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
|
||||
Reference in New Issue
Block a user