#ifndef MATHEXPRESSIONPARSER_H#define MATHEXPRESSIONPARSER_H#include<string>#include <iostream>#include <sstream>#include<vector>using namespace std;namespace MMCalculator{ enum TokenType { OPERAND = 0, OPERATOR = 2 }; enum OperatorType { ADDITION = 0, SUBTRACTION = 1, MULTIPLICATION = 2, DIVISION = 3 }; class OutputUnit { public: virtual TokenType getTokenType() = 0; }; class Operand : OutputUnit { private: double value; public: Operand(double value); double getValue(); TokenType getTokenType(); }; class Operator : OutputUnit { private: OperatorType operatorType; public: Operator(OperatorType operatorType); OperatorType getOperatorType(); TokenType getTokenType(); }; class MathExpressionParser { private: std::istream* inputStream; std::vector<OutputUnit> outputUnits; std::vector<Operator> stack; void procDigit(); public: double parseExpression(std::string expression); };}#endif // MATHEXPRESSIONPARSER_H