-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext.h
More file actions
30 lines (22 loc) · 706 Bytes
/
context.h
File metadata and controls
30 lines (22 loc) · 706 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
#ifndef CONTEXT_H
#define CONTEXT_H
#ifdef __cplusplus
extern "C" {
#endif
// Context gathers all of the data structures needed for
// semantic analysis, code generation, and code optimization.
struct Node;
struct Context;
struct Context* context_create(struct Node* ast);
void context_destroy(struct Context* ctx);
// This function can be called multiple times to configure
// compilation options. Flags available:
// 's' - print symbol table info
void context_set_flag(struct Context* ctx, char flag);
void context_build_symtab(struct Context* ctx);
void context_generate_hl_code(struct Context* ctx);
void context_compile(struct Context* ctx);
#ifdef __cplusplus
}
#endif
#endif // CONTEXT_H