#ifndef SK_COMPILER_H #define SK_COMPILER_H #include "commons.h" #include "prog.h" #include "sym.h" struct state; struct mod { char* name; struct module* module; }; struct compiler { struct vec var_names; struct vec modules; }; void mod_free(struct mod* self); void compiler_init(struct compiler* self); void compiler_free(struct compiler* self); void compiler_compile(struct compiler* self, struct node* node, struct prog* prog, struct sym* sym, struct state* state); void compiler_compile_children(struct compiler* self, struct node* node, struct prog* prog, struct sym* sym, struct state* state); void compiler_compile_value(struct compiler* self, struct node* node, struct prog* prog, TypeKind type, union val val); void compiler_compile_and(struct compiler* self, struct node* node, struct prog* prog, struct sym* sym, struct state* state); void compiler_compile_or(struct compiler* self, struct node* node, struct prog* prog, struct sym* sym, struct state* state); void compiler_compile_if(struct compiler* self, struct node* node, struct prog* prog, struct sym* sym, struct state* state, struct vec* to_end); #endif