diff options
| author | Cori Barker <coribarker2@gmail.com> | 2026-03-10 22:53:50 +0000 |
|---|---|---|
| committer | Cori Barker <coribarker2@gmail.com> | 2026-03-10 22:53:50 +0000 |
| commit | 32a1609b59fcbbfe24e223c078d51f8bfa08566f (patch) | |
| tree | 0aafc1e1d19ab0a3e610ee227f92ab6a8a327813 /include/type.hpp | |
| parent | c364efa08dff0abef9e043e2e28cf2d8dc6b95b3 (diff) | |
continued development of the semantic analyzer and symbol table generation
Diffstat (limited to 'include/type.hpp')
| -rw-r--r-- | include/type.hpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/include/type.hpp b/include/type.hpp index 9b25d24..1726764 100644 --- a/include/type.hpp +++ b/include/type.hpp @@ -8,28 +8,4 @@ enum struct TypeKind { FLOAT, DOUBLE, VOID, - FUNCTION, -}; - -struct Type { - TypeKind kind; - - Type* return_type = nullptr; - std::vector<Type*> param_types; - - static Type makeInt() { return { TypeKind::INT }; } - static Type makeChar() { return { TypeKind::CHAR }; } - static Type makeBool() { return { TypeKind::BOOL }; } - static Type makeString() { return { TypeKind::STRING }; } - static Type makeFloat() { return { TypeKind::FLOAT }; } - static Type makeDouble() { return { TypeKind::DOUBLE }; } - static Type makeVoid() { return { TypeKind::VOID }; } - - static Type makeFunction(Type* return_type, std::vector<Type*> param_types) { - Type t; - t.kind = TypeKind::FUNCTION; - t.return_type = return_type; - t.param_types = std::move(param_types); - return t; - }; }; |
