2023-08-30 18:06:26 +00:00
|
|
|
#ifndef roza_VALUE_HPP
|
|
|
|
#define roza_VALUE_HPP
|
|
|
|
|
|
|
|
#include "commons.hpp"
|
|
|
|
#include "SrcLoc.hpp"
|
|
|
|
#include "Type.hpp"
|
|
|
|
|
|
|
|
namespace roza
|
|
|
|
{
|
|
|
|
class Value
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Value(int value, SrcLoc loc);
|
|
|
|
virtual ~Value();
|
|
|
|
|
2023-08-30 22:31:19 +00:00
|
|
|
SrcLoc loc() const { return m_loc; }
|
|
|
|
int as_int() const { return m_int_val; }
|
2023-08-30 18:06:26 +00:00
|
|
|
std::shared_ptr<Type> type() const { return m_type; }
|
|
|
|
std::string string() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::shared_ptr<Type> m_type;
|
|
|
|
int m_int_val;
|
|
|
|
SrcLoc m_loc;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|