]> git.saurik.com Git - bison.git/blobdiff - data/glr.c
* NEWS: Instead of %union, you can define and use your own union type
[bison.git] / data / glr.c
index 8da2048716cb8f9151075109e5dbdc7d790ff724..836df5032c72d646cea95dd866ca80b558d37aa5 100644 (file)
@@ -175,14 +175,15 @@ m4_define([b4_shared_declarations],
 
 b4_token_enums(b4_tokens)
 
-[#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+[#ifndef YYSTYPE
 ]m4_ifdef([b4_stype],
-[typedef union b4_union_name
-b4_user_stype
-       YYSTYPE;],
-[typedef int YYSTYPE;])[
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
+[[typedef union ]b4_union_name[
+]b4_user_stype[
+       YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]],
+[m4_if(b4_tag_seen_flag, 0,
+[[typedef int YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1]])])[
 #endif
 
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED