-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.h
More file actions
45 lines (37 loc) · 1.19 KB
/
project.h
File metadata and controls
45 lines (37 loc) · 1.19 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
typedef enum { typeCon, typeId, typeOpr } nodeEnum;
typedef enum { typeInt, typeFloat,typeString,typeChar,NONE } conEnum;
/* constants */
typedef struct conNodeTypeStruct {
conEnum type; //None is used for variables that wasn't defined with a data type
//char* name;
int initialized;
union{
int intValue;
float floatValue;
char stringValue[100];
}; /* value of constant */
} conNodeType;
/* identifiers */
typedef struct {
int i; /* subscript to sym array */
} idNodeType;
/* operators */
typedef struct {
int oper; /* operator */
int nops; /* number of operands */
struct nodeTypeTag *op[1]; /* operands, extended at runtime */
} oprNodeType;
typedef struct nodeTypeTag {
nodeEnum type; /* type of node */
union {
idNodeType id; /* identifiers */
oprNodeType opr; /* operators */
conNodeType con; /* constants */
};
} nodeType;
extern conNodeType* sym[100];
extern int globalIndex;
extern char* name[100];
extern int available[100];
extern char currentVariable[100];
extern int currentVariableFlag;