Work around Java's ``code too large'' problem for parser tables.

* data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
* data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
(yytname_): Use b4_typed_parser_table.
* doc/bison.texinfo (Java Bison Interface): Add note on Java's
``code too large'' error.
This commit is contained in:
Di-an Jan
2008-11-10 14:34:36 +01:00
committed by Paolo Bonzini
parent 1979121c96
commit 09ccae9b18
4 changed files with 52 additions and 67 deletions

View File

@@ -117,6 +117,25 @@ m4_define([b4_int_type_for],
m4_define([b4_null], [null])
# b4_typed_parser_table(TYPE, NAME, DATA)
# ---------------------------------------
m4_define([b4_typed_parser_table],
[[private static final ]$1[ $2[] = $2init();
private static final ]$1[[] $2init()
{
return new ]$1[[]
{
]$3[
};
}]])
# b4_integral_parser_table(NAME, DATA)
#-------------------------------------
m4_define([b4_integral_parser_table],
[b4_typed_parser_table([b4_int_type_for([$2])], [$1], [$2])])
## ------------------------- ##
## Assigning token numbers. ##
## ------------------------- ##