-# b4_symbol_constructor_declaration_(SYMBOL-NUMBER)
-# -------------------------------------------------
-# Declare the overloaded version of make_symbol for the (common) type of
-# these SYMBOL-NUMBERS. Use at class-level.
-m4_define([b4_symbol_constructor_declaration_],
-[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
-[ static inline
- symbol_type
- make_[]b4_symbol_([$1], [id]) (dnl
-b4_args(b4_symbol_if([$1], [has_type],
- [const b4_symbol([$1], [type])& v]),
- b4_locations_if([const location_type& l])));
-
-])])])
-
-
-# b4_symbol_constructor_declarations
-# ----------------------------------
-# Declare symbol constructors for all the value types.
-# Use at class-level.
-m4_define([b4_symbol_constructor_declarations],
-[b4_variant_if([
- // Symbol constructors declarations.
-b4_symbol_foreach([b4_symbol_constructor_declaration_])])])
-
-
-
-# b4_symbol_constructor_definition_(SYMBOL-NUMBER)
-# ------------------------------------------------
-# Define symbol constructor for this SYMBOL-NUMBER.
-m4_define([b4_symbol_constructor_definition_],
-[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
-[ b4_parser_class_name::symbol_type
- b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl
-b4_args(b4_symbol_if([$1], [has_type],
- [const b4_symbol([$1], [type])& v]),
- b4_locations_if([const location_type& l])))
- {
- return symbol_type (b4_args([yytranslate_ (token::b4_symbol([$1], [id]))],
- b4_symbol_if([$1], [has_type], [v]),
- b4_locations_if([l])));
- }
-
-])])])
-
-
-# b4_symbol_constructor_definitions
-# ----------------------------------
-# Define the overloaded versions of make_symbol for all the value types.
-m4_define([b4_symbol_constructor_definitions],
-[b4_variant_if([
- // Implementation of make_symbol for each symbol type.
-b4_symbol_foreach([b4_symbol_constructor_definition_])])])
-
-
-# b4_yytranslate_definition
-# -------------------------
-# Define yytranslate_. Sometimes we want it in the header file,
-# sometimes the cc file suffices.
-m4_define([b4_yytranslate_definition],
-[[ // Symbol number corresponding to token number t.
- ]b4_parser_class_name[::token_number_type
- ]b4_parser_class_name[::yytranslate_ (]b4_lex_symbol_if([token_type],
- [int])[ t)
- {
- static
- const token_number_type
- translate_table[] =
- {
-]b4_translate[
- };
- const unsigned int user_token_number_max_ = ]b4_user_token_number_max[;
- const token_number_type undef_token_ = ]b4_undef_token_number[;
-
- if (static_cast<int>(t) <= yyeof_)
- return yyeof_;
- else if (static_cast<unsigned int> (t) <= user_token_number_max_)
- return translate_table[t];
- else
- return undef_token_;
- }
-]])
-