1
2
3
4
5
6 #ifndef SNGCM_AST_PARAMETER_INCLUDED
7 #define SNGCM_AST_PARAMETER_INCLUDED
8 #include <sngcm/ast/Node.hpp>
9
10 namespace sngcm { namespace ast {
11
12 class IdentifierNode;
13
14 class ParameterNode : public Node
15 {
16 public:
17 ParameterNode(const Span& span_);
18 ParameterNode(const Span& span_, Node* typeExpr_, IdentifierNode* id_);
19 Node* Clone(CloneContext& cloneContext) const override;
20 void Accept(Visitor& visitor) override;
21 void Write(AstWriter& writer) override;
22 void Read(AstReader& reader) override;
23 Node* TypeExpr() const { return typeExpr.get(); }
24 IdentifierNode* Id() const { return id.get(); }
25 void SetId(IdentifierNode* id_);
26 bool ArtificialId() const { return artificialId; }
27 private:
28 std::unique_ptr<Node> typeExpr;
29 std::unique_ptr<IdentifierNode> id;
30 bool artificialId;
31 };
32
33 } }
34
35 #endif // SNGCM_AST_PARAMETER_INCLUDED