-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
31 lines (28 loc) · 776 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 <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include "Ctrl_Main.h"
using namespace std;
int main()
{
cout << "Enable parser logging? [Y/n] ";
string in_Yn;
getline(cin,in_Yn);
bool parser_logging_enabled = (in_Yn[0] == 'Y' || in_Yn[0] == 'y');
ifstream file;
string filename = "";
do{
cout << "Enter path to BrainCube source file: ";
getline(cin, filename);
file.open(filename);
if(file.bad()){
cout << "File \""<<filename<<"\" could not be opened. Please try again." << endl;
}
} while(file.bad());
stringstream buffer;
buffer << file.rdbuf();
string code = buffer.str();
Ctrl_Main mymain(code, parser_logging_enabled);
mymain.run();
}