mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
b4_semantic_type_declare.
* data/c++.m4 (b4_semantic_type_declare): New. Factors and generalizes what was in glr.cc and lalr1.cc. * data/variant.hh (b4_semantic_type_declare): Redefine it for variants. * data/lalr1.cc, data/glr.cc: Use it.
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user