Line data Source code
1 : #ifndef AST_VAR_CALL_H
2 : #define AST_VAR_CALL_H
3 :
4 : #include "../ast.h"
5 : #include <string>
6 :
7 : namespace nicole {
8 :
9 : class AST_VAR_CALL final : public AST {
10 : private:
11 : std::string id_;
12 :
13 : public:
14 : explicit AST_VAR_CALL(const long long unsigned nodeId,
15 : const SourceLocation &srcLoc,
16 : const std::string &id) noexcept
17 0 : : AST(nodeId, AST_TYPE::VAR_CALL, srcLoc), id_{id} {}
18 :
19 0 : [[nodiscard]] const std::string &id() const noexcept { return id_; }
20 :
21 : [[nodiscard]] std::expected<std::string, Error>
22 0 : accept(const PrintTree &visitor) const noexcept override {
23 0 : return visitor.visit(this);
24 0 : }
25 :
26 : [[nodiscard]] std::expected<bool, Error>
27 0 : accept(const ValidateTree &visitor) const noexcept override {
28 0 : return visitor.visit(this);
29 0 : }
30 :
31 : [[nodiscard]] std::expected<std::monostate, Error>
32 0 : accept(const FillSemanticInfo &visitor) const noexcept override {
33 0 : return visitor.visit(this);
34 0 : }
35 :
36 : [[nodiscard]] std::expected<std::shared_ptr<Type>, Error>
37 0 : accept(const TypeAnalysis &visitor) const noexcept override {
38 0 : return visitor.visit(this);
39 0 : }
40 :
41 : [[nodiscard]] std::expected<std::monostate, Error>
42 0 : accept(const Monomorphize &visitor) const noexcept override {
43 0 : return visitor.visit(this);
44 0 : }
45 :
46 : [[nodiscard]] std::expected<std::shared_ptr<llvm::Value>, Error>
47 0 : accept(const CodeGeneration &visitor) const noexcept override {
48 0 : return visitor.visit(this);
49 0 : }
50 : };
51 :
52 : } // namespace nicole
53 :
54 : #endif
|