LCOV - code coverage report
Current view: top level - inc/parsingAnalysis/ast/userTypes - ast_methodDecl.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 28 0
Test Date: 2025-04-18 15:53:49 Functions: 0.0 % 10 0

            Line data    Source code
       1              : #ifndef AST_METHOD_DECL_H
       2              : #define AST_METHOD_DECL_H
       3              : 
       4              : #include "../../../tables/typeTable/types/userTypes/genericParameter.h"
       5              : #include "../functions/ast_parametrizedSubritineDecl.h"
       6              : #include <memory>
       7              : 
       8              : namespace nicole {
       9              : 
      10              : class AST_METHOD_DECL final : public AST_PARAMETRIZED_SUBRUTINE_DECL {
      11              : private:
      12              :   mutable std::vector<GenericParameter> generics_;
      13              :   bool isVirtual_;
      14              : 
      15              : public:
      16              :   explicit AST_METHOD_DECL(const long long unsigned nodeId,
      17              :                            const SourceLocation &srcLoc, const std::string &id,
      18              :                            const std::vector<GenericParameter> &generics,
      19              :                            const Parameters &params,
      20              :                            const std::shared_ptr<Type> &returnType,
      21              :                            const std::shared_ptr<AST_BODY> &body,
      22              :                            const bool isVirtual) noexcept
      23            0 :       : AST_PARAMETRIZED_SUBRUTINE_DECL(nodeId, AST_TYPE::METHOD_DECL, srcLoc,
      24            0 :                                         id, params, returnType, body),
      25            0 :         generics_{generics}, isVirtual_{isVirtual} {}
      26              : 
      27            0 :   [[nodiscard]] const std::vector<GenericParameter> &generics() const noexcept {
      28            0 :     return generics_;
      29            0 :   }
      30              : 
      31              :   void
      32            0 :   setGenerics(const std::vector<GenericParameter> &generics) const noexcept {
      33            0 :     generics_ = generics;
      34            0 :   }
      35              : 
      36            0 :   [[nodiscard]] bool isVirtual() const noexcept { return isVirtual_; }
      37              : 
      38              :   [[nodiscard]] std::expected<std::string, Error>
      39            0 :   accept(const PrintTree &visitor) const noexcept override {
      40            0 :     return visitor.visit(this);
      41            0 :   }
      42              : 
      43              :   [[nodiscard]] std::expected<bool, Error>
      44            0 :   accept(const ValidateTree &visitor) const noexcept override {
      45            0 :     return visitor.visit(this);
      46            0 :   }
      47              : 
      48              :   [[nodiscard]] std::expected<std::monostate, Error>
      49            0 :   accept(const FillSemanticInfo &visitor) const noexcept override {
      50            0 :     return visitor.visit(this);
      51            0 :   }
      52              : 
      53              :   [[nodiscard]] std::expected<std::shared_ptr<Type>, Error>
      54            0 :   accept(const TypeAnalysis &visitor) const noexcept override {
      55            0 :     return visitor.visit(this);
      56            0 :   }
      57              : 
      58              :   [[nodiscard]] std::expected<std::monostate, Error>
      59            0 :   accept(const Monomorphize &visitor) const noexcept override {
      60            0 :     return visitor.visit(this);
      61            0 :   }
      62              : 
      63              :   [[nodiscard]] std::expected<std::shared_ptr<llvm::Value>, Error>
      64            0 :   accept(const CodeGeneration &visitor) const noexcept override {
      65            0 :     return visitor.visit(this);
      66            0 :   }
      67              : };
      68              : 
      69              : } // namespace nicole
      70              : 
      71              : #endif
        

Generated by: LCOV version 2.0-1