]> git.saurik.com Git - bison.git/commitdiff
Install these changes:
authorAkim Demaille <akim@epita.fr>
Tue, 20 Jun 2006 11:32:19 +0000 (11:32 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 20 Jun 2006 11:32:19 +0000 (11:32 +0000)
* data/c.m4 (b4_union_name): Leave a default value.
* data/glr.c, data/yacc.c: Use it.

data/c.m4
data/glr.c
data/yacc.c

index 46bacfcc3c742c210cc81a87fa1474181c101975..945ab2b97357cb25cd7be38154ea16e6acba9070 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -88,7 +88,8 @@ m4_define([b4_identification],
 
 m4_define_default([b4_epilogue], [])
 
-
+# If the %union is not named, its name is YYSTYPE.
+m4_define_default([b4_union_name], [YYSTYPE])
 
 ## ------------------------ ##
 ## Pure/impure interfaces.  ##
@@ -196,7 +197,7 @@ m4_define([b4_define_flag_if],
 m4_define([_b4_define_flag_if],
 [m4_if([$1$2], $[1]$[2], [],
        [m4_fatal([$0: Invalid arguments: $@])])dnl
-m4_define([b4_$3_if], 
+m4_define([b4_$3_if],
           [b4_flag_if([$3], [$1], [$2])])])
 
 
index f9b2a71f46f9036749d7a145715424c251a8d0e8..45fb79e6a2d24f197311122deb8d39e3c4f780f7 100644 (file)
@@ -173,7 +173,7 @@ m4_define([b4_shared_declarations],
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 ]m4_ifdef([b4_stype],
-[typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])
+[typedef union b4_union_name
 b4_stype
 /* Line __line__ of glr.c.  */
 b4_syncline([@oline@], [@ofile@])
index 02cae1fb318fcb5da48aedcf24c61c12fdc0d726..7b1e12c46f9ecff6e58b3e266d37f01141d9de6f 100644 (file)
@@ -185,7 +185,7 @@ b4_locations_if([#define yylloc b4_prefix[]lloc])])[
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 ]m4_ifdef([b4_stype],
-[typedef union[]m4_bregexp(b4_stype, [^{], [ YYSTYPE])
+[typedef union b4_union_name
 b4_stype
 /* Line __line__ of yacc.c.  */
 b4_syncline([@oline@], [@ofile@])
@@ -1495,7 +1495,7 @@ b4_token_enums_defines(b4_tokens)
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 m4_ifdef([b4_stype],
-[typedef union[]m4_bregexp(b4_stype, [^{], [ YYSTYPE])
+[typedef union b4_union_name
 b4_stype
 /* Line __line__ of yacc.c.  */
 b4_syncline([@oline@], [@ofile@])