loom
1/*
2MIT License
3
4Copyright (c) 2022 МГТУ им. Н.Э. Баумана, кафедра ИУ-6, Михаил Фетисов,
5
6https://bmstu.codes/lsx/simodo
7*/
8
9#include "simodo/interpret/InterpretFactory.h"
10#include "simodo/interpret/Interpret.h"
11
12#include <cassert>
13
14namespace simodo::interpret
15{
16InterpretFactory::InterpretFactory(
17InterpretType type,
18inout::Reporter_abstract & m,
19loom::Loom_interface & loom,
20Logistics_interface & logistics)
21: _type(type)
22, _m(m)
23, _loom(loom)
24, _logistics(logistics)
25{
26}
27
28Interpret_interface * InterpretFactory::create()
29{
30return new Interpret(_type, _m, _loom, _semantic_factories, _logistics);
31}
32
33Interpret_interface * InterpretFactory::create(InterpretType type,
34inout::uri_set_t files,
35const ast::Node & code,
36interpret::SemanticModules hosts)
37{
38return new Interpret(type, _m, _loom, files, code, hosts);
39}
40
41void InterpretFactory::setSemanticFactories(SemanticFactories semantic_factories)
42{
43assert(_semantic_factories.empty());
44
45_semantic_factories = semantic_factories;
46}
47
48}