For example,
$ bench.pl -v '%s lalr1.cc & %d variant & ( %b ~/old-bison/bin/bison
| %b ~/new-bison/bin/bison )' -g list -i 10000
* etc/bench.pl.in: Here.
| directives & directives -- Concatenation
| [ directives> ] -- Optional
| ( directives> ) -- Parentheses
| directives & directives -- Concatenation
| [ directives> ] -- Optional
| ( directives> ) -- Parentheses
+ | %b PATH -- Use bison at PATH for this bench
| #d NAME[=VALUE] -- %code { #define NAME [VALUE] }
| %d NAME[=VALUE] -- %define NAME ["VALUE"]
| %s skeleton -- %skeleton "skeleton"
| #d NAME[=VALUE] -- %code { #define NAME [VALUE] }
| %d NAME[=VALUE] -- %define NAME ["VALUE"]
| %s skeleton -- %skeleton "skeleton"
my $compiler = $language eq 'C++' ? $cxx : $cc;
my $compiler = $language eq 'C++' ? $cxx : $cc;
- run "$bison $base.y -o $base.c";
+ my $my_bison = `sed -ne '/%bison "\\(.*\\)"/{s//\\1/;p;q;}' $base.y`;
+ run ((length $my_bison ? $my_bison : $bison) . " $base.y -o $base.c");
run "$compiler -o $base $cflags $base.c";
}
run "$compiler -o $base $cflags $base.c";
}
@res = ("%skeleton \"$token[0]\"");
shift @token;
}
@res = ("%skeleton \"$token[0]\"");
shift @token;
}
+ elsif ($token[0] eq '%b')
+ {
+ shift @token;
+ @res = ("/*\n%bison \"$token[0]\"\\\n*/");
+ shift @token;
+ }