Interpret program given in argv
This commit is contained in:
@ -10,6 +10,7 @@ include_directories(include)
|
|||||||
add_executable(bfuck
|
add_executable(bfuck
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
src/lex.cpp
|
src/lex.cpp
|
||||||
|
src/interpret.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# target_link_libraries(lasm Boost::program_options)
|
# target_link_libraries(lasm Boost::program_options)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "lex.hpp"
|
#include "lex.hpp"
|
||||||
|
#include "interpret.hpp"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@ -9,7 +10,12 @@ int main(int argc, char **argv) {
|
|||||||
std::cout << "Running " << argv[1] << "...\n" << std::endl;
|
std::cout << "Running " << argv[1] << "...\n" << std::endl;
|
||||||
|
|
||||||
std::string tokens;
|
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;
|
return 0;
|
||||||
}
|
}
|
Reference in New Issue
Block a user