From: Akim Demaille Date: Tue, 20 Jun 2006 11:32:19 +0000 (+0000) Subject: Install these changes: X-Git-Tag: v2.3b~361 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/1b818f33ad29193a8ccd1deb2bfec3f6d406d41a?ds=inline Install these changes: * data/c.m4 (b4_union_name): Leave a default value. * data/glr.c, data/yacc.c: Use it. --- diff --git a/data/c.m4 b/data/c.m4 index 46bacfcc..945ab2b9 100644 --- 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])])]) diff --git a/data/glr.c b/data/glr.c index f9b2a71f..45fb79e6 100644 --- a/data/glr.c +++ b/data/glr.c @@ -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@]) diff --git a/data/yacc.c b/data/yacc.c index 02cae1fb..7b1e12c4 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -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@])