aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/moon_compiler.h
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2019-10-29 11:25:27 +0800
committerLi Jin <dragon-fly@qq.com>2019-10-29 11:25:27 +0800
commit975167856ed0b11c2ede03c6eb750ca4e4a6a7fc (patch)
treefa4369fe7e7d49c63cae93d6c5b52b78116f58cd /MoonParser/moon_compiler.h
parent726fee3152c81fdac7e3ad5f663bfbea8f99ddd8 (diff)
downloadyuescript-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.h18
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
7namespace MoonP {
8
9std::pair<std::string,std::string> moonCompile(const std::string& codes, bool implicitReturnRoot = true, bool lineNumber = true);
10
11struct GlobalVar {
12 std::string name;
13 int line;
14 int col;
15};
16std::pair<std::string,std::string> moonCompile(const std::string& codes, std::list<GlobalVar>& globals, bool implicitReturnRoot = true, bool lineNumber = true);
17
18} // namespace MoonP