aboutsummaryrefslogtreecommitdiff
path: root/src/MoonP/moon_ast.cpp
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-01-10 16:30:34 +0800
committerLi Jin <dragon-fly@qq.com>2020-01-10 16:30:34 +0800
commit52a6536103f46c26a3ba9b149b0fe7b40d524d8c (patch)
tree67e4759f8e1ea922079d0e162d84ecba5e558261 /src/MoonP/moon_ast.cpp
parent975167856ed0b11c2ede03c6eb750ca4e4a6a7fc (diff)
downloadyuescript-52a6536103f46c26a3ba9b149b0fe7b40d524d8c.tar.gz
yuescript-52a6536103f46c26a3ba9b149b0fe7b40d524d8c.tar.bz2
yuescript-52a6536103f46c26a3ba9b149b0fe7b40d524d8c.zip
update.
Diffstat (limited to 'src/MoonP/moon_ast.cpp')
-rw-r--r--src/MoonP/moon_ast.cpp113
1 files changed, 113 insertions, 0 deletions
diff --git a/src/MoonP/moon_ast.cpp b/src/MoonP/moon_ast.cpp
new file mode 100644
index 0000000..0ccd0ed
--- /dev/null
+++ b/src/MoonP/moon_ast.cpp
@@ -0,0 +1,113 @@
1/* Copyright (c) 2020 Jin Li, http://www.luvfight.me
2
3Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
5The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
7THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
8
9#include "MoonP/moon_ast.h"
10
11namespace MoonP {
12
13#define AST_IMPL(type) \
14 ast<type##_t> __##type##_t(type);
15
16AST_IMPL(Num)
17AST_IMPL(Name)
18AST_IMPL(Variable)
19AST_IMPL(LuaKeyword)
20AST_IMPL(self)
21AST_IMPL(self_name)
22AST_IMPL(self_class)
23AST_IMPL(self_class_name)
24AST_IMPL(SelfName)
25AST_IMPL(KeyName)
26AST_IMPL(VarArg)
27AST_IMPL(local_flag)
28AST_IMPL(Seperator)
29AST_IMPL(NameList)
30AST_IMPL(Local)
31AST_IMPL(colon_import_name)
32AST_IMPL(Import)
33AST_IMPL(ExpListLow)
34AST_IMPL(ExpList)
35AST_IMPL(Return)
36AST_IMPL(With)
37AST_IMPL(SwitchCase)
38AST_IMPL(Switch)
39AST_IMPL(IfCond)
40AST_IMPL(If)
41AST_IMPL(Unless)
42AST_IMPL(While)
43AST_IMPL(for_step_value)
44AST_IMPL(For)
45AST_IMPL(ForEach)
46AST_IMPL(Do)
47AST_IMPL(Comprehension)
48AST_IMPL(comp_value)
49AST_IMPL(TblComprehension)
50AST_IMPL(star_exp)
51AST_IMPL(CompForEach)
52AST_IMPL(CompFor)
53AST_IMPL(CompInner)
54AST_IMPL(Assign)
55AST_IMPL(update_op)
56AST_IMPL(Update)
57AST_IMPL(BinaryOperator)
58AST_IMPL(Assignable)
59AST_IMPL(AssignableChain)
60AST_IMPL(exp_op_value)
61AST_IMPL(Exp)
62AST_IMPL(Callable)
63AST_IMPL(ChainValue)
64AST_IMPL(simple_table)
65AST_IMPL(SimpleValue)
66AST_IMPL(Value)
67AST_IMPL(LuaStringOpen);
68AST_IMPL(LuaStringContent);
69AST_IMPL(LuaStringClose);
70AST_IMPL(LuaString)
71AST_IMPL(SingleString)
72AST_IMPL(double_string_inner)
73AST_IMPL(double_string_content)
74AST_IMPL(DoubleString)
75AST_IMPL(String)
76AST_IMPL(Parens)
77AST_IMPL(DotChainItem)
78AST_IMPL(ColonChainItem)
79AST_IMPL(default_value)
80AST_IMPL(Slice)
81AST_IMPL(Invoke)
82AST_IMPL(TableLit)
83AST_IMPL(TableBlock)
84AST_IMPL(class_member_list)
85AST_IMPL(ClassBlock)
86AST_IMPL(ClassDecl)
87AST_IMPL(export_values)
88AST_IMPL(export_op)
89AST_IMPL(Export)
90AST_IMPL(variable_pair)
91AST_IMPL(normal_pair)
92AST_IMPL(FnArgDef)
93AST_IMPL(FnArgDefList)
94AST_IMPL(outer_var_shadow)
95AST_IMPL(FnArgsDef)
96AST_IMPL(fn_arrow)
97AST_IMPL(FunLit)
98AST_IMPL(NameOrDestructure)
99AST_IMPL(AssignableNameList)
100AST_IMPL(InvokeArgs)
101AST_IMPL(const_value)
102AST_IMPL(unary_exp)
103AST_IMPL(ExpListAssign)
104AST_IMPL(if_else_line)
105AST_IMPL(unless_line)
106AST_IMPL(statement_appendix)
107AST_IMPL(BreakLoop)
108AST_IMPL(Statement)
109AST_IMPL(Body)
110AST_IMPL(Block)
111AST_IMPL(File)
112
113} // namespace MoonP