mirror of
https://github.com/avinal/The-Hack-Assembler.git
synced 2026-01-10 23:28:33 +05:30
22 lines
364 B
C++
22 lines
364 B
C++
|
|
#pragma once
|
||
|
|
#ifdef SYMBOL_TABLE_HPP
|
||
|
|
#define SYMBOL_TABLE_HPP
|
||
|
|
|
||
|
|
#include <unordered_map>
|
||
|
|
|
||
|
|
class symbol_table
|
||
|
|
{
|
||
|
|
private:
|
||
|
|
std::unordered_map<std::string, int> symbols;
|
||
|
|
|
||
|
|
public:
|
||
|
|
symbol_table();
|
||
|
|
~symbol_table();
|
||
|
|
|
||
|
|
void add_entry(std::string symbol, int address);
|
||
|
|
bool contains(std::string symbol);
|
||
|
|
int get_address(std::string symbol);
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|