mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
(yypushparse): Add yynchar, yynlval, yynlloc parameters. (b4_declare_parser_variables): Do not declare yynerrs for push mode. (struct yypvars): Remove b4_declare_parser_variables. (yypvarsinit): Remove init code for removed variables. (global scope): Do not declare b4_declare_parser_variables if push or pure mode. (yypushparse): Add b4_declare_parser_variables. Init new local variables, and remove init code for removed yypvars variables. (yyparse): Delete. * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode and yyparse for other modes. (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests. * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added. (AT_YYERROR_SEES_LOC_IF): push-parser makes this false. (AT_PURE_LEX_IF): True if pure or push parser.
This commit is contained in:
@@ -58,6 +58,10 @@ m4_pushdef([AT_LOCATION_IF],
|
||||
[m4_bmatch([$3], [%locations], [$1], [$2])])
|
||||
m4_pushdef([AT_PURE_IF],
|
||||
[m4_bmatch([$3], [%pure-parser], [$1], [$2])])
|
||||
m4_pushdef([AT_PUSH_IF],
|
||||
[m4_bmatch([$3], [%push-parser], [$1], [$2])])
|
||||
m4_pushdef([AT_PURE_OR_PUSH_IF],
|
||||
[m4_bmatch([$3], [%pure-parser\|%push-parser], [$1], [$2])])
|
||||
m4_pushdef([AT_PURE_AND_LOC_IF],
|
||||
[m4_bmatch([$3], [%locations.*%pure-parser\|%pure-parser.*%locations],
|
||||
[$1], [$2])])
|
||||
@@ -72,17 +76,17 @@ m4_pushdef([AT_YYERROR_ARG_LOC_IF],
|
||||
[AT_GLR_OR_PARAM_IF([AT_PURE_AND_LOC_IF([$1], [$2])],
|
||||
[$2])])
|
||||
# yyerror always sees the locations (when activated), except if
|
||||
# yacc & pure & !param.
|
||||
# push or (yacc & pure & !param).
|
||||
m4_pushdef([AT_YYERROR_SEES_LOC_IF],
|
||||
[AT_LOCATION_IF([AT_YACC_IF([AT_PURE_IF([AT_PARAM_IF([$1], [$2])],
|
||||
[AT_PUSH_IF([$2],[AT_LOCATION_IF([AT_YACC_IF([AT_PURE_IF([AT_PARAM_IF([$1], [$2])],
|
||||
[$1])],
|
||||
[$1])],
|
||||
[$2])])
|
||||
[$2])])])
|
||||
|
||||
# The interface is pure: either because %pure-parser, or because we
|
||||
# are using the C++ parsers.
|
||||
m4_pushdef([AT_PURE_LEX_IF],
|
||||
[AT_PURE_IF([$1],
|
||||
[AT_PURE_OR_PUSH_IF([$1],
|
||||
[AT_SKEL_CC_IF([$1], [$2])])])
|
||||
|
||||
AT_PURE_LEX_IF(
|
||||
|
||||
Reference in New Issue
Block a user