-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCStruct.h
More file actions
70 lines (58 loc) · 1.35 KB
/
CStruct.h
File metadata and controls
70 lines (58 loc) · 1.35 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
63
64
65
66
67
68
69
70
#include <utility>
#include <string>
using namespace std;
#ifndef CSTRUCT_H
#define CSTRUCT_H
/**
* This file contains the data structure for the change information
**/
enum ChangeType { REMOVED, ADDED, MODIFIED, DEFAULT };
enum ExprType { BOOLTY, BINARY, SCALAR };
enum ActionType { NONE, FILTER, MEMORY,METHOD,CONDITION,LAST };
struct sourceinfo {
string scode;
string file_name;
unsigned int lineNo;
ExprType etype;
list<std::string> vars;
};
struct methodinfo {
string paramList;
string returnType;
string methodName;
int numParam;
};
struct changeinfo {
pair<int,int> frange;
pair<int,int> trange;
ChangeType ctype;
list<sourceinfo> sources;
};
struct susinfo {
string fileName;
double susVal;
unsigned int lineNo;
std::string atype;
};
inline sourceinfo copySourceInfo(std::string scode,std::string fname,unsigned int line){
sourceinfo tinfo;
tinfo.scode = scode;
tinfo.file_name = fname;
tinfo.lineNo = line;
return tinfo;
}
struct Comparator{
bool operator()(const sourceinfo& l, const sourceinfo& r) const
{
return (std::strcmp(l.scode.c_str(),r.scode.c_str())<0);
}
};
struct MComparator{
bool operator()(const methodinfo& l, const methodinfo& r) const
{
string lstr =l.methodName+l.paramList;
string rstr =r.methodName+r.paramList;
return (std::strcmp(lstr.c_str(),rstr.c_str())<0);
}
};
#endif