diff options
author | Li Jin <dragon-fly@qq.com> | 2019-10-29 11:25:27 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2019-10-29 11:25:27 +0800 |
commit | 975167856ed0b11c2ede03c6eb750ca4e4a6a7fc (patch) | |
tree | fa4369fe7e7d49c63cae93d6c5b52b78116f58cd /MoonParser/moon_compiler.h | |
parent | 726fee3152c81fdac7e3ad5f663bfbea8f99ddd8 (diff) | |
download | yuescript-975167856ed0b11c2ede03c6eb750ca4e4a6a7fc.tar.gz yuescript-975167856ed0b11c2ede03c6eb750ca4e4a6a7fc.tar.bz2 yuescript-975167856ed0b11c2ede03c6eb750ca4e4a6a7fc.zip |
complete moon compiler in C++.
Diffstat (limited to 'MoonParser/moon_compiler.h')
-rw-r--r-- | MoonParser/moon_compiler.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/MoonParser/moon_compiler.h b/MoonParser/moon_compiler.h new file mode 100644 index 0000000..e54c774 --- /dev/null +++ b/MoonParser/moon_compiler.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <string> | ||
4 | #include <tuple> | ||
5 | #include <list> | ||
6 | |||
7 | namespace MoonP { | ||
8 | |||
9 | std::pair<std::string,std::string> moonCompile(const std::string& codes, bool implicitReturnRoot = true, bool lineNumber = true); | ||
10 | |||
11 | struct GlobalVar { | ||
12 | std::string name; | ||
13 | int line; | ||
14 | int col; | ||
15 | }; | ||
16 | std::pair<std::string,std::string> moonCompile(const std::string& codes, std::list<GlobalVar>& globals, bool implicitReturnRoot = true, bool lineNumber = true); | ||
17 | |||
18 | } // namespace MoonP | ||