4
Copyright (c) 2021 МГТУ им. Н.Э. Баумана, кафедра ИУ-6, Михаил Фетисов,
6
https://bmstu.codes/lsx/simodo/loom
9
#include "simodo/interpret/SemanticModuleFactory_interface.h"
10
#include "ScriptAnalyzer.h"
11
#include "ScriptPreview.h"
13
// #include "simodo/inout/convert/functions.h"
20
// MinGW related workaround
21
#define BOOST_DLL_FORCE_ALIAS_INSTANTIATION
24
#include <boost/dll/alias.hpp>
26
using namespace simodo;
28
class ScriptInterpret : public interpret::SemanticModuleFactory_interface
30
interpret::ModuleManagement_interface & _mm;
33
ScriptInterpret(interpret::ModuleManagement_interface & module_management)
34
: _mm(module_management)
38
virtual version_t version() const override { return lib_version(); }
40
virtual interpret::SemanticModule_interface *
41
create(interpret::Interpret_interface & inter) const override
45
case interpret::InterpretType::Analyzer:
46
return new interpret::ScriptAnalyzer(_mm, _mm.semantic_data());
47
case interpret::InterpretType::Preview:
48
return new interpret::ScriptPreview(_mm);
54
// Self factory method
55
static std::shared_ptr<SemanticModuleFactory_interface> self_create(interpret::ModuleManagement_interface & module_management) {
56
return std::make_shared<ScriptInterpret>(module_management);
61
ScriptInterpret::self_create, // <-- this function is exported with...
62
create_simodo_interpret // <-- ...this alias name