Files
bison/tests/README.md
Akim Demaille 3c5f73fe51 yacc: comply with recent POSIX updates: declare yyerror and yylex
In POSIX Yacc mode, declare yyerror and yylex unless already #defined,
or if YYERROR_IS_DECLARED/YYLEX_IS_DECLARED are defined (for
consistency with Bison's YYSTYPE_IS_DECLARED/YYLTYPE_IS_DECLARED).
See <https://austingroupbugs.net/view.php?id=1388#c5220>.

* data/skeletons/c.m4 (b4_function_declare): Resurect.
(b4_lex_formals): Since we will possibly expose this prototype
in the header, take the prefix into account.
* data/skeletons/yacc.c (b4_declare_yyerror_and_yylex): New.
(b4_shared_declarations): Use it.

* tests/local.at (AT_YACC_IF): New.
When in Yacc mode, set the `yacc` Autotest keyword.
(AT_YYERROR_DECLARE(c)): Don't declare in Yacc mode,
to avoid clashes (since this signature is static).
(AT_YYERROR_DEFINE(c)): Don't define as static in Yacc mode.
* tests/regression.at (Early token definitions with --yacc): Specify
that we are in Yacc mode.
2021-08-09 07:17:19 +02:00

38 lines
809 B
Markdown

# AT_BISON_OPTION_PUSHDEFS/AT_BISON_OPTION_POPDEFS
These two macros must be given the (main) directives so that they
define a number of other macros to:
- what the language is (so what compiler tool chain to use, what
definition of yylex/yyerror, etc.)
- what skeleton is used
# Keywords
The following keywords are used to label tests (with
AT_KEYWORDS([[category]])). Please follow them and avoid creating
synonyms.
- action
- api.value.type
- c++: c++ language
- cex: counterexamples.
- d: d language
- deprec: deprecated features.
- diagnostics
- glr
- graph
- java
- lac
- %merge
- multistart
- push
- report: for automaton dumps
- %union
- variant
- yacc: POSIX yacc (%yacc)
# Calculator
The grammar features several special directives:
- `!!` YYERROR
- `!+` YYACCEPT
- `!-` YYABORT
- `!*` YYNOMEM