#ifndef roza_VALUE_HPP #define roza_VALUE_HPP #include "commons.hpp" #include "SrcLoc.hpp" #include "Type.hpp" namespace roza { class Fun; class Value { public: explicit Value(int value, SrcLoc loc); explicit Value(bool value, SrcLoc loc); explicit Value(std::shared_ptr value, SrcLoc loc); virtual ~Value(); SrcLoc loc() const { return m_loc; } int as_int() const { return m_int_val; } bool as_bool() const { return m_bool_val; } std::shared_ptr as_fun() const { return m_fun_val; } std::shared_ptr type() const { return m_type; } std::string string() const; bool equals(Value const& rhs) const; private: std::shared_ptr m_type; int m_int_val; bool m_bool_val; std::shared_ptr m_fun_val; SrcLoc m_loc; }; } #endif