From 008d12251620366c3972c8884a33c63ddf4843ba Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 7 May 2018 14:44:11 +0200 Subject: Extract generator functions (partial commit pt2) --- src/generator.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/generator.h') 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 { LOCAL } Scope; -void prologue(); -void const_declaration(); -void declaration(const char name[], int type, Scope scope); +void gen_prologue(); +void gen_const_declaration(); +void gen_declaration(const char name[], int type, Scope scope); + +void gen_read(const char name[], Scope scope); +void gen_print(); + +void gen_if_label(int idx); +void gen_if_start(int idx); +void gen_if_end(int idx); +void gen_ifelse_end(int idx); + +void gen_assign(int ident, Scope scope); +void gen_or(int left, int right, int idx); +void gen_and(int left, int right, int idx); +void gen_eq(const char op[], int left, int right, int idx); +void gen_order(const char op[], int left, int right, int idx); +void gen_addsub(char op, int left, int right); +void gen_divstar(char op, int left, int right); #endif -- cgit v1.2.3