-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
36 lines (25 loc) · 946 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include "charlist.hpp"
#include "brainfuck_machine.hpp"
template <typename T> class debug_t;
#ifndef INPUT_STR
#define INPUT_STR ""
#endif
#ifndef PROGRAM_STR
// "Hello World" Program
#define PROGRAM_STR "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++." \
".+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.+++."
#endif
struct input_str { static constexpr const char * str() { return INPUT_STR; } };
struct program_str { static constexpr const char * str() { return PROGRAM_STR; } };
int main()
{
using input_list = string_list_t<input_str>;
using prog = string_list_t<program_str>;
using BFM = bfm::io_bfm<bfm::make_t, input_list, tl::null_t>;
using output = bfm::run_tm_t<BFM, prog>::output;
// Print output or state in a compiler error message
//debug_t<tl_to_varlist<output>::list> t;
puts(tl_to_varlist<output>::str());
return 0;
};