mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 12:53:03 +00:00
Get rid of tabulations in the Java output.
Test 214 was failing: it greps with a pattern containing [ ]* which obviously meant to catch spaces and tabs, but contained only tabs. Tabulations in sources are a nuisance, so to simplify the matter, get rid of all the tabulations in the Java sources. The other skeletons will be treated equally later. * data/java.m4, data/lalr1.java: Untabify. * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations: tabulations are no longer generated.
This commit is contained in:
42
data/java.m4
42
data/java.m4
@@ -29,7 +29,7 @@ m4_define([b4_comment], [/* m4_bpatsubst([$1], [
|
|||||||
# --------------------------
|
# --------------------------
|
||||||
# Join two lists with a comma if necessary.
|
# Join two lists with a comma if necessary.
|
||||||
m4_define([b4_list2],
|
m4_define([b4_list2],
|
||||||
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
|
[$1[]m4_ifval(m4_quote($1), [m4_ifval(m4_quote($2), [[, ]])])[]$2])
|
||||||
|
|
||||||
|
|
||||||
# b4_percent_define_get3(DEF, PRE, POST, NOT)
|
# b4_percent_define_get3(DEF, PRE, POST, NOT)
|
||||||
@@ -37,8 +37,8 @@ m4_define([b4_list2],
|
|||||||
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
|
# Expand to the value of DEF surrounded by PRE and POST if it's %define'ed,
|
||||||
# otherwise NOT.
|
# otherwise NOT.
|
||||||
m4_define([b4_percent_define_get3],
|
m4_define([b4_percent_define_get3],
|
||||||
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
[m4_ifval(m4_quote(b4_percent_define_get([$1])),
|
||||||
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
|
[$2[]b4_percent_define_get([$1])[]$3], [$4])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ m4_define([b4_identification],
|
|||||||
m4_define([b4_int_type],
|
m4_define([b4_int_type],
|
||||||
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
[m4_if(b4_ints_in($@, [-128], [127]), [1], [byte],
|
||||||
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
b4_ints_in($@, [-32768], [32767]), [1], [short],
|
||||||
[int])])
|
[int])])
|
||||||
|
|
||||||
# b4_int_type_for(NAME)
|
# b4_int_type_for(NAME)
|
||||||
# ---------------------
|
# ---------------------
|
||||||
@@ -250,11 +250,11 @@ m4_define([b4_parse_param], b4_parse_param)
|
|||||||
m4_define([b4_lex_param_decl],
|
m4_define([b4_lex_param_decl],
|
||||||
[m4_ifset([b4_lex_param],
|
[m4_ifset([b4_lex_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_decls(b4_lex_param))],
|
b4_param_decls(b4_lex_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
m4_define([b4_param_decls],
|
m4_define([b4_param_decls],
|
||||||
[m4_map([b4_param_decl], [$@])])
|
[m4_map([b4_param_decl], [$@])])
|
||||||
m4_define([b4_param_decl], [, $1])
|
m4_define([b4_param_decl], [, $1])
|
||||||
|
|
||||||
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
||||||
@@ -267,8 +267,8 @@ m4_define([b4_remove_comma], [m4_ifval(m4_quote($1), [$1, ], [])m4_shift2($@)])
|
|||||||
m4_define([b4_parse_param_decl],
|
m4_define([b4_parse_param_decl],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_decls(b4_parse_param))],
|
b4_param_decls(b4_parse_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -277,11 +277,11 @@ m4_define([b4_parse_param_decl],
|
|||||||
# Delegating the lexer parameters to the lexer constructor.
|
# Delegating the lexer parameters to the lexer constructor.
|
||||||
m4_define([b4_lex_param_call],
|
m4_define([b4_lex_param_call],
|
||||||
[m4_ifset([b4_lex_param],
|
[m4_ifset([b4_lex_param],
|
||||||
[b4_remove_comma([$1],
|
[b4_remove_comma([$1],
|
||||||
b4_param_calls(b4_lex_param))],
|
b4_param_calls(b4_lex_param))],
|
||||||
[$1])])
|
[$1])])
|
||||||
m4_define([b4_param_calls],
|
m4_define([b4_param_calls],
|
||||||
[m4_map([b4_param_call], [$@])])
|
[m4_map([b4_param_call], [$@])])
|
||||||
m4_define([b4_param_call], [, $2])
|
m4_define([b4_param_call], [, $2])
|
||||||
|
|
||||||
|
|
||||||
@@ -291,13 +291,13 @@ m4_define([b4_param_call], [, $2])
|
|||||||
# Extra initialisations of the constructor.
|
# Extra initialisations of the constructor.
|
||||||
m4_define([b4_parse_param_cons],
|
m4_define([b4_parse_param_cons],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[b4_constructor_calls(b4_parse_param)])])
|
[b4_constructor_calls(b4_parse_param)])])
|
||||||
|
|
||||||
m4_define([b4_constructor_calls],
|
m4_define([b4_constructor_calls],
|
||||||
[m4_map([b4_constructor_call], [$@])])
|
[m4_map([b4_constructor_call], [$@])])
|
||||||
m4_define([b4_constructor_call],
|
m4_define([b4_constructor_call],
|
||||||
[this.$2 = $2;
|
[this.$2 = $2;
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -306,15 +306,15 @@ m4_define([b4_constructor_call],
|
|||||||
# Extra instance variables.
|
# Extra instance variables.
|
||||||
m4_define([b4_parse_param_vars],
|
m4_define([b4_parse_param_vars],
|
||||||
[m4_ifset([b4_parse_param],
|
[m4_ifset([b4_parse_param],
|
||||||
[
|
[
|
||||||
/* User arguments. */
|
/* User arguments. */
|
||||||
b4_var_decls(b4_parse_param)])])
|
b4_var_decls(b4_parse_param)])])
|
||||||
|
|
||||||
m4_define([b4_var_decls],
|
m4_define([b4_var_decls],
|
||||||
[m4_map_sep([b4_var_decl], [
|
[m4_map_sep([b4_var_decl], [
|
||||||
], [$@])])
|
], [$@])])
|
||||||
m4_define([b4_var_decl],
|
m4_define([b4_var_decl],
|
||||||
[ protected final $1;])
|
[ protected final $1;])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -322,4 +322,4 @@ m4_define([b4_var_decl],
|
|||||||
# -----------------------
|
# -----------------------
|
||||||
# Expand to either an empty string or "throws THROWS".
|
# Expand to either an empty string or "throws THROWS".
|
||||||
m4_define([b4_maybe_throws],
|
m4_define([b4_maybe_throws],
|
||||||
[m4_ifval($1, [throws $1])])
|
[m4_ifval($1, [throws $1])])
|
||||||
|
|||||||
198
data/lalr1.java
198
data/lalr1.java
@@ -264,24 +264,24 @@ b4_lexer_if([[
|
|||||||
public int height = -1;
|
public int height = -1;
|
||||||
|
|
||||||
public final void push (int state, ]b4_yystype[ value]dnl
|
public final void push (int state, ]b4_yystype[ value]dnl
|
||||||
b4_locations_if([, ]b4_location_type[ loc])[) {
|
b4_locations_if([, ]b4_location_type[ loc])[) {
|
||||||
height++;
|
height++;
|
||||||
if (size == height)
|
if (size == height)
|
||||||
{
|
{
|
||||||
int[] newStateStack = new int[size * 2];
|
int[] newStateStack = new int[size * 2];
|
||||||
System.arraycopy (stateStack, 0, newStateStack, 0, height);
|
System.arraycopy (stateStack, 0, newStateStack, 0, height);
|
||||||
stateStack = newStateStack;
|
stateStack = newStateStack;
|
||||||
]b4_locations_if([[
|
]b4_locations_if([[
|
||||||
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
|
]b4_location_type[[] newLocStack = new ]b4_location_type[[size * 2];
|
||||||
System.arraycopy (locStack, 0, newLocStack, 0, height);
|
System.arraycopy (locStack, 0, newLocStack, 0, height);
|
||||||
locStack = newLocStack;]])
|
locStack = newLocStack;]])
|
||||||
|
|
||||||
b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2];
|
b4_yystype[[] newValueStack = new ]b4_yystype[[size * 2];
|
||||||
System.arraycopy (valueStack, 0, newValueStack, 0, height);
|
System.arraycopy (valueStack, 0, newValueStack, 0, height);
|
||||||
valueStack = newValueStack;
|
valueStack = newValueStack;
|
||||||
|
|
||||||
size *= 2;
|
size *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
stateStack[height] = state;
|
stateStack[height] = state;
|
||||||
]b4_locations_if([[locStack[height] = loc;]])[
|
]b4_locations_if([[locStack[height] = loc;]])[
|
||||||
@@ -295,7 +295,7 @@ b4_lexer_if([[
|
|||||||
public final void pop (int num) {
|
public final void pop (int num) {
|
||||||
// Avoid memory leaks... garbage collection is a white lie!
|
// Avoid memory leaks... garbage collection is a white lie!
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
java.util.Arrays.fill (valueStack, height - num + 1, height, null);
|
java.util.Arrays.fill (valueStack, height - num + 1, height, null);
|
||||||
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
|
]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
|
||||||
}
|
}
|
||||||
height -= num;
|
height -= num;
|
||||||
@@ -320,8 +320,8 @@ b4_lexer_if([[
|
|||||||
|
|
||||||
for (int i = 0; i < height; i++)
|
for (int i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
out.print (' ');
|
out.print (' ');
|
||||||
out.print (stateStack[i]);
|
out.print (stateStack[i]);
|
||||||
}
|
}
|
||||||
out.println ();
|
out.println ();
|
||||||
}
|
}
|
||||||
@@ -384,8 +384,8 @@ b4_lexer_if([[
|
|||||||
|
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
]b4_user_actions[
|
]b4_user_actions[
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[);
|
yy_symbol_print ("-> $$ =", yyr1_[yyn], yyval]b4_locations_if([, yyloc])[);
|
||||||
@@ -397,7 +397,7 @@ b4_lexer_if([[
|
|||||||
yyn = yyr1_[yyn];
|
yyn = yyr1_[yyn];
|
||||||
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
int yystate = yypgoto_[yyn - yyntokens_] + yystack.stateAt (0);
|
||||||
if (0 <= yystate && yystate <= yylast_
|
if (0 <= yystate && yystate <= yylast_
|
||||||
&& yycheck_[yystate] == yystack.stateAt (0))
|
&& yycheck_[yystate] == yystack.stateAt (0))
|
||||||
yystate = yytable_[yystate];
|
yystate = yytable_[yystate];
|
||||||
else
|
else
|
||||||
yystate = yydefgoto_[yyn - yyntokens_];
|
yystate = yydefgoto_[yyn - yyntokens_];
|
||||||
@@ -425,7 +425,7 @@ b4_lexer_if([[
|
|||||||
break strip_quotes;
|
break strip_quotes;
|
||||||
|
|
||||||
case '\\':
|
case '\\':
|
||||||
if (yystr.charAt(++i) != '\\')
|
if (yystr.charAt(++i) != '\\')
|
||||||
break strip_quotes;
|
break strip_quotes;
|
||||||
/* Fall through. */
|
/* Fall through. */
|
||||||
default:
|
default:
|
||||||
@@ -448,14 +448,14 @@ b4_lexer_if([[
|
|||||||
`--------------------------------*/
|
`--------------------------------*/
|
||||||
|
|
||||||
private void yy_symbol_print (String s, int yytype,
|
private void yy_symbol_print (String s, int yytype,
|
||||||
]b4_yystype[ yyvaluep]dnl
|
]b4_yystype[ yyvaluep]dnl
|
||||||
b4_locations_if([, Object yylocationp])[)
|
b4_locations_if([, Object yylocationp])[)
|
||||||
{
|
{
|
||||||
if (yydebug > 0)
|
if (yydebug > 0)
|
||||||
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
|
yycdebug (s + (yytype < yyntokens_ ? " token " : " nterm ")
|
||||||
+ yytname_[yytype] + " ("]b4_locations_if([
|
+ yytname_[yytype] + " ("]b4_locations_if([
|
||||||
+ yylocationp + ": "])[
|
+ yylocationp + ": "])[
|
||||||
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
+ (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -513,7 +513,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
switch (label)
|
switch (label)
|
||||||
{
|
{
|
||||||
/* New state. Unlike in the C/C++ skeletons, the state is already
|
/* New state. Unlike in the C/C++ skeletons, the state is already
|
||||||
pushed when we come here. */
|
pushed when we come here. */
|
||||||
case YYNEWSTATE:
|
case YYNEWSTATE:
|
||||||
yycdebug ("Entering state " + yystate + "\n");
|
yycdebug ("Entering state " + yystate + "\n");
|
||||||
if (yydebug > 0)
|
if (yydebug > 0)
|
||||||
@@ -528,7 +528,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
if (yyn == yypact_ninf_)
|
if (yyn == yypact_ninf_)
|
||||||
{
|
{
|
||||||
label = YYDEFAULT;
|
label = YYDEFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read a lookahead token. */
|
/* Read a lookahead token. */
|
||||||
@@ -550,9 +550,9 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yytoken = yytranslate_ (yychar);
|
yytoken = yytranslate_ (yychar);
|
||||||
yy_symbol_print ("Next token is", yytoken,
|
yy_symbol_print ("Next token is", yytoken,
|
||||||
yylval]b4_locations_if([, yylloc])[);
|
yylval]b4_locations_if([, yylloc])[);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
/* If the proper action on seeing token YYTOKEN is to reduce or to
|
||||||
@@ -564,20 +564,20 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
/* <= 0 means reduce or error. */
|
/* <= 0 means reduce or error. */
|
||||||
else if ((yyn = yytable_[yyn]) <= 0)
|
else if ((yyn = yytable_[yyn]) <= 0)
|
||||||
{
|
{
|
||||||
if (yyn == 0 || yyn == yytable_ninf_)
|
if (yyn == 0 || yyn == yytable_ninf_)
|
||||||
label = YYFAIL;
|
label = YYFAIL;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yyn = -yyn;
|
yyn = -yyn;
|
||||||
label = YYREDUCE;
|
label = YYREDUCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Shift the lookahead token. */
|
/* Shift the lookahead token. */
|
||||||
yy_symbol_print ("Shifting", yytoken,
|
yy_symbol_print ("Shifting", yytoken,
|
||||||
yylval]b4_locations_if([, yylloc])[);
|
yylval]b4_locations_if([, yylloc])[);
|
||||||
|
|
||||||
/* Discard the token being shifted. */
|
/* Discard the token being shifted. */
|
||||||
yychar = yyempty_;
|
yychar = yyempty_;
|
||||||
@@ -610,7 +610,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
case YYREDUCE:
|
case YYREDUCE:
|
||||||
yylen = yyr2_[yyn];
|
yylen = yyr2_[yyn];
|
||||||
label = yyaction (yyn, yystack, yylen);
|
label = yyaction (yyn, yystack, yylen);
|
||||||
yystate = yystack.stateAt (0);
|
yystate = yystack.stateAt (0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*------------------------------------.
|
/*------------------------------------.
|
||||||
@@ -620,8 +620,8 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
/* If not already recovering from an error, report this error. */
|
/* If not already recovering from an error, report this error. */
|
||||||
if (yyerrstatus_ == 0)
|
if (yyerrstatus_ == 0)
|
||||||
{
|
{
|
||||||
++yynerrs_;
|
++yynerrs_;
|
||||||
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
yyerror (]b4_locations_if([yylloc, ])[yysyntax_error (yystate, yytoken));
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([yyerrloc = yylloc;])[
|
]b4_locations_if([yyerrloc = yylloc;])[
|
||||||
@@ -637,7 +637,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
yychar = yyempty_;
|
yychar = yyempty_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Else will try to reuse lookahead token after shifting the error
|
/* Else will try to reuse lookahead token after shifting the error
|
||||||
@@ -663,46 +663,46 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
||||||
`-------------------------------------------------------------*/
|
`-------------------------------------------------------------*/
|
||||||
case YYERRLAB1:
|
case YYERRLAB1:
|
||||||
yyerrstatus_ = 3; /* Each real token shifted decrements this. */
|
yyerrstatus_ = 3; /* Each real token shifted decrements this. */
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
yyn = yypact_[yystate];
|
yyn = yypact_[yystate];
|
||||||
if (yyn != yypact_ninf_)
|
if (yyn != yypact_ninf_)
|
||||||
{
|
{
|
||||||
yyn += yyterror_;
|
yyn += yyterror_;
|
||||||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
|
||||||
{
|
{
|
||||||
yyn = yytable_[yyn];
|
yyn = yytable_[yyn];
|
||||||
if (0 < yyn)
|
if (0 < yyn)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pop the current state because it cannot handle the error token. */
|
/* Pop the current state because it cannot handle the error token. */
|
||||||
if (yystack.height == 1)
|
if (yystack.height == 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
|
||||||
yystack.pop ();
|
yystack.pop ();
|
||||||
yystate = yystack.stateAt (0);
|
yystate = yystack.stateAt (0);
|
||||||
if (yydebug > 0)
|
if (yydebug > 0)
|
||||||
yystack.print (yyDebugStream);
|
yystack.print (yyDebugStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_locations_if([
|
]b4_locations_if([
|
||||||
/* Muck with the stack to setup for yylloc. */
|
/* Muck with the stack to setup for yylloc. */
|
||||||
yystack.push (0, null, yylloc);
|
yystack.push (0, null, yylloc);
|
||||||
yystack.push (0, null, yyerrloc);
|
yystack.push (0, null, yyerrloc);
|
||||||
yyloc = yylloc (yystack, 2);
|
yyloc = yylloc (yystack, 2);
|
||||||
yystack.pop (2);])[
|
yystack.pop (2);])[
|
||||||
|
|
||||||
/* Shift the error token. */
|
/* Shift the error token. */
|
||||||
yy_symbol_print ("Shifting", yystos_[yyn],
|
yy_symbol_print ("Shifting", yystos_[yyn],
|
||||||
yylval]b4_locations_if([, yyloc])[);
|
yylval]b4_locations_if([, yyloc])[);
|
||||||
|
|
||||||
yystate = yyn;
|
yystate = yyn;
|
||||||
yystack.push (yyn, yylval]b4_locations_if([, yyloc])[);
|
yystack.push (yyn, yylval]b4_locations_if([, yyloc])[);
|
||||||
label = YYNEWSTATE;
|
label = YYNEWSTATE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -724,34 +724,34 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
int yyn = yypact_[yystate];
|
int yyn = yypact_[yystate];
|
||||||
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
if (yypact_ninf_ < yyn && yyn <= yylast_)
|
||||||
{
|
{
|
||||||
StringBuffer res;
|
StringBuffer res;
|
||||||
|
|
||||||
/* Start YYX at -YYN if negative to avoid negative indexes in
|
/* Start YYX at -YYN if negative to avoid negative indexes in
|
||||||
YYCHECK. */
|
YYCHECK. */
|
||||||
int yyxbegin = yyn < 0 ? -yyn : 0;
|
int yyxbegin = yyn < 0 ? -yyn : 0;
|
||||||
|
|
||||||
/* Stay within bounds of both yycheck and yytname. */
|
/* Stay within bounds of both yycheck and yytname. */
|
||||||
int yychecklim = yylast_ - yyn + 1;
|
int yychecklim = yylast_ - yyn + 1;
|
||||||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
for (int x = yyxbegin; x < yyxend; ++x)
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
// FIXME: This method of building the message is not compatible
|
// FIXME: This method of building the message is not compatible
|
||||||
// with internationalization.
|
// with internationalization.
|
||||||
res = new StringBuffer ("syntax error, unexpected ");
|
res = new StringBuffer ("syntax error, unexpected ");
|
||||||
res.append (yytnamerr_ (yytname_[tok]));
|
res.append (yytnamerr_ (yytname_[tok]));
|
||||||
if (count < 5)
|
if (count < 5)
|
||||||
{
|
{
|
||||||
count = 0;
|
count = 0;
|
||||||
for (int x = yyxbegin; x < yyxend; ++x)
|
for (int x = yyxbegin; x < yyxend; ++x)
|
||||||
if (yycheck_[x + yyn] == x && x != yyterror_)
|
if (yycheck_[x + yyn] == x && x != yyterror_)
|
||||||
{
|
{
|
||||||
res.append (count++ == 0 ? ", expecting " : " or ");
|
res.append (count++ == 0 ? ", expecting " : " or ");
|
||||||
res.append (yytnamerr_ (yytname_[x]));
|
res.append (yytnamerr_ (yytname_[x]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res.toString ();
|
return res.toString ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -822,14 +822,14 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
int yynrhs = yyr2_[yyrule];
|
int yynrhs = yyr2_[yyrule];
|
||||||
/* Print the symbols being reduced, and their result. */
|
/* Print the symbols being reduced, and their result. */
|
||||||
yycdebug ("Reducing stack by rule " + (yyrule - 1)
|
yycdebug ("Reducing stack by rule " + (yyrule - 1)
|
||||||
+ " (line " + yylno + "), ");
|
+ " (line " + yylno + "), ");
|
||||||
|
|
||||||
/* The symbols being reduced. */
|
/* The symbols being reduced. */
|
||||||
for (int yyi = 0; yyi < yynrhs; yyi++)
|
for (int yyi = 0; yyi < yynrhs; yyi++)
|
||||||
yy_symbol_print (" $" + (yyi + 1) + " =",
|
yy_symbol_print (" $" + (yyi + 1) + " =",
|
||||||
yyrhs_[yyprhs_[yyrule] + yyi],
|
yyrhs_[yyprhs_[yyrule] + yyi],
|
||||||
]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
|
]b4_rhs_value(yynrhs, yyi + 1)b4_locations_if([,
|
||||||
b4_rhs_location(yynrhs, yyi + 1)])[);
|
b4_rhs_location(yynrhs, yyi + 1)])[);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ AT_LOCATION_IF([[
|
|||||||
]], [[
|
]], [[
|
||||||
public void yyerror (String s)
|
public void yyerror (String s)
|
||||||
{
|
{
|
||||||
System.err.println (s);
|
System.err.println (s);
|
||||||
}
|
}
|
||||||
]])[
|
]])[
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ _AT_CHECK_JAVA_CALC_ERROR([$1], [/dev/null],
|
|||||||
# first error is ")", which is needed to recover from the error and
|
# first error is ")", which is needed to recover from the error and
|
||||||
# produce the "0" that triggers the "0 != 1" error.
|
# produce the "0" that triggers the "0 != 1" error.
|
||||||
#
|
#
|
||||||
_AT_CHECK_JAVA_CALC_ERROR([$1],
|
_AT_CHECK_JAVA_CALC_ERROR([$1],
|
||||||
[() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1],
|
[() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1],
|
||||||
[1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
|
[1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
|
||||||
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
|
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
|
||||||
@@ -459,7 +459,7 @@ m4_define([AT_CHECK_JAVA_MINIMAL_W_LEXER],
|
|||||||
{
|
{
|
||||||
$3
|
$3
|
||||||
}
|
}
|
||||||
|
|
||||||
$4
|
$4
|
||||||
}], [$5], [$7])])
|
}], [$5], [$7])])
|
||||||
|
|
||||||
@@ -591,7 +591,7 @@ AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer) *]])
|
|||||||
AT_CHECK_JAVA_MINIMAL([[%parse-param {int parse_param1}]])
|
AT_CHECK_JAVA_MINIMAL([[%parse-param {int parse_param1}]])
|
||||||
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer, *int parse_param1) *]])
|
AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer, *int parse_param1) *]])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param1 = parse_param1;]])
|
||||||
|
|
||||||
AT_CHECK_JAVA_MINIMAL([[
|
AT_CHECK_JAVA_MINIMAL([[
|
||||||
%parse-param {int parse_param1}
|
%parse-param {int parse_param1}
|
||||||
@@ -599,8 +599,8 @@ AT_CHECK_JAVA_MINIMAL([[
|
|||||||
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
||||||
AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *]])
|
AT_CHECK_JAVA_GREP([[ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *]])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param1 = parse_param1;]])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param2 = parse_param2;]])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param2 = parse_param2;]])
|
||||||
|
|
||||||
AT_CHECK_JAVA_MINIMAL_W_LEXER([], [], [[return EOF;]])
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([], [], [[return EOF;]])
|
||||||
AT_CHECK_JAVA_GREP([[ *public YYParser () *]])
|
AT_CHECK_JAVA_GREP([[ *public YYParser () *]])
|
||||||
@@ -611,7 +611,7 @@ AT_CHECK_JAVA_MINIMAL_W_LEXER([[%parse-param {int parse_param1}]],
|
|||||||
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
||||||
AT_CHECK_JAVA_GREP([[ *public YYParser (int parse_param1) *]])
|
AT_CHECK_JAVA_GREP([[ *public YYParser (int parse_param1) *]])
|
||||||
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1) *]])
|
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1) *]])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]], [2])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param1 = parse_param1;]], [2])
|
||||||
|
|
||||||
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
|
||||||
%parse-param {int parse_param1}
|
%parse-param {int parse_param1}
|
||||||
@@ -621,8 +621,8 @@ AT_CHECK_JAVA_GREP([[ *protected final int parse_param1;]])
|
|||||||
AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
||||||
AT_CHECK_JAVA_GREP([[ *public YYParser (int parse_param1, *long parse_param2) *]])
|
AT_CHECK_JAVA_GREP([[ *public YYParser (int parse_param1, *long parse_param2) *]])
|
||||||
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *]])
|
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *]])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]], [2])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param1 = parse_param1;]], [2])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param2 = parse_param2;]], [2])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param2 = parse_param2;]], [2])
|
||||||
|
|
||||||
AT_CHECK_JAVA_MINIMAL_W_LEXER([[%lex-param {char lex_param1}]],
|
AT_CHECK_JAVA_MINIMAL_W_LEXER([[%lex-param {char lex_param1}]],
|
||||||
[], [[return EOF;]], [[YYLexer (char lex_param1) {}]])
|
[], [[return EOF;]], [[YYLexer (char lex_param1) {}]])
|
||||||
@@ -647,8 +647,8 @@ AT_CHECK_JAVA_GREP([[ *protected final long parse_param2;]])
|
|||||||
AT_CHECK_JAVA_GREP([[ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) *]])
|
AT_CHECK_JAVA_GREP([[ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) *]])
|
||||||
AT_CHECK_JAVA_GREP([[.* = new YYLexer *(lex_param1, *lex_param2);]])
|
AT_CHECK_JAVA_GREP([[.* = new YYLexer *(lex_param1, *lex_param2);]])
|
||||||
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *]])
|
AT_CHECK_JAVA_GREP([[ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *]])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param1 = parse_param1;]], [2])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param1 = parse_param1;]], [2])
|
||||||
AT_CHECK_JAVA_GREP([[[ ]*this.parse_param2 = parse_param2;]], [2])
|
AT_CHECK_JAVA_GREP([[ *this.parse_param2 = parse_param2;]], [2])
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user