-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInfoTree.h
82 lines (71 loc) · 1.61 KB
/
InfoTree.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DIFF_INFO_TREE_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DIFF_INFO_TREE_H
namespace clang {
namespace diff {
enum RTEDTree {
LEFT,
RIGHT,
HEAVY,
BOTH,
REVLEFT,
REVRIGHT,
REVHEAVY,
};
enum Indeces {
POST2_SIZE = 0,
POST2_KR_SUM,
POST2_REV_KR_SUM,
POST2_DESC_SUM,
POST2_PRE,
POST2_PARENT,
POST2_LABEL,
KR,
POST2_LLD,
POST2_MIN_KR,
RKR,
RPOST2_RLD,
RPOST2_MIN_RKR,
RPOST2_POST,
POST2_STRATEGY,
PRE2_POST,
};
class LblTree;
class LabelDictionary;
class InfoTree {
public:
InfoTree(LblTree* aInputTree, LabelDictionary* aLd);
public:
virtual int getSize();
virtual bool ifNodeOfType(int postorder, int type);
virtual bool[] getNodeTypeArray_(int type);
virtual int getInfo(int infoCode, int nodesPostorder);
virtual int[] getInfoArray_(int infoCode);
virtual int[] getNodeRelSubtrees(int pathType, int nodePostorder);
virtual int[] getPath(int pathType);
virtual int getCurrentNode();
virtual void setCurrentNode(int postorder);
static int[] toIntArray(std::vector<int>& integers);
virtual void setSwitched(bool value);
virtual bool isSwitched();
int info[][];
bool nodeType[][];
private:
int gatherInfo(LblTree* aT, int postorder);
void postTraversalProcessing();
LblTree* inputTree;
LabelDictionary* ld;
int paths[][];
int relSubtrees[][][];
int sizeTmp;
int descSizesTmp;
int krSizesSumTmp;
int revkrSizesSumTmp;
int preorderTmp;
int currentNode;
bool switched;
int leafCount;
int treeSize;
};
} // namespace diff
} // namespace clang
#endif