abstract type graph added to symbol table

This commit is contained in:
ProgramSnail 2023-04-17 12:09:02 +03:00
parent 25355974a2
commit 3c643d2759
8 changed files with 845 additions and 16 deletions

View file

@ -6,6 +6,9 @@
#include <optional>
#include <memory>
// for clangd
#include "utils.hpp"
namespace interpreter::tokens {
// ----------------- Declarations -----------------
@ -293,6 +296,8 @@ struct AliasDefinitionStatement {
TypeIdentifier type;
std::vector<AbstractTypeIdentifier> parameters;
std::unique_ptr<ParametrizedType> value;
utils::IdType type_id_;
};
struct VariableDefinitionStatement {
@ -306,28 +311,38 @@ struct FunctionDeclaration {
NameOrOperatorIdentifier name;
std::vector<std::unique_ptr<AnnotatedAbstractType>> parameters;
std::unique_ptr<FunctionType> type;
utils::IdType function_id_;
};
struct FunctionDefinitionStatement {
bool is_inline;
std::unique_ptr<FunctionDefinition> definition;
SuperExpression value;
utils::IdType function_id_;
};
struct TypeDefinitionStatement {
enum { Struct, Class } modifier;
std::unique_ptr<TypeDefinition> definition;
AnyType value;
utils::IdType type_id_;
};
struct AbstractTypeDefinitionStatement {
enum { Basic, Abstract } modifier;
std::unique_ptr<AnnotatedType> type;
utils::IdType type_id_;
};
struct TypeclassDefinitionStatement {
std::unique_ptr<TypeDefinition> definition;
std::vector<std::unique_ptr<FunctionDeclaration>> requirements;
utils::IdType typeclass_id_;
};
// Definition parts -----------------