]> pd.if.org Git - lice/blob - gen.h
autocommit for files dated 2014-11-17 20:15:26
[lice] / gen.h
1 #ifndef LICE_GEN_HDR
2 #define LICE_GEN_HDR
3 #include "ast.h"
4
5 extern char *gen_label_break;
6 extern char *gen_label_continue;
7 extern char *gen_label_switch;
8 extern char *gen_label_break_backup;
9 extern char *gen_label_continue_backup;
10 extern char *gen_label_switch_backup;
11
12 /* emitters */
13 void gen_emit(const char *fmt, ...);
14 void gen_emit_inline(const char *fmt, ...);
15
16 /* jump */
17 void gen_jump(const char *label);
18 void gen_jump_backup(void);
19 void gen_jump_save(char *lbreak, char *lcontinue);
20 void gen_jump_restore(void);
21 void gen_jump_break(void);
22 void gen_jump_continue(void);
23
24 /* label */
25 void gen_label(const char *label);
26 void gen_label_default(void);
27
28 /* expression */
29 void gen_expression(ast_t *ast);
30
31 /* semantics */
32 void gen_ensure_lva(ast_t *ast);
33
34 /* need to implement */
35 void gen_return(void);
36 void gen_literal(ast_t *ast);
37 void gen_literal_string(ast_t *ast);
38 void gen_literal_save(ast_t *ast, data_type_t *, int);
39 void gen_save_local(data_type_t *type, int offset);
40 void gen_variable_local(ast_t *ast);
41 void gen_variable_global(ast_t *ast);
42 void gen_dereference(ast_t *ast);
43 void gen_address(ast_t *ast);
44 void gen_binary(ast_t *ast);
45 void gen_zero(int start, int end);
46 void gen_je(const char *label);
47 void gen_data(ast_t *, int, int);
48 void gen_function_call(ast_t *ast);
49 void gen_case(ast_t *ast);
50 void gen_va_start(ast_t *ast);
51 void gen_va_arg(ast_t *ast);
52 void gen_not(ast_t *ast);
53 void gen_and(ast_t *ast);
54 void gen_or(ast_t *ast);
55 void gen_postfix(ast_t *, const char *);
56 void gen_prefix(ast_t *, const char *);
57 void gen_cast(ast_t *ast);
58 void gen_struct(ast_t *);
59 void gen_bitandor(ast_t *ast);
60 void gen_bitnot(ast_t *ast);
61 void gen_assign(ast_t *ast);
62 void gen_function(ast_t *ast);
63 void gen_function_prologue(ast_t *ast);
64 void gen_function_epilogue(void);
65 void gen_boolean_maybe(data_type_t *);
66 void gen_negate(ast_t *ast);
67 void gen_conversion(ast_t *ast);
68 void gen_address_label(ast_t *ast);
69 void gen_goto_computed(ast_t *ast);
70
71 /* entry */
72 void gen_toplevel(ast_t *);
73 #endif