diff options
author | pacien | 2018-05-07 14:44:11 +0200 |
---|---|---|
committer | pacien | 2018-05-07 14:44:11 +0200 |
commit | 008d12251620366c3972c8884a33c63ddf4843ba (patch) | |
tree | 2f6b974e36742ec1048bcc0a72ea03f3d5f45d47 /src/generator.h | |
parent | 91468b81ccad51eb3f8c0fbc90270a893ff040a9 (diff) | |
download | tpc-compiler-008d12251620366c3972c8884a33c63ddf4843ba.tar.gz |
Extract generator functions (partial commit pt2)
Diffstat (limited to 'src/generator.h')
-rw-r--r-- | src/generator.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/generator.h b/src/generator.h index 53acdef..17ea662 100644 --- a/src/generator.h +++ b/src/generator.h | |||
@@ -11,8 +11,24 @@ typedef enum scope { | |||
11 | LOCAL | 11 | LOCAL |
12 | } Scope; | 12 | } Scope; |
13 | 13 | ||
14 | void prologue(); | 14 | void gen_prologue(); |
15 | void const_declaration(); | 15 | void gen_const_declaration(); |
16 | void declaration(const char name[], int type, Scope scope); | 16 | void gen_declaration(const char name[], int type, Scope scope); |
17 | |||
18 | void gen_read(const char name[], Scope scope); | ||
19 | void gen_print(); | ||
20 | |||
21 | void gen_if_label(int idx); | ||
22 | void gen_if_start(int idx); | ||
23 | void gen_if_end(int idx); | ||
24 | void gen_ifelse_end(int idx); | ||
25 | |||
26 | void gen_assign(int ident, Scope scope); | ||
27 | void gen_or(int left, int right, int idx); | ||
28 | void gen_and(int left, int right, int idx); | ||
29 | void gen_eq(const char op[], int left, int right, int idx); | ||
30 | void gen_order(const char op[], int left, int right, int idx); | ||
31 | void gen_addsub(char op, int left, int right); | ||
32 | void gen_divstar(char op, int left, int right); | ||
17 | 33 | ||
18 | #endif | 34 | #endif |