Line data Source code
1 : #ifndef DESTRUCTOR_H
2 : #define DESTRUCTOR_H
3 :
4 : #include "../../../symbol.h"
5 : #include "../specialTypes/voidType.h"
6 : #include "genericParameter.h"
7 : #include <memory>
8 :
9 : namespace nicole {
10 :
11 : class AST_BODY;
12 :
13 : class Destructor final : public Symbol {
14 : private:
15 : std::vector<GenericParameter> generics_;
16 : std::shared_ptr<Type> returnType_;
17 : std::shared_ptr<AST_BODY> body_;
18 :
19 : public:
20 : explicit Destructor(const std::string &id, const std::shared_ptr<AST_BODY> &body) noexcept
21 0 : : Symbol{id}, returnType_{std::make_shared<VoidType>()}, body_{body} {}
22 :
23 0 : [[nodiscard]] const std::vector<GenericParameter> &generics() const noexcept {
24 0 : return generics_;
25 0 : }
26 :
27 0 : [[nodiscard]] const std::shared_ptr<Type> &returnType() const noexcept {
28 0 : return returnType_;
29 0 : }
30 :
31 0 : [[nodiscard]] const std::shared_ptr<AST_BODY> &body() const noexcept {
32 0 : return body_;
33 0 : }
34 : };
35 :
36 : } // namespace nicole
37 :
38 : #endif
|