-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (43 loc) · 1.41 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//#include "PreProcessor.hpp"
#include "./LL.hpp"
#include <iostream>
#include <string>
int main(int argc,char *argv[]){
#if defined(StartSyntaxAnalysis)
SyntaxAnalyzer Syntaxanalyzer(argv[1]);
Syntaxanalyzer.BuildAST();
BulidObejctCode(argv[1]);
Syntaxanalyzer.ReOpenFile(argv[1]);
Syntaxanalyzer.BuildAST();
WriteInfo(assemble_file,"main");
/* for(auto iter:Anonymous_domain){
std::cout << "Level: " << iter.first << std::endl;
for(auto iter_:iter.second.value_info){
std::cout << iter_.value_name << std::endl;
}
}*/
/* for(auto iter:func_double_label){
for(auto iter_:iter.second){
std::cout << iter.first << " " << iter_.first << " " << iter_.second << std::flush;
}
}*/
/* for(auto iter:localvalue["main"].value_info){
std::cout << iter.value_name << std::endl;
}*/
#elif defined(StartTokenAnalysis)
TokenAnalyzer TokenAnalyzer;
TokenAnalyzer.SetFileName(argv[1]);
TOKEN token = TokenAnalyzer.NextToken();
while(!TokenAnalyzer.isEOF()){
std::cout << token.tokenValue.StringValue << std::endl;
token = TokenAnalyzer.NextToken();
}
#elif defined(StartPreProcess)
PreProcessor Preprocessor;
Preprocessor.getFileName(argv[_FILENAME]);
Preprocessor.setFileName(argv[_FILENAME]);
Preprocessor.StartPreProcessor();
Preprocessor.ClearFile();
#endif
return 0;
}