-
Notifications
You must be signed in to change notification settings - Fork 0
/
field_desc.hh
48 lines (40 loc) · 1.02 KB
/
field_desc.hh
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
#ifndef FIELD_DESC_HH
#define FIELD_DESC_HH
#ifdef VISUAL_CPP
using namespace std;
#pragma warning (disable : 4786)
#endif
#include "component_desc.hh"
#include "utf_string.hh"
class const_name_and_type;
class class_desc;
class field_desc : public component_desc {
public:
field_desc* next;
int attr;
enum {
f_static = 0x0008,
f_final = 0x0010,
f_volatile = 0x0040,
f_used = 0x10000,
f_serialized = 0x20000 // field is accessed only from methods
// of related classes
};
const field_desc* equals; // value that has been assigned, or NULL == unknown
const_name_and_type* name_and_type; // NULL == unknown
vector<int> writes;
void write(int linenumber) {
// mark field as written to
writes.push_back(linenumber);
}
field_desc(utf_string const& field_name, class_desc* owner,
field_desc* chain)
: component_desc(field_name, owner)
{
equals = NULL;
name_and_type = NULL;
next = chain;
attr = f_serialized;
}
};
#endif