aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
blob: 2bc682ab14f3dfc3b5829bdc2b15df23ef2e29a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

#include "parser.h"

int main(int argc, char *argv[])
{
	string inputTerm;
	
	std::cin >> inputTerm; // Example: 2.5*(2+3-(3/2+1))
	
	Parser *parser = new Parser();
	
	try {
		std::cout << parser->calculate(inputTerm, false).result << std::endl;
	}
	catch ( exception &e )
	{
		std::cerr << e.what() << std::endl;
		std::exit(1);
	}

	return 0;
}