-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathenv.h
More file actions
40 lines (35 loc) · 860 Bytes
/
env.h
File metadata and controls
40 lines (35 loc) · 860 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
36
37
38
39
40
#ifndef INCLUDE__ENV_H
#define INCLUDE__ENV_H
#include "symbol.h"
#include "temp.h"
#include "translate.h"
#include "types.h"
typedef struct env_entry_s *env_entry_t;
struct env_entry_s
{
enum { ENV_VAR_ENTRY, ENV_FUNC_ENTRY } kind;
union
{
struct
{
tr_access_t access;
type_t type;
bool for_;
} var;
struct
{
tr_level_t level;
tmp_label_t label;
list_t formals;
type_t result;
} func;
} u;
};
env_entry_t env_var_entry(tr_access_t access, type_t type, bool for_);
env_entry_t env_func_entry(tr_level_t level,
tmp_label_t label,
list_t formals,
type_t result);
table_t env_base_tenv(void);
table_t env_base_venv(void);
#endif