+=item C<generate_grammar ($name, $base, @directive)>
+
+Generate F<$base.y> by calling C<&generate_grammar_$name>.
+
+=cut
+
+sub generate_grammar ($$@)
+{
+ my ($name, $base, @directive) = @_;
+ verbose 2, "Generating $base.y\n";
+ my %generator =
+ (
+ "calc" => \&generate_grammar_calc,
+ "triangular" => \&generate_grammar_triangular,
+ "variant" => \&generate_grammar_variant,
+ );
+ &{$generator{$name}}($base, 200, @directive);
+}
+
+##################################################################
+
+=item C<run ($command)>
+
+Run, possibly verbosely, the shell C<$command>.
+
+=cut
+
+sub run ($)
+{
+ my ($command) = @_;
+ verbose 2, "$command\n";
+ system ("$command") == 0
+ or die "$command failed";
+}
+
+##################################################################
+