+#ifndef SETUPGEN_H_
+#define SETUPGEN_H_
+
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <msp/core/application.h>
+#include <msp/datafile/objectloader.h>
+#include "enum.h"
+#include "struct.h"
+#include "type.h"
+
+class SetupGen: public Msp::RegisteredApplication<SetupGen>
+{
+private:
+ class Loader: public Msp::DataFile::ObjectLoader<SetupGen>
+ {
+ public:
+ Loader(SetupGen &);
+
+ private:
+ void init_actions() override;
+
+ void enum_def(const Msp::DataFile::Symbol &);
+ void name_space(const std::string &);
+ void struct_def(Struct::Kind, const Msp::DataFile::Symbol &);
+ };
+
+ std::string in_fn;
+ std::string out_fn;
+ std::string name_space;
+ std::map<std::string, Type> types;
+ std::vector<std::unique_ptr<Enum>> enums;
+ std::vector<std::unique_ptr<Struct>> structs;
+ std::set<std::string> headers;
+
+public:
+ SetupGen(int, char **);
+
+ int main() override;
+private:
+ void create_standard_types();
+ Type &add_type(const std::string &, Type::Kind);
+public:
+ const Type &get_type(const std::string &) const;
+
+private:
+ void load();
+ void collect_headers();
+ void generate_header(Msp::IO::Base &) const;
+ void generate_code(Msp::IO::Base &) const;
+};
+
+#endif