deprecate %defines in favor of %header

This is consistent with --defines being deprecated in favor of
--header.  The directive %defines is also too similar to %define.
And %header matches nicely with api.header.name.

* src/scan-gram.l (%defines): Deprecate to %header.
(%header): Scan it.
* src/parse-gram.y (PERCENT_DEFINES): Replace with...
(PERCENT_HEADER): this.
* data/skeletons/lalr1.java
* doc/bison.texi
* tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
* tests/input.at, tests/java.at, tests/local.at, tests/output.at,
* tests/synclines.at, tests/types.at:
Convert most tests to check %header instead of %defines.
This commit is contained in:
Akim Demaille
2020-09-06 14:20:43 +02:00
parent 75c3746ce2
commit b327f38832
17 changed files with 185 additions and 136 deletions

View File

@@ -245,15 +245,16 @@ eqopt ({sp}=)?
"%debug" RETURN_PERCENT_FLAG ("parse.trace");
"%default-prec" return BISON_DIRECTIVE (DEFAULT_PREC);
"%define" return BISON_DIRECTIVE (DEFINE);
"%defines" return BISON_DIRECTIVE (DEFINES);
"%defines" return BISON_DIRECTIVE (HEADER); // Deprecated in 3.8.
"%destructor" return BISON_DIRECTIVE (DESTRUCTOR);
"%dprec" return BISON_DIRECTIVE (DPREC);
"%empty" return BISON_DIRECTIVE (EMPTY);
"%expect" return BISON_DIRECTIVE (EXPECT);
"%expect-rr" return BISON_DIRECTIVE (EXPECT_RR);
"%file-prefix" RETURN_VALUE (PERCENT_FILE_PREFIX, uniqstr_new (yytext));
"%initial-action" return BISON_DIRECTIVE (INITIAL_ACTION);
"%glr-parser" return BISON_DIRECTIVE (GLR_PARSER);
"%header" return BISON_DIRECTIVE (HEADER);
"%initial-action" return BISON_DIRECTIVE (INITIAL_ACTION);
"%language" return BISON_DIRECTIVE (LANGUAGE);
"%left" return PERCENT_LEFT;
"%lex-param" RETURN_PERCENT_PARAM (lex);