diff --git a/CMakeLists.txt b/CMakeLists.txt index c06b514..821f793 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,8 @@ include_directories(include) add_executable(bfuck src/main.cpp - src/lex.cpp + src/lex.cpp + src/interpret.cpp ) # target_link_libraries(lasm Boost::program_options) diff --git a/src/main.cpp b/src/main.cpp index befb7aa..170a4d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,5 @@ #include "lex.hpp" +#include "interpret.hpp" #include @@ -9,7 +10,12 @@ int main(int argc, char **argv) { std::cout << "Running " << argv[1] << "...\n" << std::endl; std::string tokens; - lex_brainfuck_file(argv[1], tokens); + if (!lex_brainfuck_file(argv[1], tokens)) { + return 1; + } + + Interpreter interpreter(tokens); + interpreter.run(); return 0; } \ No newline at end of file