#include #include #include #include #include #include #include #include #include "blt/std/format.h" int main(int argc, const char** argv) { std::string file{"../mandelbrot.bf"}; if (argc > 1) file = argv[1]; auto program = blt::fs::loadBrainFuckFile(file); std::ofstream out{"../mips2.asm"}; bf_tokenizer tokenizer(program); codegen(tokenizer, out); BLT_START_INTERVAL("Interpreters", "Basic"); //interpret_bf(program); BLT_END_INTERVAL("Interpreters", "Basic"); BLT_START_INTERVAL("Interpreters", "Tokens"); interpret_bf(tokenizer); BLT_END_INTERVAL("Interpreters", "Tokens"); BLT_START_INTERVAL("Interpreters", "Tokens Dynamic Dispatch"); interpret_bf_dynamic(tokenizer); BLT_END_INTERVAL("Interpreters", "Tokens Dynamic Dispatch"); BLT_START_INTERVAL("Interpreters", "Tokens Matching"); interpret_bf_matching(tokenizer); BLT_END_INTERVAL("Interpreters", "Tokens Matching"); BLT_PRINT_PROFILE("Interpreters"); //interpret_bf(program); return 0; }