-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructs.h
More file actions
36 lines (30 loc) · 1013 Bytes
/
Structs.h
File metadata and controls
36 lines (30 loc) · 1013 Bytes
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
typedef enum {Const_Type, Identifier_Type, Opr_Type} NodeEnum;
typedef enum {isInteger, isFloat, isChar, isString} TypeEnum;
/*typedef enum {NotDeclared, isConst, Declared} PermissionEnum;*/
typedef enum {Accepted, isConst, NotDeclared} PermissionEnum;
/* Node for Constants const int x*/
typedef struct {
TypeEnum ConstType;
char *Value;
} ConstNode;
/* Node for Identifiers */
typedef struct {
/*int SymIndex;*/
TypeEnum IdentiType;
PermissionEnum IdentPermission;
char *IdentName;
} IdentifierNode;
/* Node for Operators */
typedef struct {
int oper; /* operator */
int nops; /* number of operands */
struct nodeTypeTag *op[1]; /* operands, extended at runtime */
} OperNode;
typedef struct nodeTypeTag {
NodeEnum type; /* type of node */
union {
ConstNode con; /* constants */
IdentifierNode id; /* identifiers */
OperNode opr; /* operators */
};
} nodeType;