aboutsummaryrefslogtreecommitdiff
path: root/clc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'clc.cc')
-rw-r--r--clc.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/clc.cc b/clc.cc
new file mode 100644
index 0000000..3378e14
--- /dev/null
+++ b/clc.cc
@@ -0,0 +1,25 @@
+#include <iostream>
+#include <limits>
+
+#include "src/parser.h"
+
+int main()
+{
+ std::string inputTerm;
+
+ std::cin >> inputTerm;
+
+ try {
+ typedef std::numeric_limits<double> dbl;
+ std::cout.precision(dbl::digits10);
+
+ std::cout << SimpleParser::calculate(inputTerm) << std::endl;
+ }
+ catch ( std::exception &e )
+ {
+ std::cerr << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}