-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.h
55 lines (49 loc) · 1.03 KB
/
pipeline.h
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
46
47
48
49
50
51
52
53
54
55
//
// Created by 23207 on 2020/10/4.
//
#ifndef COMPILER_PIPELINE_H
#define COMPILER_PIPELINE_H
#include "word_parsing.h"
#include "grammar.h"
#include "mips.h"
#include "flow_graph.h"
void task2() {
// lexical analysis
parse_symbols();
output_symbols_to_file();
// you can use the following function to DEBUG.
// output_symbols_to_console();
}
void task3() {
// grammar analysis
t3 = true;
parse_symbols();
list_it = symbols.cbegin();
sym = getsym();
g_programme();
}
void task4() {
// error processing
t4 = true;
parse_symbols();
list_it = symbols.cbegin();
sym = getsym();
g_programme();
output_errors();
}
void task5() {
// semantic analysis & code generation
t5 = true;
parse_symbols();
list_it = symbols.cbegin();
sym = getsym();
g_programme();
pcode2quardcode();
output_qcodes_to_file();
if (o2) {
optimization_for_qcodes();
output_optimized_qcodes_to_file();
}
qcodes2mips();
}
#endif //COMPILER_PIPELINE_H