9 std::vector<symbol_table const*> symbol_tables;
14 variables[
"pi"] =
node(3.141592653589792);
15 variables[
"e"] =
node(2.718281828459);
16 symbol_tables.push_back(&variables);
24 symbol_tables.push_back(&locals);
29 symbol_tables.pop_back();
34 for (
auto iter(symbol_tables.rbegin()), end(symbol_tables.rend()); iter != end; ++iter) {
36 symbol_table::const_iterator entry{ table.find(name) };
37 if (entry != table.end()) {
38 value = entry->second;
50 else if (result.get_parameters().empty())
58 variables[name] = value;
node get_function(std::string const &name)
bool find_symbol(std::string const &name, node &value)
void set_variable(std::string const &name, node value)
void set_function(std::string const &name, node value)
set_symbol_table(symbol_table const &symtab)
node get_variable(std::string const &name)
std::map< std::string, node > symbol_table