remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
One `#if YYDEBUG' remains, since it uses variables which are
defined only if `YYDEBUG != 0'.
+2000-03-16 Akim Demaille <akim@epita.fr>
+
+ * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
+ remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
+ One `#if YYDEBUG' remains, since it uses variables which are
+ defined only if `YYDEBUG != 0'.
+
2000-03-16 Akim Demaille <akim@epita.fr>
* src/bison.s1 (yyparse): Reorganize the definitions of the stacks
2000-03-16 Akim Demaille <akim@epita.fr>
* src/bison.s1 (yyparse): Reorganize the definitions of the stacks
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
-/* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
+
+ /* [The following comment makes no sense to me. Could someone
+ clarify it? --akim] Since this is uninitialized, it does not
+ stop multiple parsers from coexisting. */
+#else
+ /* To avoid crippling this file with `#if YYDEBUG', define `yydebug'
+ as `0', so that the `if (yydebug)' be removed as dead code. */
+# define yydebug 0
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
- fprintf(stderr, "Starting parse\n");
-#endif
+ fprintf (stderr, "Starting parse\n");
yystate = 0;
yyerrstatus = 0;
yystate = 0;
yyerrstatus = 0;
yylsp = yyls + size - 1;
#endif
yylsp = yyls + size - 1;
#endif
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
+ fprintf (stderr, "Stack size increased to %d\n", yystacksize);
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
- fprintf(stderr, "Entering state %d\n", yystate);
-#endif
+ fprintf (stderr, "Entering state %d\n", yystate);
- fprintf(stderr, "Reading a token: ");
-#endif
+ fprintf (stderr, "Reading a token: ");
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
- fprintf(stderr, "Now at end of input.\n");
-#endif
+ fprintf (stderr, "Now at end of input.\n");
}
else
{
yychar1 = YYTRANSLATE(yychar);
}
else
{
yychar1 = YYTRANSLATE(yychar);
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
# endif
fprintf (stderr, ")\n");
}
# endif
fprintf (stderr, ")\n");
}
/* Shift the lookahead token. */
/* Shift the lookahead token. */
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
+ fprintf (stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
+#if YYDEBUG
+ /* We have to keep this `#if YYDEBUG', since we use variables which
+ are defined only if `YYDEBUG' is set. */
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
$ /* the action file gets copied in in place of this dollarsign */
#line 543 "bison.simple"
\f
$ /* the action file gets copied in in place of this dollarsign */
#line 543 "bison.simple"
\f
if (yydebug)
{
short *ssp1 = yyss - 1;
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
if (yychar == YYEOF)
YYABORT;
if (yychar == YYEOF)
YYABORT;
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
+ fprintf (stderr, "Discarding token %d (%s).\n",
+ yychar, yytname[yychar1]);
if (yydebug)
{
short *ssp1 = yyss - 1;
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
if (yyn == YYFINAL)
YYACCEPT;
if (yyn == YYFINAL)
YYACCEPT;
- fprintf(stderr, "Shifting error token, ");
-#endif
+ fprintf (stderr, "Shifting error token, ");
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
#if YYDEBUG != 0
int yydebug; /* nonzero means print parse trace */
-/* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
+
+ /* [The following comment makes no sense to me. Could someone
+ clarify it? --akim] Since this is uninitialized, it does not
+ stop multiple parsers from coexisting. */
+#else
+ /* To avoid crippling this file with `#if YYDEBUG', define `yydebug'
+ as `0', so that the `if (yydebug)' be removed as dead code. */
+# define yydebug 0
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
- fprintf(stderr, "Starting parse\n");
-#endif
+ fprintf (stderr, "Starting parse\n");
yystate = 0;
yyerrstatus = 0;
yystate = 0;
yyerrstatus = 0;
yylsp = yyls + size - 1;
#endif
yylsp = yyls + size - 1;
#endif
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
+ fprintf (stderr, "Stack size increased to %d\n", yystacksize);
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
- fprintf(stderr, "Entering state %d\n", yystate);
-#endif
+ fprintf (stderr, "Entering state %d\n", yystate);
- fprintf(stderr, "Reading a token: ");
-#endif
+ fprintf (stderr, "Reading a token: ");
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
- fprintf(stderr, "Now at end of input.\n");
-#endif
+ fprintf (stderr, "Now at end of input.\n");
}
else
{
yychar1 = YYTRANSLATE(yychar);
}
else
{
yychar1 = YYTRANSLATE(yychar);
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
if (yydebug)
{
fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
# endif
fprintf (stderr, ")\n");
}
# endif
fprintf (stderr, ")\n");
}
/* Shift the lookahead token. */
/* Shift the lookahead token. */
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
+ fprintf (stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
+#if YYDEBUG
+ /* We have to keep this `#if YYDEBUG', since we use variables which
+ are defined only if `YYDEBUG' is set. */
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
$ /* the action file gets copied in in place of this dollarsign */
#line 543 "bison.simple"
\f
$ /* the action file gets copied in in place of this dollarsign */
#line 543 "bison.simple"
\f
if (yydebug)
{
short *ssp1 = yyss - 1;
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
if (yychar == YYEOF)
YYABORT;
if (yychar == YYEOF)
YYABORT;
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
+ fprintf (stderr, "Discarding token %d (%s).\n",
+ yychar, yytname[yychar1]);
if (yydebug)
{
short *ssp1 = yyss - 1;
if (yydebug)
{
short *ssp1 = yyss - 1;
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
if (yyn == YYFINAL)
YYACCEPT;
if (yyn == YYFINAL)
YYACCEPT;
- fprintf(stderr, "Shifting error token, ");
-#endif
+ fprintf (stderr, "Shifting error token, ");
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED