#ifndef fk_SYMENTRY_HPP #define fk_SYMENTRY_HPP #include "commons.hpp" #include "Loc.hpp" namespace fk { class Node; class SymEntry { public: explicit SymEntry(std::string const& name, addr_t addr, bool is_global, int scope, std::shared_ptr parent, Loc const& loc); virtual ~SymEntry(); std::string name() const { return m_name; } addr_t addr() const { return m_addr; } bool is_global() const { return m_is_global; } int scope() const { return m_scope; } std::shared_ptr parent() const { return m_parent; } std::shared_ptr node() const { return m_node; } Loc loc() const { return m_loc; } size_t arity() const { return m_arity; } SymEntry& set_global(bool global) { m_is_global = global; return *this; } SymEntry& set_addr(addr_t addr) { m_addr = addr; return *this; } SymEntry& set_arity(size_t arity) { m_arity = arity; return *this; } SymEntry& set_parent(std::shared_ptr parent) { m_parent = parent; return *this; } SymEntry& set_node(std::shared_ptr node) { m_node = node; return *this; } std::string string() const; private: std::string m_name; addr_t m_addr; bool m_is_global = false; int m_scope; std::shared_ptr m_parent; std::shared_ptr m_node; Loc m_loc; size_t m_arity = 0; }; } #endif