* data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,

src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
tests/action.at, tests/calc.at, tests/conflicts.at,
tests/cxx-type.at, tests/regression.at:
"parse error" -> "syntax error" for POSIX compatibility.
"parsing stack overflow..." -> "parser stack overflow" so
that code matches Bison documentation.
This commit is contained in:
Paul Eggert
2002-11-15 20:32:21 +00:00
parent 0f39aab92a
commit 6e649e659e
15 changed files with 80 additions and 62 deletions

View File

@@ -360,7 +360,7 @@ static const ]b4_int_type_for([b4_pgoto])[ yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, parse error. */
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF ]b4_table_ninf[
static const ]b4_int_type_for([b4_table])[ yytable[] =
{
@@ -866,8 +866,7 @@ yyexpandGLRStack (yyGLRStack* yystack]b4_pure_formals[)
size_t yyn;
yysize = yystack->yynextFree - yystack->yyitems;
if (YYMAXDEPTH <= yysize)
yyFail (yystack][]b4_pure_args[,
"parsing stack overflow (%d items)", yysize);
yyFail (yystack][]b4_pure_args[, "parser stack overflow");
yynewSize = 2*yysize;
if (YYMAXDEPTH < yynewSize)
yynewSize = YYMAXDEPTH;
@@ -914,8 +913,7 @@ yyexpandGLRStack (yyGLRStack* yystack]b4_pure_formals[)
#else
yyFail (yystack][]b4_lpure_args[,
"parsing stack overflow (%d items)", yysize);
yyFail (yystack][]b4_lpure_args[, "parser stack overflow");
#endif
}
@@ -1596,7 +1594,7 @@ yyreportParseError (yyGLRStack* yystack,
yycount = 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
yysize = sizeof ("parse error, unexpected ")
yysize = sizeof ("syntax error, unexpected ")
+ strlen (yytokenName (*yytokenp));
yyprefix = ", expecting ";
for (yyx = yyn < 0 ? -yyn : 0; yyx < yytname_size && yycount <= 5;
@@ -1605,7 +1603,8 @@ yyreportParseError (yyGLRStack* yystack,
yysize += strlen (yytokenName (yyx)) + strlen (yyprefix),
yycount += 1, yyprefix = " or ";
yymsg = yyp = (char*) malloc (yysize);
sprintf (yyp, "parse error, unexpected %s", yytokenName (*yytokenp));
sprintf (yyp, "syntax error, unexpected %s",
yytokenName (*yytokenp));
yyp += strlen (yyp);
if (yycount < 5)
{
@@ -1623,7 +1622,7 @@ yyreportParseError (yyGLRStack* yystack,
}
else
#endif
yyerror (]b4_lyyerror_args["parse error");
yyerror (]b4_lyyerror_args["syntax error");
yynerrs += 1;
}
}
@@ -1855,7 +1854,7 @@ yyrecoverParseError (yyGLRStack* yystack,
{
yyundeleteLastStack (&yystack);
if (yystack.yytops.yysize == 0)
yyFail (&yystack][]b4_lpure_args[, "parse error");
yyFail (&yystack][]b4_lpure_args[, "syntax error");
YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
yyreportParseError (&yystack, yylvalp, yyllocp]b4_user_args[);

View File

@@ -484,7 +484,7 @@ b4_syncline([@oline@], [@ofile@])
n_ = pact_[[state_]];
if (pact_ninf_ < n_ && n_ < last_)
{
message = "parse error, unexpected ";
message = "syntax error, unexpected ";
message += name_[[ilooka_]];
{
int count = 0;
@@ -505,7 +505,7 @@ b4_syncline([@oline@], [@ofile@])
}
else
#endif
message = "parse error";
message = "syntax error";
error_ ();
}
goto yyerrlab1;

View File

@@ -425,7 +425,7 @@ static const b4_int_type_for([b4_pgoto]) yypgoto[[]] =
/* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, parse error. */
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF b4_table_ninf
static const b4_int_type_for([b4_table]) yytable[[]] =
{
@@ -662,7 +662,7 @@ int yychar;
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of parse errors so far. */
/* Number of syntax errors so far. */
int yynerrs;b4_location_if([
/* Location data for the lookahead symbol. */
YYLTYPE yylloc;])
@@ -1017,12 +1017,12 @@ yyerrlab:
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("parse error, unexpected ") + 1;
yysize += yystrlen ("syntax error, unexpected ") + 1;
yysize += yystrlen (yytname[yytype]);
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
yyp = yystpcpy (yyp, yytname[yytype]);
if (yycount < 5)
@@ -1043,11 +1043,11 @@ yyerrlab:
YYSTACK_FREE (yymsg);
}
else
yyerror (]b4_yyerror_args["parse error; also virtual memory exhausted");
yyerror (]b4_yyerror_args["syntax error; also virtual memory exhausted");
}
else
#endif /* YYERROR_VERBOSE */
yyerror (]b4_yyerror_args["parse error");
yyerror (]b4_yyerror_args["syntax error");
}
goto yyerrlab1;