/** ** \file ast/typable.hh ** \brief Declaration of ast::Typable. */ #pragma once #include #include namespace ast { /** \class ast::Typable ** \brief Hold a type information. ** ** A Typable node holds a type information (type::Type) about ** this node. This can be: ** \li the type of the node itself, if it is a Exp or a Ty, or ** \li the type of of the declared object, in case of a Dec. */ class Typable { // FIXME DONE: Some code was deleted here. public: // Only need for basic constructor and destructor here Typable(); virtual ~Typable() = default; /* We prohibit copy and assignment as to avoid having ** multiple Typable referencing the same Type which could ** potentially mess up the TypeConstructor */ Typable(const Typable&) = delete; Typable& operator=(const Typable&) = delete; // Basic getters/setters void type_set(const type::Type*); const type::Type* type_get() const; // Making sure we can visit thoses "nodes" virtual void accept(ConstVisitor& v) const = 0; virtual void accept(Visitor& v) = 0; private: const type::Type* type_; }; } // namespace ast #include