-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
27 lines (26 loc) · 874 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
#include <iostream>
#include "./error/ErrorList.h"
#include "./lexical/Lexical.h"
#include "./syntax/Action.hpp"
#include "./syntax/Goto.hpp"
#include <iostream>
using namespace std;
int main(void) {
ErrorList errorList = new ErrorListClass();
string expression;
Lexical lexical = new LexicalClass();
ActionTable actionTable = new ActionTableClass();
actionTable->readTableFromText("../syntax/action.txt");
GotoTable gotoTable = new GotoTableClass();
gotoTable->readTableFromText("../syntax/goto.txt");
gotoTable->show();
int line = 0;
while (getline(cin, expression) && expression != "$") {
++line;
LexicalCodeList lexicalCodeList = new LexicalCodeListClass();
lexical->analysis(errorList, lexicalCodeList, expression, line);
lexicalCodeList->show();
}
errorList->showError();
return 0;
}