# Java language support for Bison
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
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()
+# b4_typed_parser_table_define(TYPE, NAME, DATA, COMMENT)
+# -------------------------------------------------------
+m4_define([b4_typed_parser_table_define],
+[m4_ifval([$4], [b4_comment([$4])
+ ])dnl
+[private static final ]$1[ yy$2_[] = yy$2_init();
+ private static final ]$1[[] yy$2_init()
{
return new ]$1[[]
{
}]])
-# b4_integral_parser_table(NAME, DATA)
-#-------------------------------------
-m4_define([b4_integral_parser_table],
-[b4_typed_parser_table([b4_int_type_for([$2])], [$1], [$2])])
+# b4_integral_parser_table_define(NAME, DATA, COMMENT)
+#-----------------------------------------------------
+m4_define([b4_integral_parser_table_define],
+[b4_typed_parser_table_define([b4_int_type_for([$2])], [$1], [$2], [$3])])
## ------------------------- ##
# Output the definition of this token as an enum.
m4_define([b4_token_enum],
[ /** Token number, to be returned by the scanner. */
- static final int $1 = $2;
+ static final int b4_percent_define_get([api.tokens.prefix])$1 = $2;
])
m4_define([b4_parse_param], b4_parse_param)
# b4_lex_param_decl
-# -------------------
+# -----------------
# Extra formal arguments of the constructor.
m4_define([b4_lex_param_decl],
[m4_ifset([b4_lex_param],
# b4_lex_param_call
-# -------------------
+# -----------------
# Delegating the lexer parameters to the lexer constructor.
m4_define([b4_lex_param_call],
[m4_ifset([b4_lex_param],