22 lines
538 B
C
22 lines
538 B
C
#ifndef BF_COMPILER_H_
|
|
#define BF_COMPILER_H_
|
|
|
|
#include <inttypes.h>
|
|
#include <stdlib.h>
|
|
|
|
enum bf_compiler_backend {
|
|
BF_COMPILER_TINYCC,
|
|
BF_COMPILER_NASM,
|
|
};
|
|
|
|
struct bf_compiler {
|
|
enum bf_compiler_backend backend;
|
|
uint32_t data_len;
|
|
uint32_t cell_size;
|
|
};
|
|
|
|
void bf_compiler_init(struct bf_compiler *compiler, enum bf_compiler_backend backend, uint32_t cell_size, uint32_t data_len);
|
|
int bf_compiler_compile(struct bf_compiler *compiler, const char *output_filename, const char *program, size_t program_len);
|
|
|
|
#endif //BF_COMPILER_H_
|