java: use the same calc tests as the other skeletons

* tests/local.at (AT_LANG_MATCH): New.
(AT_YYERROR_DECLARE(java), AT_YYERROR_DECLARE_EXTERN(java)): New.
* tests/calc.at: The grammar file for Java is quite different for the
others, and continuing to assemble it from pieces makes the grammar
file hard to understand.  Let's also dispatch on the language to
assemble it, and isolate Java from the others.
Most of this comes from java.at.
This commit is contained in:
Akim Demaille
2020-02-02 07:50:50 +01:00
parent 88d1ab421a
commit fe14fb1c40
3 changed files with 260 additions and 26 deletions

View File

@@ -442,6 +442,12 @@ m4_define([AT_LANG_CASE],
[m4_case(AT_LANG, $@)])
# AT_LANG_MATCH(LANG1, IF-LANG1, LANG2, IF-LANG2, ..., DEFAULT)
# ------------------------------------------------------------
m4_define([AT_LANG_MATCH],
[m4_bmatch(AT_LANG, $@)])
# _AT_LANG_DISPATCH(LANG, MACRO, ARGS)
# ------------------------------------
# Call the specialization of MACRO for LANG with ARGS. Complain if
@@ -818,6 +824,9 @@ m4_define([AT_MAIN_DEFINE(d)],
# ------------------------------
m4_copy([AT_DATA], [AT_DATA_GRAMMAR(java)])
# No need to declare, it's part of the class interface.
m4_define([AT_YYERROR_DECLARE(java)], [])
m4_define([AT_YYERROR_DECLARE_EXTERN(java)], [])
# AT_JAVA_POSITION_DEFINE
# -----------------------