From e1ccc6791f9918e7ad4120e93617b9f8c191a0ad Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sun, 11 Feb 2024 19:05:51 +0100 Subject: [PATCH] :fire: remove old useless header --- include/array.h | 2 +- include/constant.h | 5 --- include/emit.h | 22 ++++----- include/env/env.h | 35 ++++++++------- include/env/envset.h | 13 +++--- include/env/func.h | 2 +- include/env/type.h | 2 +- include/import.h | 2 +- include/import/checker.h | 2 +- include/instr.h | 2 +- include/operator.h | 16 +++---- include/parse.h | 84 ++++++++++++++++++++++++----------- include/pass.h | 2 +- include/spread.h | 2 +- include/template.h | 6 +-- include/tmp_resolve.h | 2 +- include/traverse.h | 96 ++++++++++++++++++++-------------------- 17 files changed, 163 insertions(+), 132 deletions(-) delete mode 100644 include/constant.h diff --git a/include/array.h b/include/array.h index 8399785e..ef0cbc7f 100644 --- a/include/array.h +++ b/include/array.h @@ -20,7 +20,7 @@ typedef struct ArrayInfo_ { } ArrayInfo; ANN Type check_array_access(const Env env, const Array_Sub array); -ANN m_bool emit_array_access(const Emitter emit, +ANN bool emit_array_access(const Emitter emit, struct ArrayAccessInfo *const info); ANN2(1,2) m_bool check_array_instance(const Env env, Type_Decl *td, Exp* args); #endif diff --git a/include/constant.h b/include/constant.h deleted file mode 100644 index 26113041..00000000 --- a/include/constant.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __CONSTANT -#define __CONSTANT -ANN m_bool constant_int(Exp* e); -ANN m_bool constant_float(Exp* e); -#endif diff --git a/include/emit.h b/include/emit.h index 030621f4..75a79a48 100644 --- a/include/emit.h +++ b/include/emit.h @@ -64,25 +64,25 @@ struct Emitter_ { ANEW ANN Emitter new_emitter(MemPool); ANN void free_emitter(MemPool, Emitter); -ANN m_bool emit_ast(const Env env, Ast *ast); -ANN m_bool emit_func_def(const Emitter emit, const Func_Def fdef); -ANN m_bool emit_exp_call1(const Emitter, const Func, const m_uint size, const bool is_static); +ANN bool emit_ast(const Env env, Ast *ast); +ANN bool emit_func_def(const Emitter emit, const Func_Def fdef); +ANN bool emit_exp_call1(const Emitter, const Func, const m_uint size, const bool is_static); ANN2(1) Instr emit_add_instr(const Emitter, const f_instr) __attribute__((returns_nonnull)); ANN Code * emit_class_code(const Emitter, const m_str); -ANN m_bool emit_array_extend(const Emitter, const Type, Exp*); +ANN bool emit_array_extend(const Emitter, const Type, Exp*); ANN void emit_class_finish(const Emitter, const Nspc); ANN2(1, 2) -m_bool emit_instantiate_object(const Emitter, const Type, const Array_Sub, - const m_bool); +bool emit_instantiate_object(const Emitter, const Type, const Array_Sub, + const bool); ANN m_uint emit_code_offset(const Emitter emit); ANN m_uint emit_local(const Emitter emit, const Type t); ANN m_uint emit_localn(const Emitter emit, const Type t); ANN void* emit_localx(const Emitter emit, const Type t); ANN m_uint emit_local_exp(const Emitter emit, Exp*); -ANN m_bool emit_exp_spork(const Emitter, const Exp_Unary *); -ANN m_bool emit_exp(const Emitter, Exp*); +ANN bool emit_exp_spork(const Emitter, const Exp_Unary *); +ANN bool emit_exp(const Emitter, Exp*); ANN void emit_object_addref(const Emitter emit, const m_int size, const bool emit_var); @@ -90,7 +90,7 @@ ANN void emit_struct_addref(const Emitter emit, const Type t, const m_int size, const bool emit_var); ANN static inline void emit_compound_addref(const Emitter emit, const Type t, const m_int size, - const m_bool emit_var) { + const bool emit_var) { return !tflag(t, tflag_struct) ? emit_object_addref(emit, size, emit_var) : emit_struct_addref(emit, t, size, emit_var); } @@ -113,8 +113,8 @@ ANN static inline m_uint emit_code_size(const Emitter emit) { ANN void emit_push_scope(const Emitter emit); ANN void emit_pop_scope(const Emitter emit); -ANN m_bool ensure_emit(const Emitter, const Type); -ANN m_bool emit_ensure_func(const Emitter emit, const Func f); +ANN bool ensure_emit(const Emitter, const Type); +ANN bool emit_ensure_func(const Emitter emit, const Func f); ANN m_bool get_emit_var(const Emitter emit, const Type t, bool is_var); ANN static inline void emit_regmove(const Emitter emit, const m_uint i) { diff --git a/include/env/env.h b/include/env/env.h index 59f4e57b..7ac00faf 100644 --- a/include/env/env.h +++ b/include/env/env.h @@ -26,6 +26,7 @@ struct Env_Scope_ { bool in_try; bool in_loop; bool shadowing; + bool poison; }; typedef struct Env_ { @@ -46,23 +47,23 @@ ANN2(1, 3) m_uint env_push(const Env, const Type, const Nspc); ANN static inline m_uint env_push_global(const Env env) { return env_push(env, NULL, env->global_nspc); } -ANN void env_pop(const Env, const m_uint); -ANN Type scan_type(const Env, const Type, Type_Decl *); -ANN Value mk_class(const Env env, const Type base, const loc_t); -ANN m_bool compat_func(const __restrict__ Func_Def, +ANN void env_pop(const Env, const m_uint); +ANN Type scan_type(const Env, const Type, Type_Decl *); +ANN Value mk_class(const Env env, const Type base, const loc_t); +ANN bool compat_func(const __restrict__ Func_Def, const __restrict__ Func_Def); -ANN Type known_type(const Env env, Type_Decl *); -ANN Type prim_ref(const Env env, const Type t, const Type_Decl *td); -ANN m_bool env_access(const Env env, const ae_flag flag, const loc_t); -ANN m_bool env_storage(const Env env, ae_flag flag, const loc_t); -ANN void env_add_type(const Env, const Type, const loc_t); -ANN Type find_type(const Env, Type_Decl *); -ANN m_bool traverse_func_template(const Env, const Func_Def); -ANN void env_err(const Env, const loc_t, const m_str fmt, ...); -ANN void env_warn(const Env, const loc_t, const m_str fmt, ...); -ANN void env_error_footer(const Env env); -ANN Value global_string(const Env env, const m_str str, const loc_t); -ANN void release_ctx(struct Env_Scope_ *a, struct Gwion_ *gwion); +ANN Type known_type(const Env env, Type_Decl *); +ANN Type prim_ref(const Env env, const Type t, const Type_Decl *td); +ANN bool env_access(const Env env, const ae_flag flag, const loc_t); +ANN bool env_storage(const Env env, ae_flag flag, const loc_t); +ANN void env_add_type(const Env, const Type, const loc_t); +ANN Type find_type(const Env, Type_Decl *); +ANN bool traverse_func_template(const Env, const Func_Def); +ANN void env_err(const Env, const loc_t, const m_str fmt, ...); +ANN void env_warn(const Env, const loc_t, const m_str fmt, ...); +ANN void env_error_footer(const Env env); +ANN Value global_string(const Env env, const m_str str, const loc_t); +ANN void release_ctx(struct Env_Scope_ *a, struct Gwion_ *gwion); struct ScopeEffect { Symbol sym; @@ -72,5 +73,5 @@ struct ScopeEffect { ANN void env_add_effect(const Env a, const Symbol effect, const loc_t); ANN void call_add_effect(const Env env, const Func func, const loc_t); -ANN m_bool already_defined(const Env env, const Symbol s, const loc_t); +ANN bool already_defined(const Env env, const Symbol s, const loc_t); #endif diff --git a/include/env/envset.h b/include/env/envset.h index dc6db789..cdd1f23f 100644 --- a/include/env/envset.h +++ b/include/env/envset.h @@ -1,7 +1,8 @@ #ifndef __ENVSET #define __ENVSET -typedef m_bool (*envset_func)(const void *, const void *); +// couldbe _exp_func +typedef bool (*envset_func)(const void *, const void *); struct EnvSet { const Env env; const envset_func func; @@ -13,13 +14,13 @@ struct EnvSet { bool run; }; -ANN m_bool envset_run(struct EnvSet *, const Type); -ANN2(1, 3) m_bool envset_push(struct EnvSet *, const Type, const Nspc); -ANN static inline m_bool envset_pushv(struct EnvSet *es, const Value v) { +ANN bool envset_run(struct EnvSet *, const Type); +ANN2(1, 3) bool envset_push(struct EnvSet *, const Type, const Nspc); +ANN static inline bool envset_pushv(struct EnvSet *es, const Value v) { es->_ctx = es->env->context; es->_filename = es->env->name; - CHECK_BB(envset_push(es, v->from->owner_class, v->from->owner)); - return GW_OK; + CHECK_B(envset_push(es, v->from->owner_class, v->from->owner)); + return true; } ANN2(1) void envset_pop(struct EnvSet *, const Type); #endif diff --git a/include/env/func.h b/include/env/func.h index cd90ee93..e4495e73 100644 --- a/include/env/func.h +++ b/include/env/func.h @@ -33,7 +33,7 @@ ANEW ANN Func new_func(MemPool, const m_str, const Func_Def); ANN2(1, 2) Symbol func_symbol(const Env, const m_str, const m_str, const m_str, const m_uint); -ANN m_bool check_lambda(const Env, const Type, Exp_Lambda *); +ANN bool check_lambda(const Env, const Type, Exp_Lambda *); ANN Type check_op_call(const Env env, Exp_Call *const exp); ANN void builtin_func(const Gwion gwion, const Func f, void *func_ptr); diff --git a/include/env/type.h b/include/env/type.h index e18d2981..4045a098 100644 --- a/include/env/type.h +++ b/include/env/type.h @@ -67,7 +67,7 @@ ANN2(1, 2) ANEW Type new_type(MemPool, const m_str name, const Type); ANEW ANN Type type_copy(MemPool, const Type type); ANN Value find_value(const Type, const Symbol); ANN m_bool isa(const Type, const Type) __attribute__((pure)); -ANN m_bool isres(const Env, const Tag); +ANN bool isres(const Env, const Tag); ANN Type array_type(const Env, const Type, const m_uint, const loc_t); ANN Type find_common_anc(const Type, const Type) __attribute__((pure)); ANN Type array_base(Type) __attribute__((pure)); diff --git a/include/import.h b/include/import.h index b3f85b5b..0a6242ff 100644 --- a/include/import.h +++ b/include/import.h @@ -25,7 +25,7 @@ typedef struct Gwi_ *Gwi; void a(const Type t NUSED, m_bit *const VALUE NUSED, \ const VM_Shred shred NUSED) #define OP_CHECK(a) ANN Type a(const Env env NUSED, void *data NUSED) -#define OP_EMIT(a) ANN m_bool a(const Emitter emit NUSED, void *data NUSED) +#define OP_EMIT(a) ANN bool a(const Emitter emit NUSED, void *data NUSED) #ifdef GWION_BUILTIN #define GWI_BB(a) \ { \ diff --git a/include/import/checker.h b/include/import/checker.h index 6bb44b03..d73b576f 100644 --- a/include/import/checker.h +++ b/include/import/checker.h @@ -33,7 +33,7 @@ typedef struct OperCK { // name_checker ? m_str ret; Symbol sym; Type (*ck)(Env, void *); // oper - m_bool (*em)(Emitter, void *); // oper + bool (*em)(Emitter, void *); // oper m_str lhs; // oper m_str rhs; // oper struct Vector_ effect; diff --git a/include/instr.h b/include/instr.h index 25724cf7..3be97ae2 100644 --- a/include/instr.h +++ b/include/instr.h @@ -65,7 +65,7 @@ struct dottmpl_ { Type type; m_str tmpl_name; }; -ANN m_bool traverse_dot_tmpl(const Emitter emit, const Func_Def fdef, const Value v); +ANN bool traverse_dot_tmpl(const Emitter emit, const Func_Def fdef, const Value v); INSTR(SetFunc); INSTR(FuncWait); diff --git a/include/operator.h b/include/operator.h index 1cebd8a4..a5591e74 100644 --- a/include/operator.h +++ b/include/operator.h @@ -44,7 +44,7 @@ } while (0) typedef Type (*opck)(const Env, void *); -typedef m_bool (*opem)(const Emitter, void *); +typedef bool (*opem)(const Emitter, void *); struct Op_Func { opck ck; @@ -77,13 +77,13 @@ struct TemplateScan { }; ANN void op_cpy(const Env env, const struct Op_Import *opi); -ANN m_bool add_op(const Gwion gwion, const struct Op_Import *); +ANN bool add_op(const Gwion gwion, const struct Op_Import *); ANN void* op_get(const Env env, struct Op_Import *opi); -ANN Type op_check(const Env, struct Op_Import *); -ANN m_bool op_emit(const Emitter, const struct Op_Import *); -ANN m_bool operator_set_func(const struct Op_Import *); -ANN void free_op_map(Map map, struct Gwion_ *gwion); -ANN void free_op_tmpl(Vector v, struct Gwion_ *gwion); +ANN Type op_check(const Env, struct Op_Import *); +ANN bool op_emit(const Emitter, const struct Op_Import *); +ANN bool operator_set_func(const struct Op_Import *); +ANN void free_op_map(Map map, struct Gwion_ *gwion); +ANN void free_op_tmpl(Vector v, struct Gwion_ *gwion); ANN void operator_suspend(const Nspc, struct Op_Import *); ANN static inline void operator_resume(struct Op_Import *opi) { @@ -97,5 +97,5 @@ ANN static inline void set_decl_ref(Exp* e) { } ANN void func_operator(const Func_Def fdef, struct Op_Import *opi); -ANN m_bool add_op_func_check(const Env env, const Type t, const struct Op_Func *opfunc, const m_uint idx); +ANN bool add_op_func_check(const Env env, const Type t, const struct Op_Func *opfunc, const m_uint idx); #endif diff --git a/include/parse.h b/include/parse.h index b17a1731..bad8dbb8 100644 --- a/include/parse.h +++ b/include/parse.h @@ -8,7 +8,7 @@ #define ERR_B(a, b, ...) \ { \ env_err(env, (a), (b), ##__VA_ARGS__); \ - return GW_ERROR; \ + return false; \ } #undef ERR_O @@ -21,7 +21,7 @@ #define RET_NSPC(exp) \ ++env->scope->depth; \ nspc_push_value(env->gwion->mp, env->curr); \ - const m_bool ret = exp; \ + const bool ret = exp; \ nspc_pop_value(env->gwion->mp, env->curr); \ --env->scope->depth; \ return ret; @@ -42,50 +42,61 @@ #define HANDLE_EXP_FUNC(prefix, type, Arg) \ DECL_EXP_FUNC(prefix, type, Arg) \ - ANN type prefix##_exp(const Arg arg, Exp* exp) { \ - do CHECK_BB(prefix##_exp_func[exp->exp_type](arg, &exp->d)); \ - while ((exp = exp->next)); \ - return GW_OK; \ + ANN type prefix##_exp(const Arg arg, Exp* exp) { \ + bool ok = true; \ + do { \ + if(exp->poison) continue; \ + if(!prefix##_exp_func[exp->exp_type](arg, &exp->d)) { \ + prefix##_poison(arg, exp); \ + ok = false; \ + } \ + } while ((exp = exp->next)); \ + return ok; \ } -ANN m_bool scan1_exp(const Env, Exp*); -ANN m_bool scan2_exp(const Env, Exp*); + +ANN static inline void scanx_poison(const Env env, Exp *e) { + env->scope->poison = true; + e->poison = true; +} #define describe_stmt_func(prefix, name, type, prolog, exp) \ - ANN static m_bool prefix##_stmt_##name(const Env env, const type stmt) { \ + ANN static bool prefix##_stmt_##name(const Env env, const type stmt) { \ RET_NSPC(exp) \ } -ANN m_bool check_stmt(const Env env, Stmt* stmt); -ANN m_bool check_stmt_list(const Env env, const Stmt_List); +ANN bool check_stmt(const Env env, Stmt* stmt); // neeeded??? +ANN bool check_stmt_list(const Env env, const Stmt_List); -typedef m_bool (*_exp_func)(const void *, const void *); -ANN m_bool scanx_body(const Env env, const Class_Def cdef, const _exp_func f, +typedef bool (*_exp_func)(const void *, const void *); +ANN bool scanx_body(const Env env, const Class_Def cdef, const _exp_func f, void *data); -static inline ANN m_bool env_body(const Env env, const Class_Def cdef, +static inline ANN bool env_body(const Env env, const Class_Def cdef, const _exp_func f) { return scanx_body(env, cdef, f, env); } #define env_body(a, b, c) env_body(a, b, (_exp_func)c) -ANN m_bool scanx_cdef(const Env, void *, const Type, const _exp_func f_cdef, +ANN bool scanx_cdef(const Env, void *, const Type, const _exp_func f_cdef, const _exp_func f_union); #define xxx_cdef(prefix) \ - static inline m_bool prefix##_cdef(const Env env, const Type t) { \ + static inline bool prefix##_cdef(const Env env, const Type t) { \ return scanx_cdef(env, env, t, (_exp_func)prefix##_class_def, \ (_exp_func)prefix##_union_def); \ } -xxx_cdef(scan0) xxx_cdef(scan1) xxx_cdef(scan2) xxx_cdef(check) - xxx_cdef(traverse) +xxx_cdef(scan0); +xxx_cdef(scan1); +xxx_cdef(scan2); +xxx_cdef(check); +xxx_cdef(traverse); - ANN m_bool - scanx_fdef(const Env, void *, const Func_Def, const _exp_func); +ANN bool scanx_fdef(const Env, void *, const Func_Def, const _exp_func); -ANN m_bool check_subscripts(const Env, const Array_Sub, const m_bool is_decl); -ANN m_bool check_implicit(const Env env, Exp* e, const Type t); -ANN m_bool ensure_traverse(const Env env, const Type t); -ANN m_bool check_traverse_fdef(const Env env, const Func_Def fdef); +ANN bool check_subscripts(const Env, const Array_Sub, const bool is_decl); +ANN bool check_implicit(const Env env, Exp* e, const Type t); +ANN bool ensure_traverse(const Env env, const Type t); +ANN bool check_traverse_fdef(const Env env, const Func_Def fdef); ANN static inline void env_weight(const Env env, const uint16_t weight) { if (env->func) @@ -123,7 +134,7 @@ ANN static inline bool not_upvalue(const Env env, const Value v) { nspc_lookup_value1(env->curr, insert_symbol(v->name)); } -ANN m_bool abstract_array(const Env env, const Array_Sub array); +ANN bool abstract_array(const Env env, const Array_Sub array); ANN static inline bool is_static_call(const Gwion gwion, Exp* e) { if (e->exp_type != ae_exp_dot) return true; @@ -135,5 +146,28 @@ ANN static inline bool is_static_call(const Gwion gwion, Exp* e) { member->base->exp_type == ae_exp_cast; } + +ANN bool template_push_types(const Env, const Tmpl *); +static inline bool scanx_actual_tmpl(const Tmpl *tmpl) { + return tmpl && tmpl->call && tmpl->call != (TmplArg_List)1 && tmpl->list; +} + +ANN static inline bool scanx_tmpl_push(const Env env, const Tmpl *tmpl) { + return scanx_actual_tmpl(tmpl) ? template_push_types(env, tmpl): false; +} + +ANN static inline m_int scanx_push(const Env env, const Class_Def c) { + const m_int scope = env_push_type(env, c->base.type); + if(scope < 0) return -1; + return (!c->base.tmpl || scanx_tmpl_push(env, c->base.tmpl)) ? scope : -1; +} + +ANN static inline void scanx_pop(const Env e, const Class_Def c, const m_uint s) { + if (scanx_actual_tmpl(c->base.tmpl)) + nspc_pop_type(e->gwion->mp, e->curr); + env_pop(e, s); +} + + #define is_new(a) !strcmp(s_name((a)->base->tag.sym), "new") #endif diff --git a/include/pass.h b/include/pass.h index db978889..ccb486b0 100644 --- a/include/pass.h +++ b/include/pass.h @@ -6,7 +6,7 @@ struct Passes_ { struct Vector_ vec; }; // change this to gwion ? -typedef m_bool (*compilation_pass)(const Env, Ast*); +typedef bool (*compilation_pass)(const Env, Ast*); ANEW ANN struct Passes_ *new_passes(const Gwion); ANN void free_passes(MemPool mp, struct Passes_ *); diff --git a/include/spread.h b/include/spread.h index b95d4428..5cf9426a 100644 --- a/include/spread.h +++ b/include/spread.h @@ -6,7 +6,7 @@ ANN static inline bool is_spread_tmpl(const Tmpl *tmpl) { return !strcmp(s_name(spec->tag.sym), "..."); } -ANN m_bool spread_ast(const Env env, const Spread_Def spread, const Tmpl *tmpl); +ANN bool spread_ast(const Env env, const Spread_Def spread, const Tmpl *tmpl); ANN Stmt_List spread_func(const Env env, const Stmt_List body); #endif diff --git a/include/template.h b/include/template.h index f11821a6..b4e4dc74 100644 --- a/include/template.h +++ b/include/template.h @@ -1,7 +1,7 @@ #ifndef __TEMPLATE #define __TEMPLATE -ANN m_bool template_push_types(const Env, const Tmpl *); -ANN m_bool template_push(const Env env, const Type t); +ANN bool template_push_types(const Env, const Tmpl *); +ANN bool template_push(const Env env, const Type t); ANN Tmpl *mk_tmpl(const Env, const Tmpl *, const TmplArg_List); /* //! returns the Tmpl of a class or enum def @@ -27,5 +27,5 @@ ANN static inline Tmpl* get_tmpl(const Type t) { return (a); \ } -ANN m_bool const_generic_typecheck(const Env env, const Specialized *spec, const TmplArg *targ); +ANN bool const_generic_typecheck(const Env env, const Specialized *spec, const TmplArg *targ); #endif diff --git a/include/tmp_resolve.h b/include/tmp_resolve.h index f88e75b2..0aebd6d7 100644 --- a/include/tmp_resolve.h +++ b/include/tmp_resolve.h @@ -3,5 +3,5 @@ ANN Func find_template_match(const Env env, const Value value, Exp_Call *const exp); ANN Func find_func_match(const Env env, const Func up, Exp_Call *const exp); -ANN2(1,2) m_bool check_tmpl(const Env env, const TmplArg_List tl, const Specialized_List sl, const loc_t loc, const bool is_spread); +ANN2(1,2) bool check_tmpl(const Env env, const TmplArg_List tl, const Specialized_List sl, const loc_t loc, const bool is_spread); #endif diff --git a/include/traverse.h b/include/traverse.h index 64385841..dede5914 100644 --- a/include/traverse.h +++ b/include/traverse.h @@ -1,53 +1,53 @@ #ifndef __TRAVERSE #define __TRAVERSE -ANN m_bool traverse_ast(const Env, Ast *const); -ANN m_bool traverse_class_def(const Env, const Class_Def); -ANN m_bool traverse_func_def(const Env, const Func_Def); -ANN m_bool traverse_union_def(const Env, const Union_Def); -ANN m_bool traverse_enum_def(const Env, const Enum_Def); -ANN m_bool traverse_fptr_def(const Env, const Fptr_Def); -ANN m_bool traverse_type_def(const Env env, const Type_Def); -ANN m_bool traverse_exp(const Env, Exp*); - -ANN m_bool scan0_ast(const Env, Ast*); -ANN m_bool scan1_ast(const Env, Ast*); -ANN m_bool scan2_ast(const Env, Ast*); -ANN m_bool check_ast(const Env, Ast*); - -ANN m_bool scan1_exp(const Env, Exp*); -ANN m_bool scan2_exp(const Env, Exp*); -ANN Type check_exp(const Env, Exp*); - -ANN m_bool scan0_func_def(const Env, const Func_Def); -ANN m_bool scan1_func_def(const Env, const Func_Def); -ANN m_bool scan2_func_def(const Env, const Func_Def); -ANN m_bool check_func_def(const Env, const Func_Def); - -ANN m_bool scan0_fptr_def(const Env, const Fptr_Def); -ANN m_bool scan1_fptr_def(const Env, const Fptr_Def); -ANN m_bool scan2_fptr_def(const Env, const Fptr_Def); -ANN m_bool check_fptr_def(const Env, const Fptr_Def); - -ANN m_bool scan0_union_def(const Env, const Union_Def); -ANN m_bool scan1_union_def(const Env, const Union_Def); -ANN m_bool scan2_union_def(const Env, const Union_Def); -ANN m_bool check_union_def(const Env, const Union_Def); - -ANN m_bool scan0_enum_def(const Env, const Enum_Def); -ANN m_bool scan1_enum_def(const Env, const Enum_Def); -// ANN m_bool scan2_enum_def(const Env, const Enum_Def); -ANN m_bool check_enum_def(const Env, const Enum_Def); - -ANN m_bool scan0_type_def(const Env, const Type_Def); -ANN m_bool scan1_type_def(const Env, const Type_Def); -ANN m_bool scan2_type_def(const Env, const Type_Def); -ANN m_bool check_type_def(const Env, const Type_Def); - -ANN m_bool scan0_class_def(const Env, const Class_Def); -ANN m_bool scan1_class_def(const Env, const Class_Def); -ANN m_bool scan2_class_def(const Env, const Class_Def); -ANN m_bool check_class_def(const Env, const Class_Def); +ANN bool traverse_ast(const Env, Ast *const); +ANN bool traverse_class_def(const Env, const Class_Def); +ANN bool traverse_func_def(const Env, const Func_Def); +ANN bool traverse_union_def(const Env, const Union_Def); +ANN bool traverse_enum_def(const Env, const Enum_Def); +ANN bool traverse_fptr_def(const Env, const Fptr_Def); +ANN bool traverse_type_def(const Env env, const Type_Def); +ANN bool traverse_exp(const Env, Exp*); + +ANN bool scan0_ast(const Env, Ast*); +ANN bool scan1_ast(const Env, Ast*); +ANN bool scan2_ast(const Env, Ast*); +ANN bool check_ast(const Env, Ast*); + +ANN bool scan1_exp(const Env, Exp*); +ANN bool scan2_exp(const Env, Exp*); +ANN Type check_exp(const Env, Exp*); + +ANN bool scan0_func_def(const Env, const Func_Def); +ANN bool scan1_func_def(const Env, const Func_Def); +ANN bool scan2_func_def(const Env, const Func_Def); +ANN bool check_func_def(const Env, const Func_Def); + +ANN bool scan0_fptr_def(const Env, const Fptr_Def); +ANN bool scan1_fptr_def(const Env, const Fptr_Def); +ANN bool scan2_fptr_def(const Env, const Fptr_Def); +ANN bool check_fptr_def(const Env, const Fptr_Def); + +ANN bool scan0_union_def(const Env, const Union_Def); +ANN bool scan1_union_def(const Env, const Union_Def); +ANN bool scan2_union_def(const Env, const Union_Def); +ANN bool check_union_def(const Env, const Union_Def); + +ANN bool scan0_enum_def(const Env, const Enum_Def); +ANN bool scan1_enum_def(const Env, const Enum_Def); +// ANN bool scan2_enum_def(const Env, const Enum_Def); +ANN bool check_enum_def(const Env, const Enum_Def); + +ANN bool scan0_type_def(const Env, const Type_Def); +ANN bool scan1_type_def(const Env, const Type_Def); +ANN bool scan2_type_def(const Env, const Type_Def); +ANN bool check_type_def(const Env, const Type_Def); + +ANN bool scan0_class_def(const Env, const Class_Def); +ANN bool scan1_class_def(const Env, const Class_Def); +ANN bool scan2_class_def(const Env, const Class_Def); +ANN bool check_class_def(const Env, const Class_Def); ANN Type check_exp_call1(const Env env, Exp_Call *const exp); -ANN m_bool scan0_prim_def(const Env env, const Prim_Def pdef); +ANN bool scan0_prim_def(const Env env, const Prim_Def pdef); #endif -- 2.43.0