#ifndef VARIABLEMAP #define VARIABLEMAP #include #include #include #include "node.h" /** *Variable Map is a class to store the variables used throughout the program. *The values are stored as ints, this way they are not affected by changes to *other variables. They are stored as a vector, so that later implementations *might allow for looking up old values. * *CONSTRUCTOR *VariableMap() * *MEMBER FUNCTIONS * *double lookUpVar(const string & variable) * Looks up the varaible and returns its last entered Node * value * Returns 0 if not there * *void upDateVariables(const string & variable, const Node * & value) * Updates the variable's value and prints out the latest value * *bool checkForVar(const string & line,const int &k) * Checks to see if line is in the map returns true if it is * * *PRIVATE VARIABLES * VariableList myVariables * Holds current varaibles *Written by Jessica Smith */ class VariableMap{ public: typedef map >VariableList; typedef pair >VariablePair; VariableMap(); Node * lookUpVar(const string & variable); void upDateVariables(const string & variable, Node * & value); bool checkForVar(const string & line, const int& k); private: VariableList myVariables; }; #endif VARIABLEMAP