-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunc.cpp
More file actions
62 lines (49 loc) · 1.03 KB
/
Copy pathFunc.cpp
File metadata and controls
62 lines (49 loc) · 1.03 KB
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
56
57
58
59
60
61
62
//
// Created by ydl on 18-6-16.
//
#include "Func.h"
Block::Block(){
id=0;
}
Block::Block(int _id, bool ret) {
if (ret) id = 1;
else {
id = _id;
}
judge = false;
}
void Block::insert(assign as) {
container.push_back(as);
}
void Block::insertjudge(string o, string o1, string o2, int t, int f, Func &parent) {
op = o;
op1 = o1;
op2 = o2;
tid = t;
fid = f;
judge = true;
parent.tails[id].insert(t);
parent.tails[id].insert(f);
parent.heads[t].insert(id);
parent.heads[f].insert(id);
}
void Block::insertgoto(int t, Func &parent) {
tid = t;
parent.tails[id].insert(t);
parent.heads[t].insert(id);
}
void Block::insertret(string s) {
ret = s;
}
void Func::insertsym(string s, int n) {
symtbl.insert(make_pair(s, n));
}
void Func::insertblk(Block b, int n) {
container[n] = b;
}
void Func::insertdecl(string s, string type) {
decltbl.insert(make_pair(s, type));
}
void Func::insertpara(string s, string type) {
parm.insert(make_pair(s,type));
}