// ---------------------------------------------------------------- mlr_dsl_ast_node_t* mlr_dsl_ast_node_alloc_unary(char* text, int type, mlr_dsl_ast_node_t* pa) { mlr_dsl_ast_node_t* pnode = mlr_dsl_ast_node_alloc(text, type); pnode->pchildren = sllv_alloc(); sllv_add(pnode->pchildren, pa); return pnode; }
// ---------------------------------------------------------------- mlr_dsl_ast_node_t* mlr_dsl_ast_node_alloc_ternary(char* text, int type, mlr_dsl_ast_node_t* pa, mlr_dsl_ast_node_t* pb, mlr_dsl_ast_node_t* pc) { mlr_dsl_ast_node_t* pnode = mlr_dsl_ast_node_alloc(text, type); pnode->pchildren = sllv_alloc(); sllv_append(pnode->pchildren, pa); sllv_append(pnode->pchildren, pb); sllv_append(pnode->pchildren, pc); return pnode; }
// ---------------------------------------------------------------- mlr_dsl_ast_node_t* mlr_dsl_ast_node_alloc_zary(char* text, int type) { mlr_dsl_ast_node_t* pnode = mlr_dsl_ast_node_alloc(text, type); pnode->pchildren = sllv_alloc(); return pnode; }
// ---------------------------------------------------------------- // xxx rename to ..._terminal to make it clear that children aren't copied. mlr_dsl_ast_node_t* mlr_dsl_ast_node_copy(mlr_dsl_ast_node_t* pother) { mlr_dsl_ast_node_t* pnode = mlr_dsl_ast_node_alloc(pother->text, pother->type); return pnode; }