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 <soulng/lexer/Span.hpp>
10 #include <boost/uuid/uuid.hpp>
11 #include <memory>
12 #include <vector>
13
14 namespace sngcm { namespace ast {
15
16 class FunctionNode;
17
18 using namespace soulng::lexer;
19
20 class CloneContext
21 {
22 public:
23 CloneContext();
24 ~CloneContext();
25 void SetInstantiateFunctionNode() { instantiateFunctionNode = true; }
26 bool InstantiateFunctionNode() const { return instantiateFunctionNode; }
27 void SetInstantiateClassNode() { instantiateClassNode = true; }
28 bool InstantiateClassNode() const { return instantiateClassNode; }
29 void SetMakeTestUnits() { makeTestUnits = true; }
30 bool MakeTestUnits() const { return makeTestUnits; }
31 void AddUnitTestFunction(FunctionNode* unitTestFunction);
32 std::std::vector<FunctionNode*>&UnitTestFunctions();
33 private:
34 bool instantiateFunctionNode;
35 bool instantiateClassNode;
36 bool makeTestUnits;
37 std::vector<FunctionNode*> unitTestFunctions;
38 };
39
40 } }
41
42 #endif // SNGCM_AST_CLONE_INCLUDED