2023-09-20 15:17:13 +00:00
|
|
|
#ifndef fk_SYMENTRY_HPP
|
|
|
|
#define fk_SYMENTRY_HPP
|
|
|
|
|
|
|
|
#include "commons.hpp"
|
|
|
|
#include "Loc.hpp"
|
|
|
|
|
|
|
|
namespace fk
|
|
|
|
{
|
2023-09-21 13:59:46 +00:00
|
|
|
class Node;
|
|
|
|
|
2023-09-20 15:17:13 +00:00
|
|
|
class SymEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit SymEntry(std::string const& name,
|
|
|
|
addr_t addr,
|
|
|
|
bool is_global,
|
2023-09-21 13:59:46 +00:00
|
|
|
int scope,
|
|
|
|
std::shared_ptr<Node> parent,
|
2023-09-20 15:17:13 +00:00
|
|
|
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; }
|
2023-09-21 13:59:46 +00:00
|
|
|
int scope() const { return m_scope; }
|
|
|
|
std::shared_ptr<Node> parent() const { return m_parent; }
|
2023-09-20 15:17:13 +00:00
|
|
|
Loc loc() const { return m_loc; }
|
|
|
|
|
|
|
|
void set_global(bool global) { m_is_global = global; }
|
2023-09-21 13:59:46 +00:00
|
|
|
void set_addr(addr_t addr) { m_addr = addr; }
|
2023-09-20 15:17:13 +00:00
|
|
|
|
|
|
|
std::string string() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_name;
|
|
|
|
addr_t m_addr;
|
|
|
|
bool m_is_global = false;
|
2023-09-21 13:59:46 +00:00
|
|
|
int m_scope;
|
|
|
|
std::shared_ptr<Node> m_parent;
|
2023-09-20 15:17:13 +00:00
|
|
|
Loc m_loc;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|