aboutsummaryrefslogtreecommitdiff
path: root/src/MoonP/moon_ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/MoonP/moon_ast.h')
-rw-r--r--src/MoonP/moon_ast.h587
1 files changed, 587 insertions, 0 deletions
diff --git a/src/MoonP/moon_ast.h b/src/MoonP/moon_ast.h
new file mode 100644
index 0000000..a614465
--- /dev/null
+++ b/src/MoonP/moon_ast.h
@@ -0,0 +1,587 @@
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#pragma once
10
11#include "MoonP/moon_parser.h"
12
13namespace MoonP {
14
15#define AST_LEAF(type, id) \
16extern rule type; \
17class type##_t : public ast_node \
18{ \
19public: \
20 virtual int get_type() override { return ast_type<type##_t>(); } \
21 virtual size_t getId() const override { return id; } \
22
23#define AST_NODE(type, id) \
24extern rule type; \
25class type##_t : public ast_container \
26{ \
27public: \
28 virtual int get_type() override { return ast_type<type##_t>(); } \
29 virtual size_t getId() const override { return id; } \
30
31#define AST_MEMBER(type, ...) \
32 type##_t() { \
33 add_members({__VA_ARGS__}); \
34 }
35
36#define AST_END(type) \
37};
38
39AST_LEAF(Num, "Num"_id)
40AST_END(Num)
41
42AST_LEAF(Name, "Name"_id)
43AST_END(Name)
44
45AST_NODE(Variable, "Variable"_id)
46 ast_ptr<true, Name_t> name;
47 AST_MEMBER(Variable, &name)
48AST_END(Variable)
49
50AST_NODE(LuaKeyword, "LuaKeyword"_id)
51 ast_ptr<true, Name_t> name;
52 AST_MEMBER(LuaKeyword, &name)
53AST_END(LuaKeyword)
54
55AST_LEAF(self, "self"_id)
56AST_END(self)
57
58AST_NODE(self_name, "self_name"_id)
59 ast_ptr<true, Name_t> name;
60 AST_MEMBER(self_name, &name)
61AST_END(self_name)
62
63AST_LEAF(self_class, "self_class"_id)
64AST_END(self_class)
65
66AST_NODE(self_class_name, "self_class_name"_id)
67 ast_ptr<true, Name_t> name;
68 AST_MEMBER(self_class_name, &name)
69AST_END(self_class_name)
70
71AST_NODE(SelfName, "SelfName"_id)
72 ast_sel<true, self_class_name_t, self_class_t, self_name_t, self_t> name;
73 AST_MEMBER(SelfName, &name)
74AST_END(SelfName)
75
76AST_NODE(KeyName, "KeyName"_id)
77 ast_sel<true, SelfName_t, Name_t> name;
78 AST_MEMBER(KeyName, &name)
79AST_END(KeyName)
80
81AST_LEAF(VarArg, "VarArg"_id)
82AST_END(VarArg)
83
84AST_LEAF(local_flag, "local_flag"_id)
85AST_END(local_flag)
86
87AST_LEAF(Seperator, "Seperator"_id)
88AST_END(Seperator)
89
90AST_NODE(NameList, "NameList"_id)
91 ast_ptr<true, Seperator_t> sep;
92 ast_list<true, Variable_t> names;
93 AST_MEMBER(NameList, &sep, &names)
94AST_END(NameList)
95
96AST_NODE(Local, "Local"_id)
97 ast_sel<true, local_flag_t, NameList_t> name;
98 std::list<std::string> forceDecls;
99 std::list<std::string> decls;
100 AST_MEMBER(Local, &name)
101AST_END(Local)
102
103AST_NODE(colon_import_name, "colon_import_name"_id)
104 ast_ptr<true, Variable_t> name;
105 AST_MEMBER(colon_import_name, &name)
106AST_END(colon_import_name)
107
108class Exp_t;
109
110AST_NODE(Import, "Import"_id)
111 ast_ptr<true, Seperator_t> sep;
112 ast_sel_list<true, colon_import_name_t, Variable_t> names;
113 ast_ptr<true, Exp_t> exp;
114 AST_MEMBER(Import, &sep, &names, &exp)
115AST_END(Import)
116
117AST_NODE(ExpListLow, "ExpListLow"_id)
118 ast_ptr<true, Seperator_t> sep;
119 ast_list<true, Exp_t> exprs;
120 AST_MEMBER(ExpListLow, &sep, &exprs)
121AST_END(ExpListLow)
122
123AST_NODE(ExpList, "ExpList"_id)
124 ast_ptr<true, Seperator_t> sep;
125 ast_list<true, Exp_t> exprs;
126 AST_MEMBER(ExpList, &sep, &exprs)
127AST_END(ExpList)
128
129AST_NODE(Return, "Return"_id)
130 ast_ptr<false, ExpListLow_t> valueList;
131 AST_MEMBER(Return, &valueList)
132AST_END(Return)
133
134class Assign_t;
135class Body_t;
136
137AST_NODE(With, "With"_id)
138 ast_ptr<true, ExpList_t> valueList;
139 ast_ptr<false, Assign_t> assigns;
140 ast_ptr<true, Body_t> body;
141 AST_MEMBER(With, &valueList, &assigns, &body)
142AST_END(With)
143
144AST_NODE(SwitchCase, "SwitchCase"_id)
145 ast_ptr<true, ExpList_t> valueList;
146 ast_ptr<true, Body_t> body;
147 AST_MEMBER(SwitchCase, &valueList, &body)
148AST_END(SwitchCase)
149
150AST_NODE(Switch, "Switch"_id)
151 ast_ptr<true, Exp_t> target;
152 ast_ptr<true, Seperator_t> sep;
153 ast_list<true, SwitchCase_t> branches;
154 ast_ptr<false, Body_t> lastBranch;
155 AST_MEMBER(Switch, &target, &sep, &branches, &lastBranch)
156AST_END(Switch)
157
158AST_NODE(IfCond, "IfCond"_id)
159 ast_ptr<true, Exp_t> condition;
160 ast_ptr<false, Assign_t> assign;
161 AST_MEMBER(IfCond, &condition, &assign)
162AST_END(IfCond)
163
164AST_NODE(If, "If"_id)
165 ast_ptr<true, Seperator_t> sep;
166 ast_sel_list<true, IfCond_t, Body_t> nodes;
167 AST_MEMBER(If, &sep, &nodes)
168AST_END(If)
169
170AST_NODE(Unless, "Unless"_id)
171 ast_ptr<true, Seperator_t> sep;
172 ast_sel_list<true, IfCond_t, Body_t> nodes;
173 AST_MEMBER(Unless, &sep, &nodes)
174AST_END(Unless)
175
176AST_NODE(While, "While"_id)
177 ast_ptr<true, Exp_t> condition;
178 ast_ptr<true, Body_t> body;
179 AST_MEMBER(While, &condition, &body)
180AST_END(While)
181
182AST_NODE(for_step_value, "for_step_value"_id)
183 ast_ptr<true, Exp_t> value;
184 AST_MEMBER(for_step_value, &value)
185AST_END(for_step_value)
186
187AST_NODE(For, "For"_id)
188 ast_ptr<true, Variable_t> varName;
189 ast_ptr<true, Exp_t> startValue;
190 ast_ptr<true, Exp_t> stopValue;
191 ast_ptr<false, for_step_value_t> stepValue;
192 ast_ptr<true, Body_t> body;
193 AST_MEMBER(For, &varName, &startValue, &stopValue, &stepValue, &body)
194AST_END(For)
195
196class AssignableNameList_t;
197class star_exp_t;
198
199AST_NODE(ForEach, "ForEach"_id)
200 ast_ptr<true, AssignableNameList_t> nameList;
201 ast_sel<true, star_exp_t, ExpList_t> loopValue;
202 ast_ptr<true, Body_t> body;
203 AST_MEMBER(ForEach, &nameList, &loopValue, &body)
204AST_END(ForEach)
205
206AST_NODE(Do, "Do"_id)
207 ast_ptr<true, Body_t> body;
208 AST_MEMBER(Do, &body)
209AST_END(Do)
210
211class CompInner_t;
212class Statement_t;
213
214AST_NODE(Comprehension, "Comprehension"_id)
215 ast_sel<true, Exp_t, Statement_t> value;
216 ast_ptr<true, CompInner_t> forLoop;
217 AST_MEMBER(Comprehension, &value, &forLoop)
218AST_END(Comprehension)
219
220AST_NODE(comp_value, "comp_value"_id)
221 ast_ptr<true, Exp_t> value;
222 AST_MEMBER(comp_value, &value)
223AST_END(comp_value)
224
225AST_NODE(TblComprehension, "TblComprehension"_id)
226 ast_ptr<true, Exp_t> key;
227 ast_ptr<false, comp_value_t> value;
228 ast_ptr<true, CompInner_t> forLoop;
229 AST_MEMBER(TblComprehension, &key, &value, &forLoop)
230AST_END(TblComprehension)
231
232AST_NODE(star_exp, "star_exp"_id)
233 ast_ptr<true, Exp_t> value;
234 AST_MEMBER(star_exp, &value)
235AST_END(star_exp)
236
237AST_NODE(CompForEach, "CompForEach"_id)
238 ast_ptr<true, AssignableNameList_t> nameList;
239 ast_sel<true, star_exp_t, Exp_t> loopValue;
240 AST_MEMBER(CompForEach, &nameList, &loopValue)
241AST_END(CompForEach)
242
243AST_NODE(CompFor, "CompFor"_id)
244 ast_ptr<true, Variable_t> varName;
245 ast_ptr<true, Exp_t> startValue;
246 ast_ptr<true, Exp_t> stopValue;
247 ast_ptr<false, for_step_value_t> stepValue;
248 AST_MEMBER(CompFor, &varName, &startValue, &stopValue, &stepValue)
249AST_END(CompFor)
250
251AST_NODE(CompInner, "CompInner"_id)
252 ast_ptr<true, Seperator_t> sep;
253 ast_sel_list<true, CompFor_t, CompForEach_t, Exp_t> items;
254 AST_MEMBER(CompInner, &sep, &items)
255AST_END(CompInner)
256
257class TableBlock_t;
258
259AST_NODE(Assign, "Assign"_id)
260 ast_ptr<true, Seperator_t> sep;
261 ast_sel_list<true, With_t, If_t, Switch_t, TableBlock_t, Exp_t> values;
262 AST_MEMBER(Assign, &sep, &values)
263AST_END(Assign)
264
265AST_LEAF(update_op, "update_op"_id)
266AST_END(update_op)
267
268AST_NODE(Update, "Update"_id)
269 ast_ptr<true, update_op_t> op;
270 ast_ptr<true, Exp_t> value;
271 AST_MEMBER(Update, &op, &value)
272AST_END(Update)
273
274AST_LEAF(BinaryOperator, "BinaryOperator"_id)
275AST_END(BinaryOperator)
276
277class AssignableChain_t;
278
279AST_NODE(Assignable, "Assignable"_id)
280 ast_sel<true, AssignableChain_t, Variable_t, SelfName_t> item;
281 AST_MEMBER(Assignable, &item)
282AST_END(Assignable)
283
284class Value_t;
285
286AST_NODE(exp_op_value, "exp_op_value"_id)
287 ast_ptr<true, BinaryOperator_t> op;
288 ast_ptr<true, Value_t> value;
289 AST_MEMBER(exp_op_value, &op, &value)
290AST_END(exp_op_value)
291
292AST_NODE(Exp, "Exp"_id)
293 ast_ptr<true, Value_t> value;
294 ast_list<false, exp_op_value_t> opValues;
295 AST_MEMBER(Exp, &value, &opValues)
296AST_END(Exp)
297
298class Parens_t;
299
300AST_NODE(Callable, "Callable"_id)
301 ast_sel<true, Variable_t, SelfName_t, VarArg_t, Parens_t> item;
302 AST_MEMBER(Callable, &item)
303AST_END(Callable)
304
305AST_NODE(variable_pair, "variable_pair"_id)
306 ast_ptr<true, Variable_t> name;
307 AST_MEMBER(variable_pair, &name)
308AST_END(variable_pair)
309
310class DoubleString_t;
311class SingleString_t;
312
313AST_NODE(normal_pair, "normal_pair"_id)
314 ast_sel<true, KeyName_t, Exp_t, DoubleString_t, SingleString_t> key;
315 ast_sel<true, Exp_t, TableBlock_t> value;
316 AST_MEMBER(normal_pair, &key, &value)
317AST_END(normal_pair)
318
319AST_NODE(simple_table, "simple_table"_id)
320 ast_ptr<true, Seperator_t> sep;
321 ast_sel_list<true, variable_pair_t, normal_pair_t> pairs;
322 AST_MEMBER(simple_table, &sep, &pairs)
323AST_END(simple_table)
324
325class String_t;
326class const_value_t;
327class ClassDecl_t;
328class unary_exp_t;
329class TableLit_t;
330class FunLit_t;
331
332AST_NODE(SimpleValue, "SimpleValue"_id)
333 ast_sel<true, const_value_t,
334 If_t, Unless_t, Switch_t, With_t, ClassDecl_t,
335 ForEach_t, For_t, While_t, Do_t, unary_exp_t,
336 TblComprehension_t, TableLit_t, Comprehension_t,
337 FunLit_t, Num_t> value;
338 AST_MEMBER(SimpleValue, &value)
339AST_END(SimpleValue)
340
341AST_LEAF(LuaStringOpen, "LuaStringOpen"_id)
342AST_END(LuaStringOpen)
343
344AST_LEAF(LuaStringContent, "LuaStringContent"_id)
345AST_END(LuaStringContent)
346
347AST_LEAF(LuaStringClose, "LuaStringClose"_id)
348AST_END(LuaStringClose)
349
350AST_NODE(LuaString, "LuaString"_id)
351 ast_ptr<true, LuaStringOpen_t> open;
352 ast_ptr<true, LuaStringContent_t> content;
353 ast_ptr<true, LuaStringClose_t> close;
354 AST_MEMBER(LuaString, &open, &content, &close)
355AST_END(LuaString)
356
357AST_LEAF(SingleString, "SingleString"_id)
358AST_END(SingleString)
359
360AST_LEAF(double_string_inner, "double_string_inner"_id)
361AST_END(double_string_inner)
362
363AST_NODE(double_string_content, "double_string_content"_id)
364 ast_sel<true, double_string_inner_t, Exp_t> content;
365 AST_MEMBER(double_string_content, &content)
366AST_END(double_string_content)
367
368AST_NODE(DoubleString, "DoubleString"_id)
369 ast_ptr<true, Seperator_t> sep;
370 ast_list<false, double_string_content_t> segments;
371 AST_MEMBER(DoubleString, &sep, &segments)
372AST_END(DoubleString)
373
374AST_NODE(String, "String"_id)
375 ast_sel<true, DoubleString_t, SingleString_t, LuaString_t> str;
376 AST_MEMBER(String, &str)
377AST_END(String)
378
379AST_NODE(DotChainItem, "DotChainItem"_id)
380 ast_ptr<true, Name_t> name;
381 AST_MEMBER(DotChainItem, &name)
382AST_END(DotChainItem)
383
384AST_NODE(ColonChainItem, "ColonChainItem"_id)
385 ast_sel<true, LuaKeyword_t, Name_t> name;
386 bool switchToDot = false;
387 AST_MEMBER(ColonChainItem, &name)
388AST_END(ColonChainItem)
389
390class default_value_t;
391
392AST_NODE(Slice, "Slice"_id)
393 ast_sel<true, Exp_t, default_value_t> startValue;
394 ast_sel<true, Exp_t, default_value_t> stopValue;
395 ast_sel<true, Exp_t, default_value_t> stepValue;
396 AST_MEMBER(Slice, &startValue, &stopValue, &stepValue)
397AST_END(Slice)
398
399AST_NODE(Parens, "Parens"_id)
400 ast_ptr<true, Exp_t> expr;
401 AST_MEMBER(Parens, &expr)
402AST_END(Parens)
403
404AST_NODE(Invoke, "Invoke"_id)
405 ast_ptr<true, Seperator_t> sep;
406 ast_sel_list<false, Exp_t, SingleString_t, DoubleString_t, LuaString_t> args;
407 AST_MEMBER(Invoke, &sep, &args)
408AST_END(Invoke)
409
410class InvokeArgs_t;
411
412AST_NODE(ChainValue, "ChainValue"_id)
413 ast_ptr<true, Seperator_t> sep;
414 ast_sel_list<true, Callable_t, Invoke_t, DotChainItem_t, ColonChainItem_t, Slice_t, Exp_t, String_t, InvokeArgs_t> items;
415 AST_MEMBER(ChainValue, &sep, &items)
416AST_END(ChainValue)
417
418AST_NODE(AssignableChain, "AssignableChain"_id)
419 ast_ptr<true, Seperator_t> sep;
420 ast_sel_list<true, Callable_t, Invoke_t, DotChainItem_t, ColonChainItem_t, Exp_t, String_t> items;
421 AST_MEMBER(AssignableChain, &sep, &items)
422AST_END(AssignableChain)
423
424AST_NODE(Value, "Value"_id)
425 ast_sel<true, SimpleValue_t, simple_table_t, ChainValue_t, String_t> item;
426 AST_MEMBER(Value, &item)
427AST_END(Value)
428
429AST_LEAF(default_value, "default_value"_id)
430AST_END(default_value)
431
432AST_NODE(TableLit, "TableLit"_id)
433 ast_ptr<true, Seperator_t> sep;
434 ast_sel_list<false, variable_pair_t, normal_pair_t, Exp_t> values;
435 AST_MEMBER(TableLit, &sep, &values)
436AST_END(TableLit)
437
438AST_NODE(TableBlock, "TableBlock"_id)
439 ast_ptr<true, Seperator_t> sep;
440 ast_sel_list<false, variable_pair_t, normal_pair_t> values;
441 AST_MEMBER(TableBlock, &sep, &values)
442AST_END(TableBlock)
443
444AST_NODE(class_member_list, "class_member_list"_id)
445 ast_ptr<true, Seperator_t> sep;
446 ast_sel_list<true, variable_pair_t, normal_pair_t> values;
447 AST_MEMBER(class_member_list, &sep, &values)
448AST_END(class_member_list)
449
450AST_NODE(ClassBlock, "ClassBlock"_id)
451 ast_ptr<true, Seperator_t> sep;
452 ast_sel_list<true, class_member_list_t, Statement_t> contents;
453 AST_MEMBER(ClassBlock, &sep, &contents)
454AST_END(ClassBlock)
455
456AST_NODE(ClassDecl, "ClassDecl"_id)
457 ast_ptr<false, Assignable_t> name;
458 ast_ptr<false, Exp_t> extend;
459 ast_ptr<false, ClassBlock_t> body;
460 AST_MEMBER(ClassDecl, &name, &extend, &body)
461AST_END(ClassDecl)
462
463AST_NODE(export_values, "export_values"_id)
464 ast_ptr<true, NameList_t> nameList;
465 ast_ptr<false, ExpListLow_t> valueList;
466 AST_MEMBER(export_values, &nameList, &valueList)
467AST_END(export_values)
468
469AST_LEAF(export_op, "export_op"_id)
470AST_END(export_op)
471
472AST_NODE(Export, "Export"_id)
473 ast_sel<true, ClassDecl_t, export_op_t, export_values_t> item;
474 AST_MEMBER(Export, &item)
475AST_END(Export)
476
477AST_NODE(FnArgDef, "FnArgDef"_id)
478 ast_sel<true, Variable_t, SelfName_t> name;
479 ast_ptr<false, Exp_t> defaultValue;
480 AST_MEMBER(FnArgDef, &name, &defaultValue)
481AST_END(FnArgDef)
482
483AST_NODE(FnArgDefList, "FnArgDefList"_id)
484 ast_ptr<true, Seperator_t> sep;
485 ast_list<false, FnArgDef_t> definitions;
486 ast_ptr<false, VarArg_t> varArg;
487 AST_MEMBER(FnArgDefList, &sep, &definitions, &varArg)
488AST_END(FnArgDefList)
489
490AST_NODE(outer_var_shadow, "outer_var_shadow"_id)
491 ast_ptr<false, NameList_t> varList;
492 AST_MEMBER(outer_var_shadow, &varList)
493AST_END(outer_var_shadow)
494
495AST_NODE(FnArgsDef, "FnArgsDef"_id)
496 ast_ptr<false, FnArgDefList_t> defList;
497 ast_ptr<false, outer_var_shadow_t> shadowOption;
498 AST_MEMBER(FnArgsDef, &defList, &shadowOption)
499AST_END(FnArgsDef)
500
501AST_LEAF(fn_arrow, "fn_arrow"_id)
502AST_END(fn_arrow)
503
504AST_NODE(FunLit, "FunLit"_id)
505 ast_ptr<false, FnArgsDef_t> argsDef;
506 ast_ptr<true, fn_arrow_t> arrow;
507 ast_ptr<false, Body_t> body;
508 AST_MEMBER(FunLit, &argsDef, &arrow, &body)
509AST_END(FunLit)
510
511AST_NODE(NameOrDestructure, "NameOrDestructure"_id)
512 ast_sel<true, Variable_t, TableLit_t> item;
513 AST_MEMBER(NameOrDestructure, &item)
514AST_END(NameOrDestructure)
515
516AST_NODE(AssignableNameList, "AssignableNameList"_id)
517 ast_ptr<true, Seperator_t> sep;
518 ast_list<true, NameOrDestructure_t> items;
519 AST_MEMBER(AssignableNameList, &sep, &items)
520AST_END(AssignableNameList)
521
522AST_NODE(InvokeArgs, "InvokeArgs"_id)
523 ast_ptr<true, Seperator_t> sep;
524 ast_sel_list<true, Exp_t, TableBlock_t> args;
525 AST_MEMBER(InvokeArgs, &sep, &args)
526AST_END(InvokeArgs)
527
528AST_LEAF(const_value, "const_value"_id)
529AST_END(const_value)
530
531AST_NODE(unary_exp, "unary_exp"_id)
532 ast_ptr<true, Exp_t> item;
533 AST_MEMBER(unary_exp, &item)
534AST_END(unary_exp)
535
536AST_NODE(ExpListAssign, "ExpListAssign"_id)
537 ast_ptr<true, ExpList_t> expList;
538 ast_sel<false, Update_t, Assign_t> action;
539 AST_MEMBER(ExpListAssign, &expList, &action)
540AST_END(ExpListAssign)
541
542AST_NODE(if_else_line, "if_else_line"_id)
543 ast_ptr<true, Exp_t> condition;
544 ast_sel<false, Exp_t, default_value_t> elseExpr;
545 AST_MEMBER(if_else_line, &condition, &elseExpr)
546AST_END(if_else_line)
547
548AST_NODE(unless_line, "unless_line"_id)
549 ast_ptr<true, Exp_t> condition;
550 AST_MEMBER(unless_line, &condition)
551AST_END(unless_line)
552
553AST_NODE(statement_appendix, "statement_appendix"_id)
554 ast_sel<true, if_else_line_t, unless_line_t, CompInner_t> item;
555 AST_MEMBER(statement_appendix, &item)
556AST_END(statement_appendix)
557
558AST_LEAF(BreakLoop, "BreakLoop"_id)
559AST_END(BreakLoop)
560
561AST_NODE(Statement, "Statement"_id)
562 ast_sel<true, Import_t, While_t, For_t, ForEach_t,
563 Return_t, Local_t, Export_t, BreakLoop_t,
564 ExpListAssign_t> content;
565 ast_ptr<false, statement_appendix_t> appendix;
566 AST_MEMBER(Statement, &content, &appendix)
567AST_END(Statement)
568
569class Block_t;
570
571AST_NODE(Body, "Body"_id)
572 ast_sel<true, Block_t, Statement_t> content;
573 AST_MEMBER(Body, &content)
574AST_END(Body)
575
576AST_NODE(Block, "Block"_id)
577 ast_ptr<true, Seperator_t> sep;
578 ast_list<false, Statement_t> statements;
579 AST_MEMBER(Block, &sep, &statements)
580AST_END(Block)
581
582AST_NODE(File, "File"_id)
583 ast_ptr<true, Block_t> block;
584 AST_MEMBER(File, &block)
585AST_END(File)
586
587} // namespace MoonP