1
2
3
4
5
6 #ifndef CMAJOR_BINDER_BOUND_NODE_INCLUDED
7 #define CMAJOR_BINDER_BOUND_NODE_INCLUDED
8 #include <cmajor/binder/BinderApi.hpp>
9 #include <cmajor/ir/GenObject.hpp>
10 #include <cmajor/symbols/Module.hpp>
11
12 namespace cmajor { namespace binder {
13
14 using soulng::lexer::Span;
15 using namespace cmajor::ir;
16 using namespace cmajor::symbols;
17
18 enum class BoundNodeType : uint8_t
19 {
20 boundCompileUnit, boundClass, boundFunction,
21 boundSequenceStatement, boundCompoundStatement, boundReturnStatement, boundIfStatement, boundWhileStatement, boundDoStatement, boundForStatement,
22 boundSwitchStatement, boundCaseStatement, boundDefaultStatement, boundGotoCaseStatement, boundGotoDefaultStatement, boundBreakStatement, boundContinueStatement,
23 boundGotoStatement, boundConstructionStatement, boundAssignmentStatement, boundExpressionStatement, boundInitializationStatement, boundEmptyStatement,
24 boundSetVmtPtrStatement, boundThrowStatement, boundRethrowStatement, boundTryStatement, boundCatchStatement,
25 boundParameter, boundLocalVariable, boundMemberVariable, boundConstant, boundEnumConstant, boundLiteral, boundTemporary, boundBitCast, boundFunctionPtr, boundConstructAndReturnTemporary,
26 boundClassOrClassDelegateConversionResult,
27 boundFunctionCall, boundDelegateCall, boundClassDelegateCall, boundConversion, boundSizeOfExpression, boundAddressOfExpression, boundDereferenceExpression, boundReferenceToPointerExpression,
28 boundConstructExpression, boundIsExpression, boundAsExpression, boundTypeNameExpression, boundTypeIdExpression, boundDisjunction, boundConjunction,
29 boundAtomicConstraint, boundDisjunctiveConstraint, boundConjunctiveConstraint, boundConcept,
30 boundTypeExpression, boundNamespaceExpression, boundFunctionGroupExpression, boundMemberExpression,
31 boundNamespace, boundEnumTypeDefinition, boundGlobalVariable
32 };
33
34 class BoundNodeVisitor;
35
36 class BoundNode : public GenObject
37 {
38 public:
39 BoundNode(const Span& span_, const boost::uuids::uuid& moduleId, BoundNodeType boundNodeType_);
40 virtual void Accept(BoundNodeVisitor& visitor) = 0;
41 const Span& GetSpan() const { return span; }
42 const boost::uuids::uuid& ModuleId() const { return moduleId; }
43 BoundNodeType GetBoundNodeType() const { return boundNodeType; }
44 private:
45 Span span;
46 boost::uuids::uuid moduleId;
47 BoundNodeType boundNodeType;
48 };
49
50 } }
51
52 #endif // CMAJOR_BINDER_BOUND_NODE_INCLUDED