mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
java: formatting changes
* data/skeletons/java.m4, data/skeletons/lalr1.java: here.
This commit is contained in:
@@ -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[[]
|
||||
{
|
||||
|
||||
@@ -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)])[);
|
||||
}]])[
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
Reference in New Issue
Block a user