* data/lalr1.cc (b4_parse_param_decl_1): New.
authorAkim Demaille <akim@epita.fr>
Mon, 27 Sep 2004 07:45:09 +0000 (07:45 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 27 Sep 2004 07:45:09 +0000 (07:45 +0000)
(b4_parse_param_decl): Use it to have different names bw attribute
and argument names.
(b4_cc_constructor_call): Likewise.

ChangeLog
data/lalr1.cc

index e61781c..8b8c125 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-27  Akim Demaille  <akim@epita.fr>
+
+       * data/lalr1.cc (b4_parse_param_decl_1): New.
+       (b4_parse_param_decl): Use it to have different names bw attribute
+       and argument names.
+       (b4_cc_constructor_call): Likewise.
+
 2004-09-24  Akim Demaille  <akim@epita.fr>
 
        * src/parse-gram.y (add_param): Strip the leading and trailing
index 8ff462a..00090e7 100644 (file)
@@ -83,13 +83,22 @@ m4_define([b4_constructor],
 
 # b4_parse_param_decl
 # -------------------
-#  Constructor's extra arguments.
+# 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], [, b4_c_ansi_formals(b4_parse_param)])])
+[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
 # -------------------
-#  constructor's extra initialisations.
+# Extra initialisations of the constructor.
 m4_define([b4_parse_param_cons],
           [m4_ifset([b4_parse_param],
                    [,
@@ -98,11 +107,11 @@ m4_define([b4_cc_constructor_calls],
          [m4_map_sep([b4_cc_constructor_call], [,
       ], [$@])])
 m4_define([b4_cc_constructor_call],
-         [$2($2)])
+         [$2 ($2_yyarg)])
 
 # b4_parse_param_vars
 # -------------------
-#  Extra instance variables.
+# Extra instance variables.
 m4_define([b4_parse_param_vars],
           [m4_ifset([b4_parse_param],
                    [