roza/lib/compiler.h

34 lines
710 B
C
Raw Normal View History

2023-12-09 17:24:41 +00:00
#ifndef RZ_COMPILER_H
#define RZ_COMPILER_H
#include "commons.h"
#include "err.h"
#include "mod.h"
#include "node.h"
#include "tysy.h"
#include "sym.h"
2023-12-09 17:24:41 +00:00
2023-12-23 20:17:12 +00:00
typedef struct compiler {
struct compiler* parent;
sym_t* sym;
2023-12-09 17:24:41 +00:00
tysy_t* tysy;
err_t* err;
int scope;
2023-12-23 20:17:12 +00:00
int* id;
2023-12-09 17:24:41 +00:00
} compiler_t;
void compiler_init(compiler_t* compiler,
2023-12-23 20:17:12 +00:00
int* id,
sym_t* sym,
tysy_t* tysy,
err_t* err);
2023-12-09 17:24:41 +00:00
void compiler_free(compiler_t* compiler);
2023-12-20 19:54:58 +00:00
int compiler_run(compiler_t* compiler, node_t* node, program_t* program);
void compiler_run_if(compiler_t* compiler, node_t* node, program_t* program,
2023-12-18 18:34:31 +00:00
int* end_points, size_t* sz);
2023-12-09 17:24:41 +00:00
#endif