-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (24 loc) · 837 Bytes
/
main.cpp
File metadata and controls
26 lines (24 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <fstream>
#include "src/main/logging/logger.hpp"
#include "src/main/util/stdin-output-stream.hpp"
#include "src/main/lexer/lexer.hpp"
#include "src/main/parser/parser.hpp"
#include "src/main/interpreter/interpreter.hpp"
int main() {
std::ifstream in("/home/agata/CLionProjects/TKOM/src/test.lang");
std::cin.rdbuf(in.rdbuf());
try {
lang::logging::Logger logger;
lang::util::StdinOutputStream inputFile;
lang::lexer::Lexer lexer(inputFile);
lang::parser::Parser parser(logger, lexer);
auto script = parser.getTree();
lang::interpreter::Interpreter interpreter(*script);
interpreter.execute("main");
} catch (std::exception e) {
std::cerr << "Error occurred: " << e.what() << std::endl;
return -1;
}
return 0;
}