Ejemplo n.º 1
0
void PrintExpression(string &infix)
{
	try
	{
	Keywords keywords;
	double results = 0;
	keywords.ResolveKeywords(infix);

	Expression *exp = PkParser::Solve(infix);

	cout <<"Equation: " << exp->toString(0) <<endl;

	results = exp->Solve();

	cout << results <<endl;

	delete exp;
	}
	catch(PkException *exp)
	{
		cout << "Exception:" << exp->toString() <<endl;
	}
	catch(...)
	{
		cout << "Unknown Error"<<endl;
	}
}