1
2
3
4
5
6 #include <cmajor/binder/BoundEnum.hpp>
7 #include <cmajor/binder/BoundNodeVisitor.hpp>
8 #include <cmajor/symbols/Exception.hpp>
9
10 namespace cmajor { namespace binder {
11
12 BoundEnumTypeDefinition::BoundEnumTypeDefinition(EnumTypeSymbol* enumTypeSymbol_) : BoundNode(enumTypeSymbol_->GetSpan(), enumTypeSymbol_->SourceModuleId(),
13 BoundNodeType::boundEnumTypeDefinition), enumTypeSymbol(enumTypeSymbol_)
14 {
15 }
16
17 void BoundEnumTypeDefinition::Accept(BoundNodeVisitor& visitor)
18 {
19 visitor.Visit(*this);
20 }
21
22 void BoundEnumTypeDefinition::Load(Emitter& emitter, OperationFlags flags)
23 {
24 throw Exception("cannot load from enum type", GetSpan(), ModuleId());
25 }
26
27 void BoundEnumTypeDefinition::Store(Emitter& emitter, OperationFlags flags)
28 {
29 throw Exception("cannot store to enum type", GetSpan(), ModuleId());
30 }
31
32 } }