forked from Accept-automaton/compilation_principle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (26 loc) · 922 Bytes
/
main.cpp
File metadata and controls
36 lines (26 loc) · 922 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
27
28
29
30
31
32
33
34
35
36
#include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include"Compilation_Principle.h"
#include"Lexcial_Analysis.cpp"
#include"Syntax_Analysis.cpp"
int main(int argc, char *argv[])
{
// if (argc <= 3)
// {
// std::cout << "Usage: " << "<input path> <lexcial output path> <synatx output path>" << std::endl;
// exit(EXIT_FAILURE);
// }
// const char *input_path = argv[1];
// const char *lexcial_output_path = argv[2];
// const char *syntax_output_path = argv[3];
const char *input_path = "d:/program.txt";
const char *lexcial_output_path = "lexcial_result.txt";
const char *syntax_output_path = "synatx_result.txt";
init_lexcial_analysis();
init_syntax_analysis();
std::vector< std::pair<std::string, std::pair<std::string, std::string> > > lexcial;
lexcial = lexcial_analysis(input_path, lexcial_output_path);
return 0;
}