#ifndef _H_CALC_
#define _H_CALC_

#include <string>
#include <list>

namespace ExprCalc
{
	// Early binding
	class Expression;

	// The calculator class that is used to
	// evaluate the expressions
	class Calc
	{
		private:
			double result;			// Is used to store the result
			std::string expression;	// Is used to store the expression from which the result/error was gotten
			std::string error;		// Is used to store error, if any, if not is empty

			std::string expr;		// Used internally by the class to parse expression
			unsigned int level;		// Used internally by the class to keep count of current subexpression level

			Expression * ParseExpression();
			void Reset();
		public:
			Calc();
			Calc(const std::string &);
			bool Parse(const std::string &);
			double GetResult();
			std::string GetExpression();
			std::string GetError();
			bool IsError();
	};
}

#endif
