skopy/lib/include/compiler.h

56 lines
1.6 KiB
C

#ifndef SK_COMPILER_H
#define SK_COMPILER_H
#include "commons.h"
#include "prog.h"
#include "sym.h"
struct state;
struct compiler
{
struct vec var_names;
};
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