]> git.saurik.com Git - bison.git/blobdiff - data/variant.hh
b4_semantic_type_declare.
[bison.git] / data / variant.hh
index 893673383d8fe741f7c0960462a710818da1809e..1534b903d3fbfffd3bb106baa97ab9aaa50b3fa9 100644 (file)
@@ -189,6 +189,18 @@ m4_define([b4_variant_definition],
 ## -------------------------- ##
 
 
+# b4_semantic_type_declare
+# ------------------------
+# Declare semantic_type.
+m4_define([b4_semantic_type_declare],
+[    /// An auxiliary type to compute the largest semantic type.
+    union union_type
+    {]b4_type_foreach([b4_char_sizeof])[};
+
+    /// Symbol semantic values.
+    typedef variant<sizeof(union_type)> semantic_type;])
+
+
 # How the semantic value is extracted when using variants.
 
 # b4_symbol_value(VAL, [TYPE])