This commit is contained in:
Valk Richard Li
2019-10-11 22:26:40 +08:00
committed by GitHub
parent a5acf83ae2
commit 6bb206d37d
2 changed files with 49 additions and 20 deletions
+18
View File
@@ -121,6 +121,24 @@ class abstract_syntax_tree
statement_list.push_back(statement_head);
return;
}
// for return expr
void set_node_to_ret(abstract_syntax_tree child)
{
ast_node_type=__return;
children.push_back(child);
return;
}
// for loop
void set_node_to_loop()
{
ast_node_type=__loop;
return;
}
void set_node_to_continue_break(const int type)
{
ast_node_type=type;
return;
}
// for sub-tree node operator
void set_two_operator(const int operator_type,abstract_syntax_tree f_child,abstract_syntax_tree s_child)
{