diff -u -r Parse-Yapp-0.31/lib/Parse/Yapp/Options.pm Parse-Yapp-0.31.abw/lib/Parse/Yapp/Options.pm
--- Parse-Yapp-0.31/lib/Parse/Yapp/Options.pm	Thu Mar 25 21:41:44 1999
+++ Parse-Yapp-0.31.abw/lib/Parse/Yapp/Options.pm	Tue May 11 11:58:03 1999
@@ -46,6 +46,9 @@
     input       =>  {
         ''      =>  "Input text of grammar"
     },
+    template    => {
+        ''      =>  "Template text for generating grammar file"
+    },
 );
 
 my(%default_options)= (
@@ -54,7 +57,8 @@
     inputfile => undef,
     classname   => 'Parser',
     standalone => 0,
-    input => undef
+    input => undef,
+    template => undef,
 );
 
 my(%actions)= (
diff -u -r Parse-Yapp-0.31/lib/Parse/Yapp/Output.pm Parse-Yapp-0.31.abw/lib/Parse/Yapp/Output.pm
--- Parse-Yapp-0.31/lib/Parse/Yapp/Output.pm	Thu Mar 25 21:46:34 1999
+++ Parse-Yapp-0.31.abw/lib/Parse/Yapp/Output.pm	Tue May 11 12:38:20 1999
@@ -34,7 +34,7 @@
     my($head,$states,$rules,$tail,$driver);
     my($version)=$Parse::Yapp::Driver::VERSION;
     my($datapos);
-    my($text)=<<'EOT';
+    my($text)=$self->Option('template') ||<<'EOT';
 #########################################################################
 #
 #      This file was generated using Parse::Yapp version <<$version>>.
diff -u -r Parse-Yapp-0.31/yapp Parse-Yapp-0.31.abw/yapp
--- Parse-Yapp-0.31/yapp	Wed Apr  7 08:16:29 1999
+++ Parse-Yapp-0.31.abw/yapp	Tue May 11 12:40:54 1999
@@ -14,7 +14,7 @@
 
 =head1 SYNOPSYS
 
-yapp [I<-vns>] [I<-o filename>] [I<-m module>] I<grammar>[.yp]
+yapp [I<-vns>] [I<-o filename>] [I<-m module>] [I<-t filename>] I<grammar>[.yp]
 
 yapp I<-V>
 
@@ -61,6 +61,12 @@
 It defaults to F<grammar>.pm or, if you specified the option
 I<-m A::Module::Name> (see below), to F<Name.pm>.
 
+=item I<-t filename>
+
+The I<-t filename> option allows you to specify a file which should be 
+used as template for generating the parser output.  The default is to 
+use the internal template defined in F<Parse::Yapp::Output.pm>.
+
 =item I<grammar>
 
 The input grammar file. If no suffix is given, and the file does not exists,
@@ -100,13 +106,13 @@
 
 use strict;
 
-use vars qw ( $opt_n $opt_m $opt_V $opt_v $opt_o $opt_h $opt_s );
+use vars qw ( $opt_n $opt_m $opt_V $opt_v $opt_o $opt_h $opt_s $opt_t );
 
 sub Usage {
 	my($prog)=(fileparse($0,'\..*'))[0];
 	die <<EOF;
 Usage:
-	$prog [-m module] [-vsn] [-o filename] grammar[.yp]
+	$prog [-m module] [-vsn] [-o filename] [-t filename ] grammar[.yp]
 or	$prog -V
 or	$prog -h
 
@@ -123,6 +129,10 @@
                 Default is <grammar>.pm or, if -m A::Module::Name is
                 specified, Name.pm
 
+    -t filename Uses the file <filename> as a template for creating the parser
+                module file.  Default is to use internal template defined
+                in Parse::Yapp::Output
+
     grammar     The grammar file. If no suffix is given, and the file
                 does not exists, .yp is added
 
@@ -134,7 +144,7 @@
 
 my($nbargs)=@ARGV;
 
-	getopts('Vhvsnm:o:')
+	getopts('Vhvsnm:t:o:')
 or	Usage;
 
    (  ($opt_V and $nbargs > 1)
@@ -151,6 +161,22 @@
 
 };
 
+
+# -t <filename> ($opt_t) option allows a file to be specified which 
+# contains a 'template' to be used when generating the parser; 
+# if defined, we open and read the file.   
+
+	$opt_t
+and do {
+    local $/ = undef;
+    local *TFILE;
+    open(TFILE, $opt_t)
+	or die "Cannot open template file $opt_t: $!\n";
+    $opt_t = <TFILE>;
+    close(TFILE);
+};
+
+
     @ARGV == 1
 or  Usage;
 
@@ -217,7 +243,9 @@
 
 print OUT $parser->Output(classname  => $package,
                           standalone => $opt_s,
-                          linenumbers => $opt_n);
+                          linenumbers => $opt_n,
+			  template    => $opt_t);
+
 
 close(OUT);
 
