From 4d622c9570100b43f85ab5dd8885444b6e47eca1 Mon Sep 17 00:00:00 2001 From: topchetoeu <36534413+TopchetoEU@users.noreply.github.com> Date: Thu, 24 Nov 2022 16:03:16 +0200 Subject: [PATCH] chore: remove old lang syste, --- include/lang/namespace.hh | 38 -------------------------- include/lang/operator.hh | 57 --------------------------------------- include/lang/types.hh | 51 ----------------------------------- 3 files changed, 146 deletions(-) delete mode 100644 include/lang/namespace.hh delete mode 100644 include/lang/operator.hh delete mode 100644 include/lang/types.hh diff --git a/include/lang/namespace.hh b/include/lang/namespace.hh deleted file mode 100644 index 5e293a6..0000000 --- a/include/lang/namespace.hh +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "lang/common.hh" -#include "lang/types.hh" -#include "lang/version.hh" - -namespace ppc::lang { - // A structure, containing all the definitions of a namespace - struct namespace_t { - // The name of the namespace - namespace_name_t name; - // The version of the namespace - version_t version; - // A list of all the defined types inside the namespace - std::vector types; - // A list of all the defined fields inside the namespace - std::vector fields; - - bool contains_def(const std::string &name, location_t &ploc) const; - inline bool contains_def(const std::string &name) const { - location_t ploc; - return contains_def(name, ploc); - } - - template - static bool contains_def(T namespaces, const namespace_name_t &def_nmsp, const std::string &name, location_t &ploc) { - for (const namespace_t &nmsp : namespaces) { - if (nmsp.name == def_nmsp && nmsp.contains_def(name)) return true; - } - return false; - } - template - static inline bool contains_def(T namespaces, const namespace_name_t &def_nmsp, const std::string &name) { - location_t ploc; - return contains_def(namespaces, def_nmsp, name, ploc); - } - }; -} diff --git a/include/lang/operator.hh b/include/lang/operator.hh deleted file mode 100644 index bd09dbf..0000000 --- a/include/lang/operator.hh +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include - -enum operator_t { - OPERATOR_NONE, - OPERATOR_LESS_THAN, - OPERATOR_GREATER_THAN, - OPERATOR_LESS_THAN_EQUALS, - OPERATOR_GREATER_THAN_EQUALS, - OPERATOR_EQUALS, - OPERATOR_NOT_EQUALS, - OPERATOR_BOOLEAN_AND, - OPERATOR_BOOLEAN_OR, - - OPERATOR_SHIFT_LEFT, - OPERATOR_SHIFT_RIGHT, - OPERATOR_BINARY_XOR, - OPERATOR_BINARY_AND, - OPERATOR_BINARY_OR, - OPERATOR_BOOLEAN_NOT, - OPERATOR_BITWISE_NEGATIVE, - - OPERATOR_INCREASE, - OPERATOR_DECREASE, - - OPERATOR_POST_INCREASE, - OPERATOR_POST_DECREASE, - - OPERATOR_ADD, - OPERATOR_SUBTRACT, - OPERATOR_DIVIDE, - OPERATOR_MULTIPLY, - OPERATOR_MODULO, - - OPERATOR_POSITIVE, - OPERATOR_NEGATIVE, - - OPERATOR_CONDITIONAL, - OPERATOR_NULL_COALESCING, - - OPERATOR_IMPLICIT, - OPERATOR_EXPLICIT, - - OPERATOR_NEW, - OPERATOR_VAL, - - OPERATOR_ASSIGN, - - OPERATOR_PTR_MEMBER, - OPERATOR_MEMBER, - - OPERATOR_REFERENCING, - OPERATOR_DEREFERENCING, - - OPERATOR_CALL, -}; diff --git a/include/lang/types.hh b/include/lang/types.hh deleted file mode 100644 index 53a0750..0000000 --- a/include/lang/types.hh +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "utils/location.hh" -#include "lang/common.hh" -#include "lang/version.hh" - -namespace ppc::lang { - enum def_type_kind_t { - TYPE_NONE, - TYPE_STRUCT, - }; - - struct type_def_t; - - // A structure, representing a ++C type notation - struct type_t { - // The type definition of which this type is - // If NULL, then this type is unknown - // Feel free to scream at the user if this is NULL - type_def_t *def; - }; - // A structure, representing a field in a ++C struct - struct field_t { - // The type of which this field is - type_t type; - // The name of the field - const char *name; - // Whether or not the field is exported - bool is_exported; - }; - - // A structure, representing a ++C type (structs, classes, delegates and interfaces) - struct type_def_t { - // Whether or not this definition is exported - bool is_exported; - // The namespace of the type - namespace_name_t _namespace; - // The name of the type - const char *name; - // The version of the type (inherited from the module version) - version_t version; - // The location of the definition - location_t location; - - // The alignment padding from the start of the structures, in bytes - // Used either for efficiency sake or to store private fields (or both) - std::size_t align_size; - // A list of all the type's fields - std::vector fields; - }; -}