Nicolas Winkler преди 6 години
родител
ревизия
7d5ae02681
променени са 2 файла, в които са добавени 77 реда и са изтрити 0 реда
  1. 23 0
      src/Type.cpp
  2. 54 0
      src/Type.h

+ 23 - 0
src/Type.cpp

@@ -0,0 +1,23 @@
+#include "Type.h"
+
+
+using namespace qlow;
+
+sem::Type::~Type(void)
+{
+}
+
+
+bool sem::ClassType::isNative(void) const
+{
+    return false;
+}
+
+
+bool sem::NativeType::isNative(void) const
+{
+    return true;
+}
+
+
+

+ 54 - 0
src/Type.h

@@ -0,0 +1,54 @@
+#ifndef QLOW_SEM_TYPE_H
+#define QLOW_SEM_TYPE_H
+
+namespace qlow
+{
+    namespace sem
+    {
+        // forward declarations
+        class Class;
+    }
+
+
+    namespace sem
+    {
+        class Type;
+
+        class ClassType;
+        class NativeType;
+    }
+}
+
+
+class qlow::sem::Type
+{
+public:
+    virtual ~Type(void);
+
+    virtual bool isNative(void) const = 0;
+};
+
+
+class qlow::sem::ClassType : public Type
+{
+    Class* classType;
+public:
+
+    inline ClassType(Class* classType) :
+        classType{ classType } {}
+
+    Class* getClass(void) { return classType; }
+
+    virtual bool isNative(void) const;
+};
+
+
+class qlow::sem::NativeType : public Type
+{
+public:
+
+    virtual bool isNative(void) const;
+};
+
+
+#endif // QLOW_SEM_TYPE_H