-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtranslate.h
71 lines (60 loc) · 1.48 KB
/
translate.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
#ifndef FILE_TRANSLATE_H
#define FILE_TRANSLATE_H
typedef struct NODE_TRANS_RECORD
{
enum
{
TRANS_CONST,
TRANS_ADDRESS,
TRANS_LABEL,
TRANS_SYMBOL
} type;
int record;
int flag;
} NODE_TRANS_RECORD;
typedef struct
{
char *op;
NODE_TRANS_RECORD rec[3];
} NODE_TRANS_INSTR;
typedef struct NODE_TRANS
{
int num;
int size;
NODE_TRANS_INSTR *instr;
} NODE_TRANS;
typedef struct
{
char *op;
int num;
} NODE_TRANS_INSTR_FORMAT;
typedef struct
{
NODE_TRANS_RECORD lstart;
NODE_TRANS_RECORD lend;
NODE_TRANS_RECORD lcontinue;
} NODE_TRANS_LOOP_LABEL;
typedef struct
{
NODE_TRANS *trans;
NODE_TRANS_RECORD pos;
} NODE_TRANS_VLA;
NODE_TRANS_VLA * tree_translate_new_vla(int len);
NODE_TRANS_RECORD tree_translate_record_new_const(int rec);
NODE_TRANS_RECORD tree_translate_record_new_address(int len);
NODE_TRANS_RECORD tree_translate_record_new_label();
NODE_TRANS * tree_translate_new();
void tree_translate_enlarge(NODE_TRANS *node);
NODE_TRANS * tree_translate_makelist(char *str, int num, ...);
NODE_TRANS * tree_translate_merge(int num, ...);
void tree_translate_main(NODE_T *node, int flag);
void tree_translate_output();
void tree_translate_init();
void tree_translate_end();
//extern NODE_TYPE *ttdeclarationtype;
//extern char *ttdeclarationid;
extern NODE_TRANS_INSTR_FORMAT ttinstrformat[];
extern FILE *fouttrans;
extern NODE_T *ttdeclarationcurrent;
extern struct NODE_TYPE *ttdelarationtype;
#endif