--- a
+++ b/trunk/Cm/Cm.Core/Object.hpp
@@ -0,0 +1,116 @@
+#ifndef CM_CORE_OBJECT_INCLUDED
+#define CM_CORE_OBJECT_INCLUDED
+#include <Cm.Core/Entity.hpp>
+#include <MMix.Machine/Type.hpp>
+#include <MMix.Machine/Util.hpp>
+
+namespace Cm { namespace Core {
+
+using MMix::Machine::Byte;
+using MMix::Machine::Octa;
+using MMix::Machine::OctaToString;
+using Soul::Util::DoubleToString;
+using Soul::Util::CharStr;
+using Soul::Util::StringStr;
+
+class EntityStack;
+
+class Object: public Entity
+{
+public:
+    Object(const String& name_, const Position& pos_, const ScopePtr& parentSccope_, const TypePtr& type_, bool constant_);
+    virtual void Evaluate(EntityStack& stack);
+    virtual bool IsObject() const { return true; }
+    virtual TypePtr GetType() const { return type; }
+    bool IsConstant() const { return constant; }
+    void SetConstant() { constant = true; }
+    virtual bool IsConstExpr() const { return IsConstant(); }
+private:
+    TypePtr type;
+    bool constant;
+};
+
+typedef boost::shared_ptr<Object> ObjectPtr;
+
+template<typename ValueT>
+class ValueObject: public Object
+{
+public:
+    ValueObject(const String& name_, const Position& pos_, const ScopePtr& parentScope_, const TypePtr& type_, bool constant_, const ValueT& value_):
+        Object(name_, pos_, parentScope_, type_, constant_), value(value_) {}
+    const ValueT& Value() const { return value; }
+    ValueT& Value() { return value; }
+private:
+    ValueT value;
+};
+
+class BoolObject: public ValueObject<Byte>
+{
+public:
+    BoolObject(const String& name_, const Position& pos_, bool constant_, bool value_);
+    virtual String ToString() const { return IsTrue() ? "true" : "false"; }
+    virtual bool IsBoolObject() const { return true; }
+    virtual bool IsBoolExpr() const { return true; }
+    virtual bool IsTrue() const { return Value() != 0; }
+    virtual bool IsFalse() const { return !IsTrue(); }
+    virtual bool IsIntegralConstantExpression() const { return true; }
+};
+
+typedef boost::shared_ptr<BoolObject> BoolObjectPtr;
+
+class IntObject: public ValueObject<Octa>
+{
+public:
+    IntObject(const String& name_, const Position& pos_, bool constant_, Octa value_);
+    virtual String ToString() const { return OctaToString(Value()); }
+    virtual bool IsIntObject() const { return true; }
+    virtual bool IsIntegralConstantExpression() const { return true; }
+};
+
+typedef boost::shared_ptr<IntObject> IntObjectPtr;
+
+class DoubleObject: public ValueObject<Octa>
+{
+public:
+    DoubleObject(const String& name_, const Position& pos_, bool constant_, double value_);
+    virtual String ToString() const { return DoubleToString(Value().flt); }
+    virtual bool IsDoubleObject() const { return true; }
+};
+
+typedef boost::shared_ptr<DoubleObject> DoubleObjectPtr;
+
+class CharObject: public ValueObject<Byte>
+{
+public:
+    CharObject(const String& name_, const Position& pos_, bool constant_, char value_);
+    virtual String ToString() const { return "'" + CharStr(static_cast<char>(Value())) + "'"; }
+    virtual bool IsCharObject() const { return true; }
+};
+
+typedef boost::shared_ptr<CharObject> CharObjectPtr;
+
+class StringObject: public ValueObject<String>
+{
+public:
+    StringObject(const String& name_, const Position& pos_, bool constant_, const String& value_);
+    virtual String ToString() const { return "\"" + StringStr(Value()) + "\""; }
+    virtual bool IsStringObject() const { return true; }
+};
+
+typedef boost::shared_ptr<StringObject> StringObjectPtr;
+
+class TypenameObject: public Object
+{
+public:
+    TypenameObject(const String& name_);
+    TypePtr GetType() const { return value; }
+    void SetValue(const TypePtr& value_) { value = value_; }
+private:
+    TypePtr value;
+};
+
+typedef boost::shared_ptr<TypenameObject> TypenameObjectPtr;
+
+} } // namespoace Cm::Core
+
+#endif // CM_CORE_OBJECT_INCLUDED