aboutsummaryrefslogtreecommitdiff
path: root/src/generator.h
diff options
context:
space:
mode:
authorpacien2018-05-07 14:44:11 +0200
committerpacien2018-05-07 14:44:11 +0200
commit008d12251620366c3972c8884a33c63ddf4843ba (patch)
tree2f6b974e36742ec1048bcc0a72ea03f3d5f45d47 /src/generator.h
parent91468b81ccad51eb3f8c0fbc90270a893ff040a9 (diff)
downloadtpc-compiler-008d12251620366c3972c8884a33c63ddf4843ba.tar.gz
Extract generator functions (partial commit pt2)
Diffstat (limited to 'src/generator.h')
-rw-r--r--src/generator.h22
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
14void prologue(); 14void gen_prologue();
15void const_declaration(); 15void gen_const_declaration();
16void declaration(const char name[], int type, Scope scope); 16void gen_declaration(const char name[], int type, Scope scope);
17
18void gen_read(const char name[], Scope scope);
19void gen_print();
20
21void gen_if_label(int idx);
22void gen_if_start(int idx);
23void gen_if_end(int idx);
24void gen_ifelse_end(int idx);
25
26void gen_assign(int ident, Scope scope);
27void gen_or(int left, int right, int idx);
28void gen_and(int left, int right, int idx);
29void gen_eq(const char op[], int left, int right, int idx);
30void gen_order(const char op[], int left, int right, int idx);
31void gen_addsub(char op, int left, int right);
32void gen_divstar(char op, int left, int right);
17 33
18#endif 34#endif