diff --git a/mie/include/mie/type/function.h b/mie/include/mie/type/function.h new file mode 100644 index 0000000..0dba1b2 --- /dev/null +++ b/mie/include/mie/type/function.h @@ -0,0 +1,20 @@ +#ifndef MIE_TYPE_FUNCTION_H_ +#define MIE_TYPE_FUNCTION_H_ + +#include +#include + +struct mie_function_type { + struct mie_type func_base; + + MIE_VECTOR_DECLARE(struct mie_type *, func_in); + MIE_VECTOR_DECLARE(struct mie_type *, func_out); +}; + +MIE_API struct mie_function_type *mie_function_type_create(void); +MIE_API void mie_function_type_add_in_part( + struct mie_function_type *ty, struct mie_type *part); +MIE_API void mie_function_type_add_out_part( + struct mie_function_type *ty, struct mie_type *part); + +#endif diff --git a/mie/include/mie/type/storage.h b/mie/include/mie/type/storage.h new file mode 100644 index 0000000..3f33902 --- /dev/null +++ b/mie/include/mie/type/storage.h @@ -0,0 +1,17 @@ +#ifndef MIE_TYPE_STORAGE_H_ +#define MIE_TYPE_STORAGE_H_ + +#include +#include + +struct mie_storage_type { + struct mie_type st_base; + + MIE_VECTOR_DECLARE(struct mie_type *, st_parts); +}; + +MIE_API struct mie_storage_type *mie_storage_type_create(void); +MIE_API void mie_storage_type_add_part( + struct mie_storage_type *ty, struct mie_type *part); + +#endif diff --git a/mie/include/mie/type/type.h b/mie/include/mie/type/type.h new file mode 100644 index 0000000..9cb7e12 --- /dev/null +++ b/mie/include/mie/type/type.h @@ -0,0 +1,31 @@ +#ifndef MIE_TYPE_TYPE_H_ +#define MIE_TYPE_TYPE_H_ + +#include +#include +#include + +struct mie_dialect; +struct mie_dialect_type; + +struct mie_type; + +/* a mie_type is an instance of mie_dialect_type. + * if the mie_dialect_type is a parametised type, the resulting mie_type + * will have those parameters baked in. + * this is a base struct. dialects that defined their own types do so by + * inheriting from this struct. */ +struct mie_type { + /* this is NOT the same as ty_def->ty_id */ + mie_id ty_id; + + /* this pointer is optional. if it is NULL, the name of the type can + * be found in ty_def */ + char *ty_name; + + struct mie_dialect_type *ty_def; +}; + +MIE_API struct mie_type *mie_type_create(struct mie_dialect_type *type); + +#endif