1 module bf_executor;
2 
3 import bf_parser;
4 import bf_analyzer;
5 import bf_compiler;
6 
7 /**
8  If the Bf-Programm does not use any input;
9  This template aliases itself to the output of the program.
10  Otherwise It aliases itself to a function representing the program. 
11 */
12 
13 template execute(string programm)
14 {
15     enum parsed = parseBf(programm);
16     static if (usesInput(parsed))
17     {
18         enum execute = mixin(parsed.genCode(TargetEnum.AnonymousFunction));
19     }
20     else
21     {
22         enum execute = mixin(parsed.genCode(TargetEnum.AnonymousFunction))([]);
23     }
24 
25 }