aboutsummaryrefslogtreecommitdiffstats
path: root/c_compiler/include
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-03-06 21:04:01 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-03-06 21:04:01 +0000
commit30f7753bb64ad95750dbd6bce9b7ab3c077b92aa (patch)
treeded96a4f3d2b934b1b769c4e2bc21b0638519346 /c_compiler/include
parentfdd6ff07cee824078c5315bf07926ee15bbdde85 (diff)
downloadCompiler-30f7753bb64ad95750dbd6bce9b7ab3c077b92aa.tar.gz
Compiler-30f7753bb64ad95750dbd6bce9b7ab3c077b92aa.zip
Made good progress
Diffstat (limited to 'c_compiler/include')
-rw-r--r--c_compiler/include/declaration.hpp3
-rw-r--r--c_compiler/include/function.hpp2
-rw-r--r--c_compiler/include/type.hpp12
3 files changed, 10 insertions, 7 deletions
diff --git a/c_compiler/include/declaration.hpp b/c_compiler/include/declaration.hpp
index 9287827..c46aca2 100644
--- a/c_compiler/include/declaration.hpp
+++ b/c_compiler/include/declaration.hpp
@@ -23,9 +23,12 @@ public:
void addDeclaration(Declaration* _next_decl);
void addList(Declaration* _next_decl);
+ void setType(Type* _type);
+
Declaration* getNext() const;
Declaration* getNextListItem() const;
std::string getId() const;
+ std::string getType() const;
};
#endif
diff --git a/c_compiler/include/function.hpp b/c_compiler/include/function.hpp
index 967c9d8..d608531 100644
--- a/c_compiler/include/function.hpp
+++ b/c_compiler/include/function.hpp
@@ -1,4 +1,4 @@
- #ifndef AST_FUNCTION_HPP
+#ifndef AST_FUNCTION_HPP
#define AST_FUNCTION_HPP
#include "ast.hpp"
diff --git a/c_compiler/include/type.hpp b/c_compiler/include/type.hpp
index 415f00f..8727ee0 100644
--- a/c_compiler/include/type.hpp
+++ b/c_compiler/include/type.hpp
@@ -14,13 +14,13 @@ public:
};
-class Specifier : Type {
+class Specifier : public Type {
public:
virtual std::string getType() const = 0;
};
-class Pointer : Type {
+class Pointer : public Type {
protected:
Type* pointer_type;
@@ -31,7 +31,7 @@ public:
};
-class Array : Type {
+class Array : public Type {
protected:
int32_t size;
Type* array_type;
@@ -43,7 +43,7 @@ public:
};
-class Void : Specifier {
+class Void : public Specifier {
public:
Void();
@@ -51,7 +51,7 @@ public:
};
-class Int : Specifier {
+class Int : public Specifier {
public:
Int();
@@ -59,7 +59,7 @@ public:
};
-class Char : Specifier {
+class Char : public Specifier {
public:
Char();