2023-08-30 18:06:26 +00:00
|
|
|
#ifndef roza_TYPE_HPP
|
|
|
|
#define roza_TYPE_HPP
|
|
|
|
|
|
|
|
#include "commons.hpp"
|
|
|
|
|
|
|
|
#define BASE_TYPE(G) \
|
2023-09-01 20:38:12 +00:00
|
|
|
G(TY_INT), G(TY_BOOL), G(TY_FUN), G(TY_NIL)
|
2023-08-30 18:06:26 +00:00
|
|
|
|
|
|
|
namespace roza
|
|
|
|
{
|
|
|
|
MAKE_ENUM(BASE_TYPE, BaseType)
|
|
|
|
|
|
|
|
class Type
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Type(BaseType base);
|
|
|
|
virtual ~Type();
|
|
|
|
|
|
|
|
BaseType base() const { return m_base; }
|
|
|
|
|
2023-09-01 20:38:12 +00:00
|
|
|
virtual std::string string() const;
|
2023-08-30 22:31:19 +00:00
|
|
|
|
2023-09-01 20:38:12 +00:00
|
|
|
virtual bool equals(BaseType rhs) const;
|
|
|
|
virtual bool equals(Type const& rhs) const;
|
2023-08-30 18:06:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
BaseType m_base;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|