#ifndef zn_SYMTABLE_HPP #define zn_SYMTABLE_HPP #include "common.hpp" #include "Prototype.hpp" namespace zn { struct Sym { std::string name; size_t addr; std::shared_ptr prototype = nullptr; }; class SymTable { public: explicit SymTable(); virtual ~SymTable(); void declare(std::string const& name, size_t addr); void declare_function(std::string const& name, size_t addr, std::shared_ptr prototype); std::optional find(std::string const& name); private: std::vector m_syms; }; } #endif