-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyaccObjects.h
More file actions
80 lines (64 loc) · 1.05 KB
/
yaccObjects.h
File metadata and controls
80 lines (64 loc) · 1.05 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
71
72
73
74
75
76
77
78
79
80
#ifndef YACC_OBJ_H
#define YACC_OBJ_H
#include "types/include/types.h"
typedef enum {
EXPR_NUM,
EXPR_VAR,
EXPR_OPER
} exprContent;
typedef struct {
TypeT type;
exprContent contentType;
void* content;
} y_expression;
typedef struct {
_object obj;
char* funcCreator;
} y_number;
typedef struct {
y_expression* exp1;
y_expression* exp2;
TypeT retType;
char* opName;
} y_operation;
typedef struct {
char* name;
TypeT type;
int blockNum;
} y_variable;
typedef struct {
y_variable* var;
y_expression* exp;
int isNew;
char* opName;
} y_assign;
typedef struct {
char* compFunc;
y_expression* exp1;
y_expression* exp2;
} y_boolExpr;
typedef struct {
int type;
void* content;
} y_inst;
typedef struct y_node {
struct y_node* next;
y_inst* inst;
} y_node;
typedef struct Prog{
y_node* first;
} y_prog;
typedef struct {
y_boolExpr* boolExp;
y_prog* prevProg;
y_prog* prog;
} y_if;
typedef struct {
y_variable* var;
y_expression* expr;
} y_addList;
typedef struct GlobVars{
y_variable* var;
struct GlobVars* next;
} y_globVars;
#endif