소스 검색

added type files

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