-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (30 loc) · 859 Bytes
/
main.cpp
File metadata and controls
31 lines (30 loc) · 859 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
#include<bits/stdc++.h>
#include"head.h"
using namespace std;
int runCompil();
vector<Word> words; //token序列
vector<Quadruple> qua_list; //四元式序列
//vector<Synbl> synbl; //符号表
vector<vector<Synbl> > sbl(4); //主函数符号表1int2char3bool4float
vector<vector<Synbl> > vall(4); //子函数符号表,结构同主函数
vector<Arr> arrs; //主函数数组表
vector<Arr> sub_arrs; //子函数数组表
vector<int> consl; //常数表;
vector<string> const_C; //常字符
vector<string> const_S; //常字符串
vector<string> struc_symbol; //第一个值是结构体名字,第二个开始是结构体中变量名
//int token_i = 0;
//int qua_i;
int main()
{
lex();
//for(int i = 0; i < words.size(); i++)
// cout<<words[i].type<<" "<<words[i].value<<endl;
if(translate()) {
cout<<"success"<<endl;
}
else
cout<<"fail"<<endl;
runCompil();
//assembly();
}