Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.235
diff -u -r1.235 output.c
--- src/output.c 24 Jul 2005 07:24:22 -0000 1.235
+++ src/output.c 16 Sep 2005 19:13:00 -0000
@@ -616,8 +616,12 @@
 	skeleton = "yacc.c";
     }
 
-  /* Parse the skeleton file and output the needed parsers.  */
-  MUSCLE_INSERT_C_STRING ("skeleton", skeleton);
+  /* About the skeletons. */
+  {
+    char const* p = getenv ("BISON_PKGDATADIR");
+    MUSCLE_INSERT_STRING ("pkgdatadir", p ? p : PKGDATADIR);
+    MUSCLE_INSERT_C_STRING ("skeleton", skeleton);
+  }
 }
 
 
Index: data/Makefile.am
===================================================================
RCS file: /cvsroot/bison/bison/data/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- data/Makefile.am 14 May 2005 06:49:46 -0000 1.9
+++ data/Makefile.am 16 Sep 2005 19:13:00 -0000
@@ -1,4 +1,4 @@
-## Copyright (C) 2002 Free Software Foundation, Inc.
+## Copyright (C) 2002, 2005 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -15,7 +15,9 @@
 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 ## 02110-1301  USA
 
-dist_pkgdata_DATA = README c.m4 yacc.c lalr1.cc glr.c
+dist_pkgdata_DATA = README \
+   c.m4 yacc.c glr.c \
+   c++.m4 lalr1.cc
 
 m4sugardir = $(pkgdatadir)/m4sugar
 dist_m4sugar_DATA = m4sugar/m4sugar.m4
Index: data/c++.m4
===================================================================
RCS file: data/c++.m4
diff -N data/c++.m4
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ data/c++.m4 16 Sep 2005 19:13:00 -0000
@@ -0,0 +1,121 @@
+m4_divert(-1)
+
+# C++ skeleton for Bison
+
+# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301  USA
+
+## ---------------- ##
+## Default values.  ##
+## ---------------- ##
+
+# Default parser class name.
+m4_define_default([b4_parser_class_name], [parser])
+m4_define_default([b4_location_type], [location])
+m4_define_default([b4_filename_type], [std::string])
+
+
+
+# b4_token_enums(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER)
+# -----------------------------------------------------
+# Output the definition of the tokens (if there are) as enums.
+m4_define([b4_token_enums],
+[m4_if([$@], [[]], [],
+[/* Tokens.  */
+   enum yytokentype {
+m4_map_sep([     b4_token_enum], [,
+],
+           [$@])
+   };
+])])
+
+
+## ----------------- ##
+## Semantic Values.  ##
+## ----------------- ##
+
+
+# b4_lhs_value([TYPE])
+# --------------------
+# Expansion of $<TYPE>$.
+m4_define([b4_lhs_value],
+[(yyval[]m4_ifval([$1], [.$1]))])
+
+
+# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
+# --------------------------------------
+# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
+# symbols on RHS.
+m4_define([b4_rhs_value],
+[(yysemantic_stack_@{m4_eval([$1 - $2])@}m4_ifval([$3], [.$3]))])
+
+# b4_lhs_location()
+# -----------------
+# Expansion of @$.
+m4_define([b4_lhs_location],
+[(yyloc)])
+
+
+# b4_rhs_location(RULE-LENGTH, NUM)
+# ---------------------------------
+# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
+# on RHS.
+m4_define([b4_rhs_location],
+[(yylocation_stack_@{m4_eval([$1 - $2])@})])
+
+
+# b4_parse_param_decl
+# -------------------
+# Extra formal arguments of the constructor.
+# Change the parameter names from "foo" into "foo_yyarg", so that
+# there is no collision bw the user chosen attribute name, and the
+# argument name in the constructor.
+m4_define([b4_parse_param_decl],
+[m4_ifset([b4_parse_param],
+          [m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
+
+m4_define([b4_parse_param_decl_1],
+[$1_yyarg])
+
+
+
+# b4_parse_param_cons
+# -------------------
+# Extra initialisations of the constructor.
+m4_define([b4_parse_param_cons],
+          [m4_ifset([b4_parse_param],
+		    [,
+      b4_cc_constructor_calls(b4_parse_param)])])
+m4_define([b4_cc_constructor_calls],
+	  [m4_map_sep([b4_cc_constructor_call], [,
+      ], [$@])])
+m4_define([b4_cc_constructor_call],
+	  [$2 ($2_yyarg)])
+
+# b4_parse_param_vars
+# -------------------
+# Extra instance variables.
+m4_define([b4_parse_param_vars],
+          [m4_ifset([b4_parse_param],
+		    [
+    /* User arguments.  */
+b4_cc_var_decls(b4_parse_param)])])
+m4_define([b4_cc_var_decls],
+	  [m4_map_sep([b4_cc_var_decl], [
+], [$@])])
+m4_define([b4_cc_var_decl],
+	  [    $1;])
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.97
diff -u -r1.97 lalr1.cc
--- data/lalr1.cc 16 Sep 2005 19:03:54 -0000 1.97
+++ data/lalr1.cc 16 Sep 2005 19:13:01 -0000
@@ -19,95 +19,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301  USA
 
-## ---------------- ##
-## Default values.  ##
-## ---------------- ##
-
-# Default parser class name.
-m4_define_default([b4_parser_class_name], [parser])
-
-
-
-## ----------------- ##
-## Semantic Values.  ##
-## ----------------- ##
-
-
-# b4_lhs_value([TYPE])
-# --------------------
-# Expansion of $<TYPE>$.
-m4_define([b4_lhs_value],
-[(yyval[]m4_ifval([$1], [.$1]))])
-
-
-# b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
-# --------------------------------------
-# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
-# symbols on RHS.
-m4_define([b4_rhs_value],
-[(yysemantic_stack_@{m4_eval([$1 - $2])@}m4_ifval([$3], [.$3]))])
-
-m4_define_default([b4_location_type], [location])
-m4_define_default([b4_filename_type], [std::string])
-
-# b4_lhs_location()
-# -----------------
-# Expansion of @$.
-m4_define([b4_lhs_location],
-[(yyloc)])
-
-
-# b4_rhs_location(RULE-LENGTH, NUM)
-# ---------------------------------
-# Expansion of @NUM, where the current rule has RULE-LENGTH symbols
-# on RHS.
-m4_define([b4_rhs_location],
-[(yylocation_stack_@{m4_eval([$1 - $2])@})])
-
-
-# b4_parse_param_decl
-# -------------------
-# Extra formal arguments of the constructor.
-# Change the parameter names from "foo" into "foo_yyarg", so that
-# there is no collision bw the user chosen attribute name, and the
-# argument name in the constructor.
-m4_define([b4_parse_param_decl],
-[m4_ifset([b4_parse_param],
-          [m4_map_sep([b4_parse_param_decl_1], [, ], [b4_parse_param])])])
-
-m4_define([b4_parse_param_decl_1],
-[$1_yyarg])
-
-
-
-# b4_parse_param_cons
-# -------------------
-# Extra initialisations of the constructor.
-m4_define([b4_parse_param_cons],
-          [m4_ifset([b4_parse_param],
-		    [,
-      b4_cc_constructor_calls(b4_parse_param)])])
-m4_define([b4_cc_constructor_calls],
-	  [m4_map_sep([b4_cc_constructor_call], [,
-      ], [$@])])
-m4_define([b4_cc_constructor_call],
-	  [$2 ($2_yyarg)])
-
-# b4_parse_param_vars
-# -------------------
-# Extra instance variables.
-m4_define([b4_parse_param_vars],
-          [m4_ifset([b4_parse_param],
-		    [
-    /* User arguments.  */
-b4_cc_var_decls(b4_parse_param)])])
-m4_define([b4_cc_var_decls],
-	  [m4_map_sep([b4_cc_var_decl], [
-], [$@])])
-m4_define([b4_cc_var_decl],
-	  [    $1;])
-
-
+m4_include(b4_pkgdatadir/[c++.m4])
 
 # We do want M4 expansion after # for CPP macros.
 m4_changecom()
