10ANN
static StmtList *
cpy_stmt_list(MemPool p,
const StmtList *src);
64 TagList *a = new_taglist(p, src->len);
65 for(uint32_t i = 0; i < src->len; i++) {
66 const Tag tag = taglist_at(src, i);
67 taglist_set(a, i, tag);
73 SpecializedList *tgt = new_specializedlist(p, src->len);
74 for(uint32_t i = 0; i < src->len; i++) {
75 const Specialized _src = specializedlist_at(src, i);
92 TmplArgList *a = new_tmplarglist(p, src->len);
93 for(uint32_t i = 0; i < src->len; i++) {
94 const TmplArg _src = tmplarglist_at(src, i);
95 TmplArg *_tgt = tmplarglist_ptr_at(a, i);
107 ArgList *arg = new_arglist(p, src->len);
108 for(m_uint i = 0; i < src->len; i++) {
109 const Arg _src = arglist_at(src, i);
110 Arg *_arg = arglist_ptr_at(arg, i);
196ANN
static CaptureList *
cpy_captures(MemPool p,
const CaptureList *src) {
197 CaptureList *a = new_capturelist(p, src->len);
198 for(uint32_t i = 0; i < src->len; i++) {
200 const Capture capture = capturelist_at(src, i);
201 capturelist_set(a, i, capture);
226 Exp* a = mp_calloc2(p,
sizeof(
Exp));
336 const m_uint sz = src->len;
337 StmtList *a = new_stmtlist(p, sz);
338 for(m_uint i = 0; i < sz; i++) {
339 Stmt* a_stmt = stmtlist_ptr_at(a, i);
340 Stmt src_stmt = stmtlist_at(src, i);
347 HandlerList *tgt = new_handlerlist(p, src->len);
348 for(m_uint i = 0; i < src->len; i++) {
349 const Handler src_handler = handlerlist_at(src, i);
350 Handler *tgt_handler = handlerlist_ptr_at(tgt, i);
352 tgt_handler->
tag = src_handler.
tag;
369ANN
static EnumValueList *
cpy_enum_list(MemPool p,
const EnumValueList *src) {
370 EnumValueList *tgt = new_enumvaluelist(p, src->len);
371 memcpy(tgt->ptr, src->ptr, src->len *
sizeof(
EnumValue));
416 VariableList *a = new_variablelist(p, src->len);
417 for(uint32_t i = 0; i < src->len; i++) {
418 const Variable _src = variablelist_at(src, i);
419 Variable *_tgt = variablelist_ptr_at(a, i);
435 Stmt* a = mp_calloc2(p,
sizeof(
Stmt));
441 Stmt* a = mp_calloc2(p,
sizeof(
Stmt));
442 memcpy(a, src,
sizeof(
Stmt));
461 UsingStmtList *tgt = new_usingstmtlist(p, src->len);
462 for(uint32_t i = 0; i < src->len; i++) {
463 const UsingStmt src_item = usingstmtlist_at(src, i);
464 Stmt_Using tgt_item = usingstmtlist_ptr_at(tgt, i);
465 tgt_item->
tag = src_item.
tag;
548 const m_uint sz = src->len;
549 StmtList *a = new_stmtlist(p, sz);
550 for(m_uint i = 0; i < sz; i++) {
551 Stmt* astmt = stmtlist_ptr_at(a, i);
552 const Stmt sstmt = stmtlist_at(src, i);
632 Ast a = new_sectionlist(p, src->len);
633 for(m_uint i = 0; i < src->len; i++) {
634 Section * asec = sectionlist_ptr_at(a, i);
635 const Section ssec = sectionlist_at(src, i);
ANN Exp * cpy_exp(MemPool p, const Exp *src)
static ANN Trait_Def cpy_trait_def(MemPool p, const Trait_Def src)
static ANN void cpy_stmt_code(MemPool p, Stmt_Code a, const struct Stmt_Code_ *src)
static ANN void cpy_stmt_pp(MemPool p NUSED, Stmt_PP a, const struct Stmt_PP_ *src)
static ANN void cpy_stmt_match(MemPool p, Stmt_Match a, const struct Match *src)
static ANN void cpy_exp_slice(MemPool p, Exp_Slice *a, const Exp_Slice *src)
ANN TmplArgList * cpy_tmplarg_list(MemPool p, const TmplArgList *src)
ANN Union_Def cpy_union_def(MemPool p, const Union_Def src)
ANN Func_Base * cpy_func_base(MemPool p, const Func_Base *src)
ANN Array_Sub cpy_array_sub(MemPool p, const Array_Sub src)
ANN Type_Decl * cpy_type_decl(MemPool p, const Type_Decl *src)
static ANN void cpy_exp_if(MemPool p, Exp_If *a, const Exp_If *src)
static ANN void cpy_exp_call(MemPool p, Exp_Call *a, const Exp_Call *src)
static ANN CaptureList * cpy_captures(MemPool p, const CaptureList *src)
static ANN void cpy_stmt_if(MemPool p, Stmt_If a, const struct Stmt_If_ *src)
static ANN void cpy_stmt_using(MemPool p, Stmt_Using a, const struct Stmt_Using_ *src)
static ANN UsingStmtList * cpy_import_list(MemPool p, const UsingStmtList *src)
static ANN StmtList * cpy_stmt_cases(MemPool p, const StmtList *src)
ANN Tmpl * cpy_tmpl(MemPool p, const Tmpl *src)
static ANN void cpy_exp_dot(MemPool p, Exp_Dot *a, const Exp_Dot *src)
static ANN void cpy_var_decl(MemPool p NUSED, Var_Decl *a, const Var_Decl *src)
static ANN void cpy_stmt_spread(MemPool p, Spread_Def a, const struct Spread_Def_ *src)
ANN Ast cpy_ast(MemPool p, Ast src)
static ANN void cpy_stmt_exp(MemPool p, const Stmt_Exp a, const struct Stmt_Exp_ *src)
static ANN void cpy_exp_unary(MemPool p, Exp_Unary *a, const Exp_Unary *src)
static ANN void cpy_prim(MemPool p, Exp_Primary *a, const Exp_Primary *src)
static ANN void cpy_stmt_loop(MemPool p, Stmt_Loop a, const struct Stmt_Loop_ *src)
ANN Extend_Def cpy_extend_def(MemPool p, const Extend_Def src)
ANN Fptr_Def cpy_fptr_def(MemPool p, const Fptr_Def src)
static ANN void cpy_variable(MemPool p, Variable *a, const Variable *src)
static ANN void cpy_stmt_try(MemPool p, Stmt_Try a, const struct Stmt_Try_ *src)
static ANN Enum_Def cpy_enum_def(MemPool p, const Enum_Def src)
static ANN void cpy_exp_lambda(MemPool p, Exp_Lambda *a, const Exp_Lambda *src)
static ANN HandlerList * cpy_handler_list(MemPool p, const HandlerList *src)
ANN ArgList * cpy_arg_list(MemPool p, const ArgList *src)
ANN SpecializedList * cpy_specialized_list(MemPool p, const SpecializedList *src)
static ANN void cpy_stmt2(MemPool p, Stmt *a, const Stmt *src)
static ANN void cpy_type_def2(MemPool p, Type_Def a, const Type_Def src)
ANN Stmt * cpy_stmt3(MemPool p, const Stmt *src)
static ANN void cpy_stmt_import(MemPool p, Stmt_Import a, const struct Stmt_Import_ *src)
static ANN void cpy_exp_binary(MemPool p, Exp_Binary *a, const Exp_Binary *src)
ANN VariableList * cpy_variable_list(MemPool p, const VariableList *src)
static ANN void cpy_exp_decl(MemPool p, Exp_Decl *a, const Exp_Decl *src)
static ANN void cpy_stmt_case(MemPool p, const Stmt_Match a, const struct Match *src)
static ANN void cpy_section(MemPool p, Section *const a, const Section *src)
ANN void cpy_tmplarg(MemPool p, const TmplArg *src, TmplArg *tgt)
ANN TagList * cpy_taglist(MemPool p, const TagList *src)
static ANN void cpy_stmt_for(MemPool p, Stmt_For a, const struct Stmt_For_ *src)
ANN Range * cpy_range(MemPool p, const Range *src)
ANN Stmt * cpy_stmt(MemPool p, const Stmt *src)
static ANN void cpy_exp_postfix(MemPool p, Exp_Postfix *a, const Exp_Postfix *src)
static ANN Type_Def cpy_type_def(MemPool p, const Type_Def src)
static ANN void cpy_exp_cast(MemPool p, Exp_Cast *a, const Exp_Cast *src)
static ANN EnumValueList * cpy_enum_list(MemPool p, const EnumValueList *src)
static ANN StmtList * cpy_stmt_list(MemPool p, const StmtList *src)
static ANN void cpy_stmt_each(MemPool p, Stmt_Each a, const struct Stmt_Each_ *src)
static ANN Prim_Def cpy_prim_def(MemPool p, const Prim_Def src)
static ANN void cpy_exp_array(MemPool p, Exp_Array *a, const Exp_Array *src)
static ANN void cpy_stmt_flow(MemPool p, Stmt_Flow a, const struct Stmt_Flow_ *src)
ANN Func_Def cpy_func_def(MemPool p, const Func_Def src)
static ANN void cpy_stmt_defer(MemPool p, Stmt_Defer a, const struct Stmt_Defer_ *src)
ANN Class_Def cpy_class_def(MemPool p, const Class_Def src)
include this file to use gwion-ast library
union Exp_Primary::prim_data d
enum unary_type unary_type
union Func_Def_::func_def_data d
Exp * end
end of range expression
Exp * start
start of range expression
ae_section_t section_type
union Section_::section_data d
struct StmtList * stmt_list
UsingStmtList * selection
struct Stmt_Loop_ stmt_loop
struct Spread_Def_ stmt_spread
struct Stmt_Defer_ stmt_defer
struct Stmt_Import_ stmt_import
struct Stmt_Try_ stmt_try
struct Stmt_Each_ stmt_each
struct Stmt_Code_ stmt_code
struct Stmt_Using_ stmt_using
struct Stmt_For_ stmt_for
struct Stmt_Flow_ stmt_flow
struct Stmt_Exp_ stmt_exp