--- /dev/null
+#ifndef STRUCT_H_
+#define STRUCT_H_
+
+#include <string>
+#include <vector>
+#include <msp/datafile/objectloader.h>
+#include <msp/io/base.h>
+
+class SetupGen;
+class Type;
+
+class Struct
+{
+public:
+ enum Kind
+ {
+ DATA,
+ ENTITY,
+ COMPONENT
+ };
+
+ struct Field
+ {
+ class Loader;
+
+ std::string name;
+ const Type *type = nullptr;
+ std::string default_value;
+ };
+
+ class Loader;
+
+private:
+ std::string name;
+ Kind kind;
+ std::vector<Field> fields;
+
+public:
+ Struct(const std::string &, Kind);
+
+ const std::vector<Field> &get_fields() const { return fields; }
+
+ void define_type(Msp::IO::Base &) const;
+ void define_loader(Msp::IO::Base &) const;
+ void define_functions(Msp::IO::Base &) const;
+};
+
+class Struct::Loader: public Msp::DataFile::ObjectLoader<Struct>
+{
+private:
+ const SetupGen &gen;
+
+public:
+ Loader(Struct &, const SetupGen &);
+
+private:
+ void init_actions() override;
+
+ void field(const Msp::DataFile::Symbol &, const Msp::DataFile::Symbol &);
+};
+
+#endif