mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 08:43:03 +00:00
* src/bison.simple (YYSTDERR): Remove, replace `stderr'.
The ISO C++ standard is extremely clear about it: stderr is considered a macro, not a regular symbol (see table 94 `Header <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files). Therefore std:: does not apply to it. It still does with fprintf. Also, s/cstdio.h/cstdio/.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2002-01-03 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/bison.simple (YYSTDERR): Remove, replace `stderr'.
|
||||||
|
The ISO C++ standard is extremely clear about it: stderr is
|
||||||
|
considered a macro, not a regular symbol (see table 94 `Header
|
||||||
|
<cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
|
||||||
|
Therefore std:: does not apply to it. It still does with fprintf.
|
||||||
|
Also, s/cstdio.h/cstdio/.
|
||||||
|
|
||||||
2002-01-03 Akim Demaille <akim@epita.fr>
|
2002-01-03 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
|
* lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
|
||||||
|
|||||||
@@ -396,12 +396,11 @@ while (0)
|
|||||||
|
|
||||||
# ifndef YYFPRINTF
|
# ifndef YYFPRINTF
|
||||||
# ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
# include <cstdio.h> /* INFRINGES ON USER NAME SPACE */
|
# include <cstdio> /* INFRINGES ON USER NAME SPACE */
|
||||||
# else
|
# else
|
||||||
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
|
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
|
||||||
# endif
|
# endif
|
||||||
# define YYFPRINTF YYSTD (fprintf)
|
# define YYFPRINTF YYSTD (fprintf)
|
||||||
# define YYSTDERR YYSTD (stderr)
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# define YYDPRINTF(Args) \
|
# define YYDPRINTF(Args) \
|
||||||
@@ -641,7 +640,7 @@ yyparse (YYPARSE_PARAM_ARG)
|
|||||||
rule. */
|
rule. */
|
||||||
int yylen;
|
int yylen;
|
||||||
|
|
||||||
YYDPRINTF ((YYSTDERR, "Starting parse\n"));
|
YYDPRINTF ((stderr, "Starting parse\n"));
|
||||||
|
|
||||||
yystate = 0;
|
yystate = 0;
|
||||||
yyerrstatus = 0;
|
yyerrstatus = 0;
|
||||||
@@ -737,14 +736,14 @@ yyparse (YYPARSE_PARAM_ARG)
|
|||||||
yylsp = yyls + yysize - 1;
|
yylsp = yyls + yysize - 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
YYDPRINTF ((YYSTDERR, "Stack size increased to %lu\n",
|
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
||||||
(unsigned long int) yystacksize));
|
(unsigned long int) yystacksize));
|
||||||
|
|
||||||
if (yyssp >= yyss + yystacksize - 1)
|
if (yyssp >= yyss + yystacksize - 1)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
YYDPRINTF ((YYSTDERR, "Entering state %d\n", yystate));
|
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
||||||
|
|
||||||
goto yybackup;
|
goto yybackup;
|
||||||
|
|
||||||
@@ -770,7 +769,7 @@ yybackup:
|
|||||||
|
|
||||||
if (yychar == YYEMPTY)
|
if (yychar == YYEMPTY)
|
||||||
{
|
{
|
||||||
YYDPRINTF ((YYSTDERR, "Reading a token: "));
|
YYDPRINTF ((stderr, "Reading a token: "));
|
||||||
yychar = YYLEX;
|
yychar = YYLEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,7 +780,7 @@ yybackup:
|
|||||||
yychar1 = 0;
|
yychar1 = 0;
|
||||||
yychar = YYEOF; /* Don't call YYLEX any more. */
|
yychar = YYEOF; /* Don't call YYLEX any more. */
|
||||||
|
|
||||||
YYDPRINTF ((YYSTDERR, "Now at end of input.\n"));
|
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -792,14 +791,14 @@ yybackup:
|
|||||||
which are defined only if `YYDEBUG' is set. */
|
which are defined only if `YYDEBUG' is set. */
|
||||||
if (yydebug)
|
if (yydebug)
|
||||||
{
|
{
|
||||||
YYFPRINTF (YYSTDERR, "Next token is %d (%s",
|
YYFPRINTF (stderr, "Next token is %d (%s",
|
||||||
yychar, yytname[yychar1]);
|
yychar, yytname[yychar1]);
|
||||||
/* Give the individual parser a way to print the precise
|
/* Give the individual parser a way to print the precise
|
||||||
meaning of a token, for further debugging info. */
|
meaning of a token, for further debugging info. */
|
||||||
# ifdef YYPRINT
|
# ifdef YYPRINT
|
||||||
YYPRINT (YYSTDERR, yychar, yylval);
|
YYPRINT (stderr, yychar, yylval);
|
||||||
# endif
|
# endif
|
||||||
YYFPRINTF (YYSTDERR, ")\n");
|
YYFPRINTF (stderr, ")\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -831,7 +830,7 @@ yybackup:
|
|||||||
YYACCEPT;
|
YYACCEPT;
|
||||||
|
|
||||||
/* Shift the lookahead token. */
|
/* Shift the lookahead token. */
|
||||||
YYDPRINTF ((YYSTDERR, "Shifting token %d (%s), ",
|
YYDPRINTF ((stderr, "Shifting token %d (%s), ",
|
||||||
yychar, yytname[yychar1]));
|
yychar, yytname[yychar1]));
|
||||||
|
|
||||||
/* Discard the token being shifted unless it is eof. */
|
/* Discard the token being shifted unless it is eof. */
|
||||||
@@ -893,13 +892,13 @@ yyreduce:
|
|||||||
{
|
{
|
||||||
int yyi;
|
int yyi;
|
||||||
|
|
||||||
YYFPRINTF (YYSTDERR, "Reducing via rule %d (line %d), ",
|
YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
|
||||||
yyn - 1, yyrline[yyn]);
|
yyn - 1, yyrline[yyn]);
|
||||||
|
|
||||||
/* Print the symbols being reduced, and their result. */
|
/* Print the symbols being reduced, and their result. */
|
||||||
for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
|
for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
|
||||||
YYFPRINTF (YYSTDERR, "%s ", yytname[yyrhs[yyi]]);
|
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
|
||||||
YYFPRINTF (YYSTDERR, " -> %s\n", yytname[yyr1[yyn]]);
|
YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
switch (yyn)
|
switch (yyn)
|
||||||
@@ -920,10 +919,10 @@ yyreduce:
|
|||||||
if (yydebug)
|
if (yydebug)
|
||||||
{
|
{
|
||||||
short *yyssp1 = yyss - 1;
|
short *yyssp1 = yyss - 1;
|
||||||
YYFPRINTF (YYSTDERR, "state stack now");
|
YYFPRINTF (stderr, "state stack now");
|
||||||
while (yyssp1 != yyssp)
|
while (yyssp1 != yyssp)
|
||||||
YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
|
YYFPRINTF (stderr, " %d", *++yyssp1);
|
||||||
YYFPRINTF (YYSTDERR, "\n");
|
YYFPRINTF (stderr, "\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1019,7 +1018,7 @@ yyerrlab1:
|
|||||||
/* Return failure if at end of input. */
|
/* Return failure if at end of input. */
|
||||||
if (yychar == YYEOF)
|
if (yychar == YYEOF)
|
||||||
YYABORT;
|
YYABORT;
|
||||||
YYDPRINTF ((YYSTDERR, "Discarding token %d (%s).\n",
|
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
|
||||||
yychar, yytname[yychar1]));
|
yychar, yytname[yychar1]));
|
||||||
yychar = YYEMPTY;
|
yychar = YYEMPTY;
|
||||||
}
|
}
|
||||||
@@ -1065,10 +1064,10 @@ yyerrpop:
|
|||||||
if (yydebug)
|
if (yydebug)
|
||||||
{
|
{
|
||||||
short *yyssp1 = yyss - 1;
|
short *yyssp1 = yyss - 1;
|
||||||
YYFPRINTF (YYSTDERR, "Error: state stack now");
|
YYFPRINTF (stderr, "Error: state stack now");
|
||||||
while (yyssp1 != yyssp)
|
while (yyssp1 != yyssp)
|
||||||
YYFPRINTF (YYSTDERR, " %d", *++yyssp1);
|
YYFPRINTF (stderr, " %d", *++yyssp1);
|
||||||
YYFPRINTF (YYSTDERR, "\n");
|
YYFPRINTF (stderr, "\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1098,7 +1097,7 @@ yyerrhandle:
|
|||||||
if (yyn == YYFINAL)
|
if (yyn == YYFINAL)
|
||||||
YYACCEPT;
|
YYACCEPT;
|
||||||
|
|
||||||
YYDPRINTF ((YYSTDERR, "Shifting error token, "));
|
YYDPRINTF ((stderr, "Shifting error token, "));
|
||||||
|
|
||||||
*++yyvsp = yylval;
|
*++yyvsp = yylval;
|
||||||
#if YYLSP_NEEDED
|
#if YYLSP_NEEDED
|
||||||
|
|||||||
Reference in New Issue
Block a user