benchmarks: use %debug consistently among grammars.

* etc/bench.pl.in (generate_grammar_triangular): Do not activate
%debug by default.  It can affect the timings even if yydebug=0.
(generate_grammar_calc): For consistency with other grammars,
use YYDEBUG environment variable to set yydebug.
This commit is contained in:
Joel E. Denny
2009-10-04 14:33:28 -04:00
parent f74d6d2591
commit 37318e2fe9
2 changed files with 14 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
2009-10-04 Joel E. Denny <jdenny@clemson.edu>
benchmarks: use %debug consistently among grammars.
* etc/bench.pl.in (generate_grammar_triangular): Do not activate
%debug by default. It can affect the timings even if yydebug=0.
(generate_grammar_calc): For consistency with other grammars,
use YYDEBUG environment variable to set yydebug.
2009-10-03 Joel E. Denny <jdenny@clemson.edu>
Remove dead code.

View File

@@ -246,7 +246,6 @@ sub generate_grammar_triangular ($$@)
or die;
print $out <<EOF;
%error-verbose
%debug
%{
#include <stdio.h>
#include <stdlib.h>
@@ -318,7 +317,9 @@ yyerror (const char *msg)
int
main (void)
{
#if YYDEBUG
yydebug = !!getenv ("YYDEBUG");
#endif
return yyparse ();
}
EOF
@@ -543,6 +544,10 @@ main (int argc, const char **argv)
int count = 0;
int status;
#if YYDEBUG
yydebug = !!getenv ("YYDEBUG");
#endif
input = fopen ("calc.input", "r");
if (!input)
{