java: use SymbolType

The Java enums are very different from the C model.  As a consequence,
one cannot "build" an enum directly from an integer, we must retrieve
it.  That's the purpose of the SymbolType.get class method.

* data/skeletons/java.m4 (b4_symbol_enum, b4_case_code_symbol)
(b4_declare_symbol_enum): New.
* data/skeletons/lalr1.java: Use SymbolType,
SymbolType.YYSYMBOL_YYEMPTY, etc.
* examples/java/calc/Calc.y, tests/local.at: Adjust.
This commit is contained in:
Akim Demaille
2020-03-30 07:45:01 +02:00
parent 7fa23136ca
commit ad31c3cdf4
5 changed files with 102 additions and 48 deletions

3
TODO
View File

@@ -5,6 +5,9 @@
- YYNOMEM
- i18n in Java
** Java
Check api.token.raw
** Naming conventions
yysyntax_error_arguments should be yy_syntax_error_arguments, since it's a
private implementation detail.