java: add support for parse.error=detailed

In Java there is no need for N_ and yytranslate_.  So instead of
hard-coding the use of N_ in the table of the symbol names, rely on
b4_symbol_translate.

* src/output.c (prepare_symbol_names): Use b4_symbol_translate instead
of N_.
* data/skeletons/c.m4 (b4_symbol_translate): New.
* data/skeletons/lalr1.java (yysymbolName): New.
Use it.
* examples/java/calc/Calc.y: Use parse.error=detailed.
* tests/calc.at: Check parse.error=detailed.
This commit is contained in:
Akim Demaille
2020-02-06 08:25:44 +01:00
parent 650b253843
commit 52db24b2bc
6 changed files with 91 additions and 46 deletions

View File

@@ -470,6 +470,13 @@ m4_define([b4_token_enums_defines],
[b4_token_enums[]b4_yacc_if([b4_token_defines])])
# b4_symbol_translate(STRING)
# ---------------------------
m4_define([b4_symbol_translate],
[[N_($1)]])
## ----------------- ##
## Semantic Values. ##
## ----------------- ##