summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny@clemson.edu>2009-10-04 14:33:28 -0400
committerJoel E. Denny <jdenny@clemson.edu>2009-10-04 14:35:12 -0400
commit37318e2fe9a8d468088ddb782539f88b3a4c2bb8 (patch)
tree5671b43184dea47d712859e5a3c2939679eb85cb /etc
parentf74d6d25914371ed894583a69f99d547f9f283bf (diff)
downloadbison-37318e2fe9a8d468088ddb782539f88b3a4c2bb8.tar.gz
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.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/bench.pl.in7
1 files changed, 6 insertions, 1 deletions
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 <<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)
{