From cde848ce1eb995170723f6f070b9fcba0dfdb880 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Sat, 5 Jan 2013 22:30:35 +0100 Subject: Moved node classes into separate compilation unit; File extension change --- main.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 main.cc (limited to 'main.cc') diff --git a/main.cc b/main.cc new file mode 100644 index 0000000..c03cce2 --- /dev/null +++ b/main.cc @@ -0,0 +1,27 @@ +#include +#include + +#include "src/parser.h" + +int main() +{ + std::string inputTerm; + + std::cin >> inputTerm; // Example: 2.5*(2+3-(3/2+1)) + + SimpleParser::Parser parser; + + try { + typedef std::numeric_limits dbl; + std::cout.precision(dbl::digits10); + + std::cout << parser.calculate(inputTerm) << std::endl; + } + catch ( std::exception &e ) + { + std::cerr << e.what() << std::endl; + return 1; + } + + return 0; +} -- cgit v1.2.3