-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexec.h
36 lines (28 loc) · 810 Bytes
/
exec.h
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
// exec() and Execution combine the steps
// of processing Fn code to provide an easy interface
// for executing Fn code.
#pragma once
#include <string> // std::string
#include "src/parser/parser.h" // Parser
#include "src/codegen/codegen.h" // CodeGenerator
#include "src/vm/vm.h" // VM
namespace fn {
vm::Value* execFile(const char fileName[]);
vm::Value* execCode(std::string code);
class Execution {
bool debug;
Parser parser;
CodeGenerator generator;
VM vm;
public:
Execution(bool debug) {
this->debug = debug;
this->parser = Parser(debug);
this->generator = CodeGenerator(debug);
this->vm = VM(debug);
}
Execution() : Execution(false) {}
vm::Value* execFile(const char fileName[]);
vm::Value* execCode(std::string code);
};
}