1
2
3
4
5
6 #ifndef SNGCM_AST_INTERFACE_INCLUDED
7 #define SNGCM_AST_INTERFACE_INCLUDED
8 #include <sngcm/ast/Function.hpp>
9
10 namespace sngcm { namespace ast {
11
12 class InterfaceNode : public Node
13 {
14 public:
15 InterfaceNode(const Span& span_, const boost::uuids::uuid& moduleId_);
16 InterfaceNode(const Span& span_, const boost::uuids::uuid& moduleId_, Specifiers specifiers_, IdentifierNode* id_, AttributesNode* attributes_);
17 Node* Clone(CloneContext& cloneContext) const override;
18 void Accept(Visitor& visitor) override;
19 void Write(AstWriter& writer) override;
20 void Read(AstReader& reader) override;
21 Specifiers GetSpecifiers() const override { return specifiers; }
22 IdentifierNode* Id() const { return id.get(); }
23 const NodeList<Node>& Members() const { return members; }
24 void AddMember(Node* member);
25 AttributesNode* GetAttributes() const { return attributes.get(); }
26 void SetSpecifierSpan(const Span& specifierSpan_) { specifierSpan = specifierSpan_; }
27 const Span& SpecifierSpan() const { return specifierSpan; }
28 void SetBeginBraceSpan(const Span& beginBraceSpan_) { beginBraceSpan = beginBraceSpan_; }
29 const Span& BeginBraceSpan() const { return beginBraceSpan; }
30 void SetEndBraceSpan(const Span& endBraceSpan_) { endBraceSpan = endBraceSpan_; }
31 const Span& EndBraceSpan() const { return endBraceSpan; }
32 private:
33 Specifiers specifiers;
34 Span specifierSpan;
35 Span beginBraceSpan;
36 Span endBraceSpan;
37 std::unique_ptr<IdentifierNode> id;
38 NodeList<Node> members;
39 std::unique_ptr<AttributesNode> attributes;
40 };
41
42 } }
43
44 #endif // SNGCM_AST_INTERFACE_INCLUDED