Calculator  Step 5
variables.hpp
Go to the documentation of this file.
1 #ifndef VARIABLES_HPP_
2 #define VARIABLES_HPP_
3 
4 #include <map>
5 #include <string>
6 
7 #include "node.hpp"
8 
13 typedef std::map<std::string, node> symbol_table;
14 
20 {
21  public:
22  set_symbol_table(symbol_table const& symtab);
24 };
25 
30 node get_variable(std::string const& name);
31 
37 node get_function(std::string const& name);
38 
43 void set_variable(std::string const& name, node value);
44 
49 void set_function(std::string const& name, node definition);
50 
56 void save_library(std::string const& filename);
57 
63 void load_library(std::string const& filename);
64 
65 #endif
void load_library(std::string const &filename)
Definition: variables.cpp:100
node get_function(std::string const &name)
Definition: variables.cpp:65
void save_library(std::string const &filename)
Definition: variables.cpp:79
Definition: node.hpp:26
void set_variable(std::string const &name, node value)
Definition: variables.cpp:60
void set_function(std::string const &name, node value)
Definition: variables.cpp:74
set_symbol_table(symbol_table const &symtab)
Definition: variables.cpp:26
node get_variable(std::string const &name)
Definition: variables.cpp:49
std::map< std::string, node > symbol_table
Definition: variables.hpp:13