-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
31 lines (28 loc) · 871 Bytes
/
main.cpp
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
27
28
29
30
31
#include "util/bufferedInputStream.hpp"
#include "code/binaryFileParser.hpp"
#include "code/codeObject.hpp"
#include <stdio.h>
#include "runtime/interpreter.hpp"
#include "runtime/universe.hpp"
#include "object/pyDict.hpp"
#include "object/pyString.hpp"
#include "object/pyInteger.hpp"
#include "util/figure.h"
#define PROJECT_NAME "ARMOR"
int main(int argc,char** argv) {
if (argc < 1){
printf("vm needs a paramter:finename\n");
return 0;
}
printf("-----Welcome to Armor!-----\n");
print_str(PROJECT_NAME);
Universe::genesis();
printf("1\n");
BufferedInputStream stream(argv[1]);
BinaryFileParser parser(&stream);
CodeObject* main_code = parser.parse();
Interpreter* interpreter = Interpreter::get_instance();
//dict->get(new PyString("__name__"))->print();
interpreter->run(main_code);
return 0;
}