1
2
3
4
5
6 #ifndef SNGCM_AST_CLONE_INCLUDED
7 #define SNGCM_AST_CLONE_INCLUDED
8 #include <sngcm/ast/AstApi.hpp>
9 #include <memory>
10 #include <vector>
11
12 namespace sngcm { namespace ast {
13
14 class FunctionNode;
15
16 class CloneContext
17 {
18 public:
19 CloneContext();
20 ~CloneContext();
21 void SetInstantiateFunctionNode() { instantiateFunctionNode = true; }
22 bool InstantiateFunctionNode() const { return instantiateFunctionNode; }
23 void SetInstantiateClassNode() { instantiateClassNode = true; }
24 bool InstantiateClassNode() const { return instantiateClassNode; }
25 void SetMakeTestUnits() { makeTestUnits = true; }
26 bool MakeTestUnits() const { return makeTestUnits; }
27 void AddUnitTestFunction(FunctionNode* unitTestFunction);
28 std::std::vector<FunctionNode*>&UnitTestFunctions();
29 private:
30 bool instantiateFunctionNode;
31 bool instantiateClassNode;
32 bool makeTestUnits;
33 std::vector<FunctionNode*> unitTestFunctions;
34 };
35
36 } }
37
38 #endif // SNGCM_AST_CLONE_INCLUDED