#ifndef OPERATORMAP #define OPERATORMAP #include #include #include "node.h" /** *The OperatorMap is a class responsible for storing the operators that have *been defined for use. The map holds the strings for operators, and their *corresponding node constructors. It has a function to allow the Node *associated with a string to be looked up, and a function to determine whether *a string is an operator or not. * *CONSTRUCTOR *OperatorMap() * Note:The map is created in the Operator's constructor * *MEMBER FUNCTIONS * *Node* lookUpOperator(const string & operators) * Allows the map to be searched for the operator, if present * then the Node constructor for that time of operation will be called. * * *bool isOperator(const char & operators) * Checks to see if the char is an operator. If it is returns true, else * false. * *bool isTypeOperator(const string & typeString, const int & Precedence) * Checks to see if type of operators with precedence searching for and string typeString * are on the map *PRIVATE VARIABLES * *OperatorList myOperators * List of operators in the map * *Written by Jessica Smith */ class OperatorMap{ public: typedef mapOperatorList; typedef pair OperatorPair; OperatorMap(); Node* lookUpOperator(const string & operators); bool isOperator(const string & operators); bool isTypeOperator(const string &unaryString, const int & Precedence); private: OperatorList myOperators; }; #endif OPERATORMAP