java/d: remove useless macros

There are many macros that are defined and used just
once (b4_public_if, b4_abstract_if, etc.).  That's overkill.  Rather,
let's define a macro to build the "public class YYParser" line.

It appears that the same syntax with "extends", "abstract", etc. is
implemented in the D parser, which looks very fishy...

* data/skeletons/d.m4, data/skeletons/java.m4 (b4_public_if)
(b4_abstract_if, b4_final_if, b4_strictfp_if): Replace with
(b4_parser_class_declaration): this.
* data/skeletons/lalr1.d, data/skeletons/lalr1.java: Adjust.
This commit is contained in:
Akim Demaille
2019-01-04 07:43:37 +01:00
parent eb2b5aef0a
commit 230d6c5160
4 changed files with 38 additions and 64 deletions

View File

@@ -95,14 +95,7 @@ b4_output_begin([b4_parser_file_name])[
*
* @@author LALR (1) parser skeleton written by Paolo Bonzini.
*/
]b4_percent_define_get3([annotations], [], [ ])dnl
b4_public_if([public ])dnl
b4_abstract_if([abstract ])dnl
b4_final_if([final ])dnl
b4_strictfp_if([strictfp ])dnl
[class ]b4_parser_class[]dnl
b4_percent_define_get3([extends], [ extends ])dnl
b4_percent_define_get3([implements], [ implements ])[
]b4_parser_class_declaration[
{
]b4_identification[
]b4_error_verbose_if([[
@@ -389,8 +382,7 @@ b4_lexer_if([[
}
// Print the state stack on the debug stream.
public void print (java.io.PrintStream out)
{
public void print (java.io.PrintStream out) {
out.print ("Stack now");
for (int i = 0; i <= height; i++)