diff options
Diffstat (limited to 'src/MoonP/moon_compiler.h')
-rw-r--r-- | src/MoonP/moon_compiler.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/MoonP/moon_compiler.h b/src/MoonP/moon_compiler.h index 0739a59..36fd77a 100644 --- a/src/MoonP/moon_compiler.h +++ b/src/MoonP/moon_compiler.h | |||
@@ -9,6 +9,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI | |||
9 | #pragma once | 9 | #pragma once |
10 | 10 | ||
11 | #include <string> | 11 | #include <string> |
12 | #include <string_view> | ||
12 | #include <tuple> | 13 | #include <tuple> |
13 | #include <list> | 14 | #include <list> |
14 | #include <memory> | 15 | #include <memory> |
@@ -31,6 +32,15 @@ struct GlobalVar { | |||
31 | 32 | ||
32 | using GlobalVars = std::unique_ptr<std::list<GlobalVar>>; | 33 | using GlobalVars = std::unique_ptr<std::list<GlobalVar>>; |
33 | 34 | ||
34 | std::tuple<std::string,std::string,GlobalVars> moonCompile(const std::string& codes, const MoonConfig& config = {}); | 35 | class MoonCompilerImpl; |
36 | |||
37 | class MoonCompiler { | ||
38 | public: | ||
39 | MoonCompiler(); | ||
40 | virtual ~MoonCompiler(); | ||
41 | std::tuple<std::string,std::string,GlobalVars> compile(std::string_view codes, const MoonConfig& config = {}); | ||
42 | private: | ||
43 | std::unique_ptr<MoonCompilerImpl> _compiler; | ||
44 | }; | ||
35 | 45 | ||
36 | } // namespace MoonP | 46 | } // namespace MoonP |