enum class Tag_    

    defines the tags that are associated with the various semantic value
    types. Examples of tags:

        VECTOR,
        TEXTTYPE,

namespace Meta_

    1. defines struct templates TagOf that, when provided with the actual data
       types, provide the associated Tag_ as
            TagOf<data-type>::tag
       Example:

        template <>
        struct TagOf<FlexTypes::TextType>
        {
            static Tag_ const tag = Tag_::TEXTTYPE;
        };

    2. defines struct templates TypeOf that, when provided with a tag,
       provides the associated data type as 
            typename TypeOf<Tag_>::type
       Example:

        template <>
        struct TypeOf<Tag_::VECTOR>
        {
            typedef std::vector<std::string> type;
        };

%polymorphic and %union support tag/field checks. Correct type assignments for
missing rules is checked in parser/handleproductionelement.cc and
parser/checkemptyblocktype.cc

See also parser/indextooffset.cc for a description how $-indices are converted
to offsets.


Class organization and inner working of polymorphic values
==========================================================

    During a short time interval the Meta_ class Base implemented polymorphic
behavior without using virtual members. Although this is possible, it also
results in a somewhat artificial implementation, as C++ offers a clean
definition and implentation of polymorphism. Therefore, shortly after
releasing bisonc++ 5.00.00 bisonc++ now generates a standard polymorphic
implementation of the class Meta_::Base.

The class Meta_::Base has the following interface:

    class Base
    {
        protected:
            Tag_ d_baseTag;    // The tag is assigned by Semantic.
    
        public:
            Base();
            Base(Base const &other) = delete;
    
            virtual ~Base();
    
            Tag_ tag() const;
            Base *clone() const;
            void *data() const;        
    
        private:
            virtual void *vData() const;
            virtual Base *vClone() const;
    };

Base is used as Semantic<Tag_> class template's base class, where the various
semantic value types are distinguished by their associated
Tags. Semantic<Tag_>'s interface is:

    template <Tag_ tg_>
    class Semantic: public Base
    {
        typedef typename TypeOf<tg_>::type SemType;
        SemType d_data;
        
        public:
            Semantic();
            Semantic(Semantic<tg_> const &other);
    
            template <typename ...Params>
            Semantic(Params &&...params);
    
        private:
            Base *vClone() const override;
            void *vData() const override;
    };

Semantic<Tag_> implementations implement a wrapper class around the various
semantic values. Each instantiation offers a SemType semantic value data type
(explicitly defined here to simplify references to it) and a SemType d_data
member.

The data member can be initialized by default (using SemType's default
constructor) or any available other constructor can be used (through
Semantic(Params)'s constructor, perfectly forwarding its arguments to d_data's
constructor. 


The generated parser's STYPE_ is the class Meta_::SType. It is a wrapper
aound a Base *d_base data member. The d_base pointer either points to a plain
Base object (not offering any usable data, but simplifying SType's
implementation somewhat because tests for 0-pointers can be omitted) ) or to a
Semantic<Tag_> object, containing an associated SemType value. Meta_::SType
offers this interface:

    class SType
    {
        Base *d_base;
    
        public:
            SType();
            SType(SType const &other);
            SType(SType &&tmp);
    
            ~SType();
    
                // Specific overloads are needed for SType = SType assignments
            SType &operator=(SType const &rhs);
            SType &operator=(SType &&tmp);
    
                // A template member operator= is used because it allows
                // the compiler to deduce the appropriate typename
            template <typename Type>
            SType &operator=(Type const &value);
    
            template <Tag_ tag, typename ...Args>
            void assign(Args &&...args);
        
            template <Tag_ tag>
            typename TypeOf<tag>::type &get();
    
            template <Tag_ tag>
            typename TypeOf<tag>::type const &get() const;
    
            Tag_ tag() const;
    
            bool valid() const;
    
            void swap(SType &other);
    };

SType offers the usual arsenal of constructors and assignment operators, SType
objects can be constructed by default (initializing d_base to point to a Base
object), from an existing SType object, or from an existing SemType object, in
which case d_base will point to a new, copy constructed SemType. In the latter
case Type must be a defined polymorphic semantic type, as this allows the
compiler to deduct the correct Tag_. If raw arguments are available from
which a SemType can be constructed the assign member can be used, which
requires an explicit Tag_ template value argument.

The two get members call the same Base::data member. This member calls the
virtual member vData, returning the SemType value stored in the
Semantic<Tag_> object to where d_base points, or throwing an
exception. Once the SType object goes out of scope it calls delete d_base,
destroying the object to where d_base points. 



    // The class SType wraps a pointer to Base.  It becomes the polymorphic
    // STYPE_ type It also defines a get member, allowing constructions like
    // $$.get<INT> to be used.  Instantiations of its operator= member
    // template are used to assign semantic values to the SType object.


            // By default the get()-members check whether the specified <tag>
            // matches the tag returned by SType::tag (d_data's tag). If they
            // don't match a run-time fatal error results.
