yacc.c: support "%define api.pure full"

This makes the interface for yyerror() pure without the need for a spurious
parse_param.

* data/yacc.c (b4_pure_if, b4_pure_flag): New definition, accept three states.
(b4_yacc_pure_if): Rename as...
(b4_yyerror_arg_loc_if): This, and use b4_pure_flag.
* tests/actions.at (%define api.pure): Modernize.
* test/calc.at (Simple LALR Calculator): Modernize.
* tests/local.at (AT_YYERROR_ARG_LOC_IF): Adjust.
This commit is contained in:
Theophile Ranquet
2012-11-23 17:30:47 +00:00
parent dbb998364f
commit 6428a8a4a5
4 changed files with 38 additions and 23 deletions

View File

@@ -168,6 +168,7 @@ m4_pushdef([AT_API_PREFIX],
m4_pushdef([AT_YYERROR_ARG_LOC_IF],
[AT_LOCATION_IF([AT_PURE_IF([m4_bmatch([$3],
m4_quote(m4_join([\|],
[%define api.pure "?full"?],
[%glr-parser],
[%parse-param],
[%skeleton "?glr.c"?])),
@@ -355,6 +356,7 @@ static
}]dnl
])
# AT_YYERROR_FORMALS
# AT_YYERROR_PROTOTYPE
# AT_YYERROR_DECLARE_EXTERN
# AT_YYERROR_DECLARE