-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtosol.h
96 lines (74 loc) · 1.53 KB
/
tosol.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*==============================================================================
$Id$
tosol.cpp
tosol++ is an extension of Sol, a tool to integrate C/CPP code with Lua
==============================================================================*/
#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <sstream>
#include <array>
#include <list>
#include <map>
#include <vector>
#define TOSOL_VERSION "0.1.0"
#define String std::string
class SignatureDef
{
public:
void CreateFromString(String& str, bool isCtor);
std::vector < std::tuple<String, String>> parameters;
String Construct(int numParameter);
String Callers(int numParameters);
String Signature();
bool hasDefaultParameter;
bool isUnary;
bool isConst;
int GetNumExplicitParameters() const;
};
class MethodDef
{
public:
bool isConst;
bool isStatic;
bool isOverload;
bool forceStrongType;
String returnType;
String methodName;
std::vector<SignatureDef> overloads;
};
class ConstructorDef
{
public:
bool isOverload;
SignatureDef overload;
};
class VariableDef
{
public:
bool isConst;
bool isStatic;
String varType;
String varName;
};
class ClassDef
{
public:
bool isExplicit;
String name;
String aliasName;
String moduleName;
std::list<VariableDef> variables;
std::list<MethodDef> methods;
std::list<ConstructorDef> ctors;
std::list<String> inherits;
};
class SourceDef
{
public:
std::list<ClassDef*> classes;
void Parse(char * value);
std::vector<String> lines;
String namespaceName;
String moduleName;
String GenerateCode(String name);
};