From 37318e2fe9a8d468088ddb782539f88b3a4c2bb8 Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Sun, 4 Oct 2009 14:33:28 -0400 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ etc/bench.pl.in | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1ea72b2f..a813d694 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-10-04 Joel E. Denny + + 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 Remove dead code. diff --git a/etc/bench.pl.in b/etc/bench.pl.in index 2290fd28..cfa055d3 100755 --- a/etc/bench.pl.in +++ b/etc/bench.pl.in @@ -246,7 +246,6 @@ sub generate_grammar_triangular ($$@) or die; print $out < #include @@ -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) { -- 2.45.2