])
+# b4_symbol_foreach(MACRO)
+# ------------------------
+# Invoke MACRO(SYMBOL-NUM) for each SYMBOL-NUM.
+m4_define([b4_symbol_foreach],
+ [m4_map([$1], m4_defn([b4_symbol_numbers]))])
+
+# b4_type_foreach(MACRO)
+# ----------------------
+# Invoke MACRO(SYMBOL-NUMS) for each set of SYMBOL-NUMS for each type set.
+m4_define([b4_type_foreach],
+ [m4_map([$1], m4_defn([b4_type_names]))])
+
+
+
# b4_type_action_(NUMS)
# ---------------------
# Run actions for the symbol NUMS that all have the same type-name.
m4_define([b4_symbol_constructor_declarations],
[b4_variant_if([
// Symbol constructors declarations.
-m4_map([b4_symbol_constructor_declaration_], m4_defn([b4_symbol_numbers]))])])
+b4_symbol_foreach([b4_symbol_constructor_declaration_])])])
]b4_variant_if(
[ // Implementation of make_symbol for each symbol type.
-m4_map([b4_symbol_constructor_definition_], m4_defn([b4_symbol_numbers]))])])
+b4_symbol_foreach([b4_symbol_constructor_definition_])])])
# b4_symbol_variant(YYTYPE, YYVAL, ACTION, [ARGS])
[$2.$3< $][3 >(m4_shift3($@))])dnl
switch ($1)
{
-m4_map([b4_type_action_], m4_defn([b4_type_names]))[]dnl
+b4_type_foreach([b4_type_action_])[]dnl
default:
break;
}
]b4_variant_if(
[ /// An auxiliary type to compute the largest semantic type.
union union_type
- {]m4_map([b4_char_sizeof], m4_defn([b4_type_names]))[};
+ {]b4_type_foreach([b4_char_sizeof])[};
/// Symbol semantic values.
typedef variant<sizeof(union_type)> semantic_type;],
// User destructor.
switch (yytype)
{
-]m4_map([b4_symbol_destructor], m4_defn([b4_symbol_numbers]))dnl
+]b4_symbol_foreach([b4_symbol_destructor])dnl
[ default:
break;
}]b4_variant_if([
<< yysym.location << ": "])[;
switch (yytype)
{
-]m4_map([b4_symbol_printer], m4_defn([b4_symbol_numbers]))dnl
+]b4_symbol_foreach([b4_symbol_printer])dnl
[ default:
break;
}