-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathint.h
112 lines (86 loc) · 2.33 KB
/
int.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
typedef enum { typeIdentifierNode, typeFloatValue, typeShortValue, typeCharValue, typeLongValue, typeDoubleValue, typeStringValue, typeIntegerValue, typeOpr } nodeEnum;
typedef enum { f, t } boolean;
typedef struct integerValueNode{
long value;
}integerValueNode;
typedef struct doubleValueNode{
double value;
}doubleValueNode;
typedef struct shortValueNode{
short value;
}shortValueNode;
typedef struct stringValueNode{
char *value;
}stringValueNode;
typedef struct stringDefineNode{
char *value;
}stringDefineNode;
typedef struct intDefineNode{
int value;
}intDefineNode;
typedef struct floatDefineNode{
float value;
}floatDefineNode;
typedef struct charDefineNode{
char value;
}charDefineNode;
typedef struct shortDefineNode{
short value;
}shortDefineNode;
typedef struct doubleDefineNode{
double value;
}doubleDefineNode;
typedef struct longDefineNode{
long value;
}longDefineNode;
typedef struct identifierNode{
char *name;
}identifierNode;
typedef struct valueNode{
stringDefineNode *strValue;
intDefineNode *intValue;
charDefineNode *charValue;
doubleDefineNode *doubleValue;
longDefineNode *longValue;
floatDefineNode *floatValue;
shortDefineNode *shortValue;
}valueNode;
typedef struct {
int oper;
int nops;
struct nodeTypeTag *op[1];
} oprNode;
typedef struct nodeTypeTag{
nodeEnum type;
union {
integerValueNode intV;
stringValueNode strV;
identifierNode ide;
doubleValueNode douV;
oprNode opr;
};
}nodeType;
typedef struct runTimeValue{
char *error;
int *iValue;
char *cValue;
char *stValue;
float *fValue;
long *lValue;
double *dValue;
short *shValue;
int *boValue;
}runTimeValue;
typedef struct symbolTable{
char *name;
struct symbolTable *next;
struct valueNode value;
}symbolTable;
struct scope{
boolean active;
struct symbolTable symTab;
struct scope *next;
}scope;
runTimeValue *globalRunTimeValue;
symbolTable *globalSymbolTable;
symbolTable *initialize();