- : value(v)]b4_locations_if([
- , location(l)])[
- {
- }
-
- template <typename Exact>
- const Exact&
- ]b4_parser_class_name[::symbol_base_type<Exact>::self () const
- {
- return static_cast<const Exact&>(*this);
- }
-
- template <typename Exact>
- Exact&
- ]b4_parser_class_name[::symbol_base_type<Exact>::self ()
- {
- return static_cast<Exact&>(*this);
- }
-
- template <typename Exact>
- int
- ]b4_parser_class_name[::symbol_base_type<Exact>::type_get () const
- {
- return self ().type_get_ ();
- }
+ : Base (t)
+ , value (]b4_variant_if([], [v])[)]b4_locations_if([
+ , location (l)])[
+ {]b4_variant_if([[
+ (void) v;
+ ]b4_symbol_variant([this->type_get ()], [value], [copy], [v])])[}
+
+]b4_variant_if([[
+ // Implementation of basic_symbol constructor for each type.
+]b4_type_foreach([b4_basic_symbol_constructor_define])], [[
+ /// Constructor for valueless symbols.
+ template <typename Base>
+ inline
+ ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
+ [typename Base::kind_type t],
+ b4_locations_if([const location_type& l]))[)
+ : Base (t)
+ , value ()]b4_locations_if([
+ , location (l)])[
+ {}]])[
+
+ template <typename Base>
+ inline
+ ]b4_parser_class_name[::basic_symbol<Base>::~basic_symbol ()
+ {]b4_variant_if([[
+ // User destructor.
+ symbol_number_type yytype = this->type_get ();
+ switch (yytype)
+ {
+]b4_symbol_foreach([b4_symbol_destructor])dnl
+[ default:
+ break;
+ }