[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] java: formatting changes
From: |
Akim Demaille |
Subject: |
[PATCH 7/9] java: formatting changes |
Date: |
Sun, 2 Feb 2020 15:26:25 +0100 |
* data/skeletons/java.m4, data/skeletons/lalr1.java: here.
---
data/skeletons/java.m4 | 4 ++--
data/skeletons/lalr1.java | 22 +++++++++++-----------
tests/javapush.at | 4 ++--
tests/local.at | 2 +-
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/data/skeletons/java.m4 b/data/skeletons/java.m4
index 83e2ec6c..c9d249f5 100644
--- a/data/skeletons/java.m4
+++ b/data/skeletons/java.m4
@@ -109,8 +109,8 @@ m4_define([b4_null], [null])
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()
+[private static final ]$1[ yy$2_[] = yy$2_init ();
+ private static final ]$1[[] yy$2_init ()
{
return new ]$1[[]
{
diff --git a/data/skeletons/lalr1.java b/data/skeletons/lalr1.java
index 23983704..ecdd70b0 100644
--- a/data/skeletons/lalr1.java
+++ b/data/skeletons/lalr1.java
@@ -49,9 +49,9 @@ b4_use_push_for_pull_if([
b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
[m4_define([b4_push_flag], [[1]])])])
-# Define a macro to encapsulate the parse state variables.
-# This allows them to be defined either in parse() when doing
-# pull parsing, or as class instance variable when doing push parsing.
+# Define a macro to encapsulate the parse state variables. This
+# allows them to be defined either in parse() when doing pull parsing,
+# or as class instance variable when doing push parsing.
m4_define([b4_define_state],[[
/* Lookahead and lookahead in internal form. */
int yychar = yyempty_;
@@ -239,7 +239,7 @@ m4_define([b4_define_state],[[
public ]b4_parser_class
(b4_parse_param_decl([b4_lex_param_decl])[)]b4_maybe_throws([b4_init_throws])[
{
]b4_percent_code_get([[init]])[
- this.yylexer = new YYLexer(]b4_lex_param_call[);
+ this.yylexer = new YYLexer (]b4_lex_param_call[);
]b4_parse_param_cons[
}
]])[
@@ -267,7 +267,7 @@ m4_define([b4_define_state],[[
* Set the <tt>PrintStream</tt> on which the debug output is printed.
* @@param s The stream that is used for debugging output.
*/
- public final void setDebugStream(java.io.PrintStream s) { yyDebugStream = s;
}
+ public final void setDebugStream (java.io.PrintStream s) { yyDebugStream =
s; }
private int yydebug = 0;
@@ -275,14 +275,14 @@ m4_define([b4_define_state],[[
* Answer the verbosity of the debugging output; 0 means that all kinds of
* output from the parser are suppressed.
*/
- public final int getDebugLevel() { return yydebug; }
+ public final int getDebugLevel () { return yydebug; }
/**
* Set the verbosity of the debugging output; 0 means that all kinds of
* output from the parser are suppressed.
* @@param level The verbosity level for debugging output.
*/
- public final void setDebugLevel(int level) { yydebug = level; }
+ public final void setDebugLevel (int level) { yydebug = level; }
]])[
/**
@@ -775,8 +775,8 @@ b4_dollar_popdef[]dnl
}
if (label == YYABORT)
- /* Leave the switch. */
- break;
+ /* Leave the switch. */
+ break;
]b4_locations_if([[
/* Muck with the stack to setup for yylloc. */
@@ -811,7 +811,7 @@ b4_dollar_popdef[]dnl
/**
* (Re-)Initialize the state of the push parser.
*/
- public void push_parse_initialize()
+ public void push_parse_initialize ()
{
/* Lookahead and lookahead in internal form. */
this.yychar = yyempty_;
@@ -1002,7 +1002,7 @@ b4_dollar_popdef[]dnl
/* The symbols being reduced. */
for (int yyi = 0; yyi < yynrhs; yyi++)
yySymbolPrint (" $" + (yyi + 1) + " =",
- yystos_[yystack.stateAt(yynrhs - (yyi + 1))],
+ yystos_[yystack.stateAt (yynrhs - (yyi + 1))],
]b4_rhs_data(yynrhs, yyi + 1)b4_locations_if([,
b4_rhs_location(yynrhs, yyi + 1)])[);
}]])[
diff --git a/tests/javapush.at b/tests/javapush.at
index 4f79c006..6d933e0b 100644
--- a/tests/javapush.at
+++ b/tests/javapush.at
@@ -595,7 +595,7 @@ AT_BISON_CHECK([PUSHPULLFLAG [-o Calc.java Calc.y]])
AT_JAVA_COMPILE([[Calc.java]])
# Verify that this is a push parser.
AT_CHECK_JAVA_GREP([[Calc.java]],
- [[.*public void push_parse_initialize().*]])
+ [[.*public void push_parse_initialize ().*]])
# Capture stderr output for comparison purposes.
AT_JAVA_PARSER_CHECK([Calc input], 0, [ignore-nolog], [stderr-nolog])
# Extract the "Stack Now" lines from the error output,
@@ -855,7 +855,7 @@ AT_BISON_CHECK([PUSHPULLFLAG [-o Calc.java Calc.y]])
AT_JAVA_COMPILE([[Calc.java]])
# Verify that this is a push parser
AT_CHECK_JAVA_GREP([[Calc.java]],
- [[.*public void push_parse_initialize().*]])
+ [[.*public void push_parse_initialize ().*]])
# Capture the stdout and stderr output for comparison purposes.
AT_JAVA_PARSER_CHECK([Calc input], 0, [stdout-nolog], [stderr-nolog])
# 1. Check that the token locations are correct
diff --git a/tests/local.at b/tests/local.at
index 8fc9a1d6..20c7cd0d 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -845,7 +845,7 @@ m4_define([AT_JAVA_POSITION_DEFINE],
public String toString ()
{
- return Integer.toString (line) + "." + Integer.toString(token);
+ return Integer.toString (line) + "." + Integer.toString (token);
}
public int lineno ()
--
2.25.0
- [PATCH 0/9] Prepare Java for parse.error custom|detailed, Akim Demaille, 2020/02/02
- [PATCH 2/9] tests: comment changes, Akim Demaille, 2020/02/02
- [PATCH 4/9] java: example: improve, Akim Demaille, 2020/02/02
- [PATCH 1/9] skeletons: add support for %code epilogue, Akim Demaille, 2020/02/02
- [PATCH 3/9] java: example: rely on autoboxing, Akim Demaille, 2020/02/02
- [PATCH 5/9] java: example: properly track the locations, Akim Demaille, 2020/02/02
- [PATCH 7/9] java: formatting changes,
Akim Demaille <=
- [PATCH 8/9] java: add access to the number of errors, Akim Demaille, 2020/02/02
- [PATCH 6/9] java: avoid trailing white spaces, Akim Demaille, 2020/02/02
- [PATCH 9/9] java: use the same calc tests as the other skeletons, Akim Demaille, 2020/02/02