1
2
3
4
5
6 #include <cmajor/binder/BoundNamespace.hpp>
7 #include <cmajor/binder/BoundNodeVisitor.hpp>
8 #include <cmajor/symbols/Exception.hpp>
9
10 namespace cmajor { namespace binder {
11
12 using namespace cmajor::symbols;
13
14 BoundNamespace::BoundNamespace(NamespaceNode& namespaceNode_) : BoundNode(namespaceNode_.GetSpan(), namespaceNode_.ModuleId(), BoundNodeType::boundNamespace), namespaceNode(namespaceNode_)
15 {
16 }
17
18 void BoundNamespace::Accept(BoundNodeVisitor& visitor)
19 {
20 visitor.Visit(*this);
21 }
22
23 void BoundNamespace::Load(Emitter& emitter, OperationFlags flags)
24 {
25 throw Exception("cannot load a namespace", GetSpan(), ModuleId());
26 }
27
28 void BoundNamespace::Store(Emitter& emitter, OperationFlags flags)
29 {
30 throw Exception("cannot store a namespace", GetSpan(), ModuleId());
31 }
32
33 void BoundNamespace::AddMember(std::std::unique_ptr<BoundNode>&&member)
34 {
35 members.push_back(std::move(member));
36 }
37
38 } }