diff options
Diffstat (limited to '')
| -rw-r--r-- | src/MoonP/moon_ast.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/MoonP/moon_ast.h b/src/MoonP/moon_ast.h index e2f54de..6b738d4 100644 --- a/src/MoonP/moon_ast.h +++ b/src/MoonP/moon_ast.h | |||
| @@ -223,19 +223,20 @@ AST_END(Return) | |||
| 223 | 223 | ||
| 224 | class existential_op_t; | 224 | class existential_op_t; |
| 225 | class Assign_t; | 225 | class Assign_t; |
| 226 | class Body_t; | 226 | class Block_t; |
| 227 | class Statement_t; | ||
| 227 | 228 | ||
| 228 | AST_NODE(With) | 229 | AST_NODE(With) |
| 229 | ast_ptr<false, existential_op_t> eop; | 230 | ast_ptr<false, existential_op_t> eop; |
| 230 | ast_ptr<true, ExpList_t> valueList; | 231 | ast_ptr<true, ExpList_t> valueList; |
| 231 | ast_ptr<false, Assign_t> assigns; | 232 | ast_ptr<false, Assign_t> assigns; |
| 232 | ast_ptr<true, Body_t> body; | 233 | ast_sel<true, Block_t, Statement_t> body; |
| 233 | AST_MEMBER(With, &eop, &valueList, &assigns, &body) | 234 | AST_MEMBER(With, &eop, &valueList, &assigns, &body) |
| 234 | AST_END(With) | 235 | AST_END(With) |
| 235 | 236 | ||
| 236 | AST_NODE(SwitchCase) | 237 | AST_NODE(SwitchCase) |
| 237 | ast_ptr<true, ExpList_t> valueList; | 238 | ast_ptr<true, ExpList_t> valueList; |
| 238 | ast_ptr<true, Body_t> body; | 239 | ast_sel<true, Block_t, Statement_t> body; |
| 239 | AST_MEMBER(SwitchCase, &valueList, &body) | 240 | AST_MEMBER(SwitchCase, &valueList, &body) |
| 240 | AST_END(SwitchCase) | 241 | AST_END(SwitchCase) |
| 241 | 242 | ||
| @@ -243,7 +244,7 @@ AST_NODE(Switch) | |||
| 243 | ast_ptr<true, Exp_t> target; | 244 | ast_ptr<true, Exp_t> target; |
| 244 | ast_ptr<true, Seperator_t> sep; | 245 | ast_ptr<true, Seperator_t> sep; |
| 245 | ast_list<true, SwitchCase_t> branches; | 246 | ast_list<true, SwitchCase_t> branches; |
| 246 | ast_ptr<false, Body_t> lastBranch; | 247 | ast_sel<false, Block_t, Statement_t> lastBranch; |
| 247 | AST_MEMBER(Switch, &target, &sep, &branches, &lastBranch) | 248 | AST_MEMBER(Switch, &target, &sep, &branches, &lastBranch) |
| 248 | AST_END(Switch) | 249 | AST_END(Switch) |
| 249 | 250 | ||
| @@ -255,22 +256,24 @@ AST_END(IfCond) | |||
| 255 | 256 | ||
| 256 | AST_NODE(If) | 257 | AST_NODE(If) |
| 257 | ast_ptr<true, Seperator_t> sep; | 258 | ast_ptr<true, Seperator_t> sep; |
| 258 | ast_sel_list<true, IfCond_t, Body_t> nodes; | 259 | ast_sel_list<true, IfCond_t, Block_t, Statement_t> nodes; |
| 259 | AST_MEMBER(If, &sep, &nodes) | 260 | AST_MEMBER(If, &sep, &nodes) |
| 260 | AST_END(If) | 261 | AST_END(If) |
| 261 | 262 | ||
| 262 | AST_NODE(Unless) | 263 | AST_NODE(Unless) |
| 263 | ast_ptr<true, Seperator_t> sep; | 264 | ast_ptr<true, Seperator_t> sep; |
| 264 | ast_sel_list<true, IfCond_t, Body_t> nodes; | 265 | ast_sel_list<true, IfCond_t, Block_t, Statement_t> nodes; |
| 265 | AST_MEMBER(Unless, &sep, &nodes) | 266 | AST_MEMBER(Unless, &sep, &nodes) |
| 266 | AST_END(Unless) | 267 | AST_END(Unless) |
| 267 | 268 | ||
| 268 | AST_NODE(While) | 269 | AST_NODE(While) |
| 269 | ast_ptr<true, Exp_t> condition; | 270 | ast_ptr<true, Exp_t> condition; |
| 270 | ast_ptr<true, Body_t> body; | 271 | ast_sel<true, Block_t, Statement_t> body; |
| 271 | AST_MEMBER(While, &condition, &body) | 272 | AST_MEMBER(While, &condition, &body) |
| 272 | AST_END(While) | 273 | AST_END(While) |
| 273 | 274 | ||
| 275 | class Body_t; | ||
| 276 | |||
| 274 | AST_NODE(Repeat) | 277 | AST_NODE(Repeat) |
| 275 | ast_ptr<true, Body_t> body; | 278 | ast_ptr<true, Body_t> body; |
| 276 | ast_ptr<true, Exp_t> condition; | 279 | ast_ptr<true, Exp_t> condition; |
| @@ -287,7 +290,7 @@ AST_NODE(For) | |||
| 287 | ast_ptr<true, Exp_t> startValue; | 290 | ast_ptr<true, Exp_t> startValue; |
| 288 | ast_ptr<true, Exp_t> stopValue; | 291 | ast_ptr<true, Exp_t> stopValue; |
| 289 | ast_ptr<false, for_step_value_t> stepValue; | 292 | ast_ptr<false, for_step_value_t> stepValue; |
| 290 | ast_ptr<true, Body_t> body; | 293 | ast_sel<true, Block_t, Statement_t> body; |
| 291 | AST_MEMBER(For, &varName, &startValue, &stopValue, &stepValue, &body) | 294 | AST_MEMBER(For, &varName, &startValue, &stopValue, &stepValue, &body) |
| 292 | AST_END(For) | 295 | AST_END(For) |
| 293 | 296 | ||
| @@ -297,7 +300,7 @@ class star_exp_t; | |||
| 297 | AST_NODE(ForEach) | 300 | AST_NODE(ForEach) |
| 298 | ast_ptr<true, AssignableNameList_t> nameList; | 301 | ast_ptr<true, AssignableNameList_t> nameList; |
| 299 | ast_sel<true, star_exp_t, ExpList_t> loopValue; | 302 | ast_sel<true, star_exp_t, ExpList_t> loopValue; |
| 300 | ast_ptr<true, Body_t> body; | 303 | ast_sel<true, Block_t, Statement_t> body; |
| 301 | AST_MEMBER(ForEach, &nameList, &loopValue, &body) | 304 | AST_MEMBER(ForEach, &nameList, &loopValue, &body) |
| 302 | AST_END(ForEach) | 305 | AST_END(ForEach) |
| 303 | 306 | ||
