-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsemantics.h
More file actions
76 lines (58 loc) · 1.08 KB
/
semantics.h
File metadata and controls
76 lines (58 loc) · 1.08 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
#ifndef __SEMANTICS_H__
#define __SEMANTICS_H__
#include "type.h"
struct type;
typedef struct var {
struct type *type;
char *name;
int offset;
int id;
} var_t;
typedef struct vars {
var_t *var;
struct vars *next;
} vars_t;
typedef struct frame {
vars_t *var_list;
struct frame *parent;
int size;
} frame_t;
struct struct_;
typedef struct type {
typeid_t typeid;
int size;
} type_t;
typedef struct type_array {
typeid_t typeid;
int size;
int num;
type_t *next;
} type_array_t;
typedef struct type_struct {
typeid_t typeid;
int size;
struct struct_ *struct_;
} type_struct_t;
typedef struct type_func {
typeid_t typeid;
int size;
vars_t *arg_list;
type_t *ret;
} type_func_t;
typedef struct type_ref {
typeid_t typeid;
int size;
type_t *ref;
} type_ref_t;
var_t *lookup_var_deep(frame_t *frame, const char *name);
typedef struct struct_ {
char *name;
struct frame *fields;
} struct__t;
extern type_t INT, FLOAT, ERROR;
typedef struct structs {
struct__t *struct_;
struct structs *next;
} structs_t;
structs_t *get_struct_list();
#endif