|
bfx
An interpreter, compiler, and REPL for brainfuck-like languages
|
#include "bfx.h"Go to the source code of this file.
Macros | |
| #define | BFX_DEFAULT_COMPILER "gcc" |
| Default compiler to use when compiling generated C code. | |
| #define | BFX_DEFAULT_COMPILE_FLAGS "-O3 -s -ffast-math -static" |
| Default compile flags to use when compiling generated C code. | |
| #define | BFX_COMPILER_LDFLAGS "-lbfx -lm" |
| Default linker flags to use when compiling generated C code. | |
| #define | BFX_COMPILE_HEAD "#include <bfx/interpret.h>\nint main(void) {BFX bfx;" |
| Head of the compiled program. | |
| #define | BFX_TMP_FILE_PATH "/tmp/bfx.c" |
| Path to the temporary file used for compilation. | |
Functions | |
| void | bfx_compile (const char *, const char *, BFX *) |
| Compile Brainfuck code from input_path to output_path. | |
This file contains the public definitions for the Brainfuck-like language compiler.
| #define BFX_COMPILE_HEAD "#include <bfx/interpret.h>\nint main(void) {BFX bfx;" |
Head of the compiled program.
| #define BFX_COMPILER_LDFLAGS "-lbfx -lm" |
Default linker flags to use when compiling generated C code.
| #define BFX_DEFAULT_COMPILE_FLAGS "-O3 -s -ffast-math -static" |
Default compile flags to use when compiling generated C code.
| #define BFX_DEFAULT_COMPILER "gcc" |
Default compiler to use when compiling generated C code.
| #define BFX_TMP_FILE_PATH "/tmp/bfx.c" |
Path to the temporary file used for compilation.
| void bfx_compile | ( | const char * | input_path, |
| const char * | output_path, | ||
| BFX * | bfx | ||
| ) |
Compile Brainfuck code from input_path to output_path.
This function takes a Brainfuck source code file specified by input_path, compiles it into a C program, compiles the C program, and writes the resulting code to the file specified by output_path. If input_path is NULL, the function will read from stdin. If output_path is NULL, the function will write to ./a.out.
| input_path | Path to the input Brainfuck source code file. |
| output_path | Path to the output binary or C file. |
| bfx | BFX configuration to use for compilation. |