/* Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include #include "kernel/environment.h" #include "library/attribute_manager.h" #include "library/io_state.h" namespace lean { class parser; class decl_attributes { public: struct entry { attribute const * m_attr; attr_data_ptr m_params; bool deleted() const { return !static_cast(m_params); } }; private: bool m_persistent; bool m_parsing_only; list m_entries; optional m_prio; public: decl_attributes(bool persistent = true): m_persistent(persistent), m_parsing_only(false) {} void parse(parser & p); environment apply(environment env, io_state const & ios, name const & d) const; list const & get_entries() const { return m_entries; } bool is_parsing_only() const { return m_parsing_only; } optional get_priority() const { return m_prio; } bool ok_for_inductive_type() const; bool has_class() const; operator bool() const { return static_cast(m_entries); } }; }