not implemented yet

This commit is contained in:
avinal
2020-08-10 12:22:11 +05:30
parent c2fd11ff11
commit 5685482eac
2 changed files with 49 additions and 5 deletions

View File

@@ -1 +1,22 @@
#include "../include/symbol_table.hpp"
#include "../include/symbol_table.hpp"
void symbol_table::add_entry(std::string symbol, int address)
{
symbols.insert(std::make_pair(symbol, address));
}
bool symbol_table::contains(std::string symbol)
{
return !(symbols.find(symbol) == symbols.end());
}
int symbol_table::get_address(std::string symbol)
{
if (contains(symbol))
{
return symbols[symbol];
}else
{
return -1;
}
}