]> git.saurik.com Git - bison.git/blobdiff - data/c++.m4
Merge remote-tracking branch 'origin/maint'
[bison.git] / data / c++.m4
index 22b3375abac79c9bb76d7e8bcdf4b37bdc7f7505..f1468c708086ebe6bdad5cab3c4728acbeb1ea95 100644 (file)
@@ -2,8 +2,7 @@
 
 # C++ skeleton for Bison
 
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 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
@@ -25,7 +24,12 @@ m4_include(b4_pkgdatadir/[c.m4])
 ## ---------------- ##
 
 b4_percent_define_default([[parser_class_name]], [[parser]])
-b4_percent_define_default([[location_type]], [[location]])
+
+# Don't do that so that we remember whether we're using a user
+# request, or the default value.
+#
+# b4_percent_define_default([[location_type]], [[location]])
+
 b4_percent_define_default([[filename_type]], [[std::string]])
 b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
 
@@ -95,6 +99,8 @@ m4_map_sep([     b4_token_enum], [,
 ])
 
 
+
+
 ## ----------------- ##
 ## Semantic Values.  ##
 ## ----------------- ##
@@ -124,7 +130,8 @@ m4_define([b4_public_types_declare],
     typedef YYSTYPE semantic_type;
 #endif]b4_locations_if([
     /// Symbol locations.
-    typedef b4_percent_define_get([[location_type]]) location_type;])[
+    typedef b4_percent_define_get([[location_type]],
+                                  [[location]]) location_type;])[
 
     /// Syntax errors thrown from user actions.
     struct syntax_error : std::runtime_error
@@ -400,24 +407,24 @@ m4_define([b4_parse_param_decl_1],
 # 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_map_sep([b4_cc_constructor_call], [,
       ], [$@])])
 m4_define([b4_cc_constructor_call],
-         [$2 ($2_yyarg)])
+          [$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_map_sep([b4_cc_var_decl], [
 ], [$@])])
 m4_define([b4_cc_var_decl],
-         [    $1;])
+          [    $1;])