aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/main.cpp b/main.cpp
deleted file mode 100644
index c39e469..0000000
--- a/main.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <iostream>
-#include <fstream>
-#include <streambuf>
-#include <string>
-#include "parser.h"
-#include "runtime.h"
-
-std::string readFile(std::string& filename) {
- std::ifstream t(filename);
- std::string str((std::istreambuf_iterator<char>(t)),
- (std::istreambuf_iterator<char>()));
- return str;
-}
-
-int main(int argc, char** argv) {
- if (argc != 2) {
- std::cout << "Please supply input file name as a parameter." << std::endl;
- return 1;
- }
-
- std::string filename = std::string(argv[1]);
- std::string code = readFile(filename);
-
- std::string valueString;
- std::string stdinLine;
- while (std::cin >> stdinLine) {
- valueString += stdinLine + " ";
- }
-
- Parser parser;
- std::vector<Token> tokens = parser.parseCode(code);
- std::vector<int> values = parser.parseValues(valueString);
- parser.printTokens(tokens);
- parser.printValues(values);
-
- Runtime runtime;
- runtime.run(tokens);
-
- return 0;
-}