Brain  1.0.0
A fast esoteric language!
Bootstrap.h
1 /* This is the source code of Brain Programming Language.
2  * It is licensed under GNU GPL v. 3 or later.
3  * You should have received a copy of the license in this archive (see LICENSE).
4  *
5  * Copyright Brain, 2016.
6  */
7 
8 #ifndef BOOTSTRAP_H
9 #define BOOTSTRAP_H
10 
11 #include <llvm/ExecutionEngine/SectionMemoryManager.h>
12 #include <llvm/ExecutionEngine/ExecutionEngine.h>
13 #include <llvm/ExecutionEngine/GenericValue.h>
14 #include <llvm/ExecutionEngine/MCJIT.h>
15 
16 #include <llvm/Support/ManagedStatic.h>
17 #include <llvm/Support/TargetSelect.h>
18 #include <llvm/Support/raw_ostream.h>
19 #include <llvm/Support/SourceMgr.h>
20 
21 #include <llvm/IR/LLVMContext.h>
22 #include <llvm/IR/IRBuilder.h>
23 #include <llvm/IR/Module.h>
24 #include <llvm/IR/Value.h>
25 #include <llvm/IRReader/IRReader.h>
26 
27 #include <string>
28 #include <iostream>
29 #include <vector>
30 #include <fstream>
31 #include <streambuf>
32 #include <memory>
33 
34 #include "../parser/Parser.h"
35 #include "../ast/general/ASTInfo.h"
36 #include "ArgsHandler.h"
37 #include "ArgsOptions.h"
38 
39 
44 class Bootstrap
45 {
46 private:
48  std::string io_lib;
50  std::string module_name;
52  llvm::ExecutionEngine *execution_engine;
54  llvm::EngineBuilder *engine_builder;
58  Bootstrap();
59 
60  static Bootstrap* _instance;
61 public:
62  ~Bootstrap() {}
63 
69  static Bootstrap* instance();
76  int init(int argc, char** argv);
77 };
78 
79 #endif // BOOTSTRAP_H
int init(int argc, char **argv)
Initializes Brain by passing the arguments to be handled and parsing the source file.
Definition: Bootstrap.cpp:27
static Bootstrap * instance()
Returns the instance of Bootstrap class if the member _instance is nullptr, otherwise it creates a ne...
Definition: Bootstrap.cpp:18
Class that starts Brain, it has all the needed components to initialize the Brain interpreter...
Definition: Bootstrap.h:44