// VarTable.h Dave Reed 3/1/05 // // VarTable class -- used to store a table of variable names and values // // constructor: create an empty table // e.g., VarTable variables; // // public member functions: // void Update(string varName, int varValue); // assigns varName's value // // to be VarValue // int Lookup(string varName); // returns varName's value // // if not already stored, // // stores and returns 0 /////////////////////////////////////////////////////////////////////////////////// #ifndef _VARTABLE_H #define _VARTABLE_H #include #include using namespace std; class VarTable { public: VarTable(); void Update(string varName, int varValue); int Lookup(string varName); private: map vars; }; #endif