#ifndef SYMBOL_H
#define SYMBOL_H

#include <frost_utils.h>

namespace Frost {

class State;

template <class... ArgsInner> struct SymbolTypeSerializer;

class Symbol
{
public :

    Symbol(const s_str& sName) : name(sName), sname(sName) {}
    virtual ~Symbol() {}

    virtual s_str            PrintContent() const;
    virtual s_str            GetType() const;
    virtual s_str            GetTrueType() const;
    virtual s_str            GetFullType() const;
    virtual s_refptr<Symbol> Clone() const;

    static void Register(State& mState);

    s_str name;
    s_str sname;
    static const s_str TYPE;

    template <class... Args>
    static s_str SerializeTypes()
    {
        return SymbolTypeSerializer<Args...>::Func();
    }
};

template <class Current, class... Remain>
struct SymbolTypeSerializer<Current, Remain...>
{
    static s_str Func()
    {
        return Current::TYPE +  + ", " + SymbolTypeSerializer<Remain...>::Func();
    }
};

template <class Current>
struct SymbolTypeSerializer<Current>
{
    static s_str Func()
    {
        return Current::TYPE;
    }
};

template<>
struct SymbolTypeSerializer<>
{
    static s_str Func()
    {
        return "";
    }
};

}

#endif // SYMBOL_H
