9#define AST_NEW(type, name, ...) type new_##name(MemPool p, __VA_ARGS__)
11#define AST_FREE(type, name) void free_##name(MemPool p NUSED, type a NUSED)
23typedef struct SectionList*
Ast;
29#define MK_TAG(a, b) (Tag){ .sym = (a), .loc = (b) }
212#define MK_STMT(_type, _loc, ...) (Stmt){ .stmt_type = _type, \
213 .d = { __VA_ARGS__ }, .loc = _loc }
214#define MK_STMT_PP(_type, _pos, ...) MK_STMT(ae_stmt_pp, _pos, .stmt_pp = { .pp_type = ae_pp_##_type, __VA_ARGS__ })
215#define MK_STMT_EXP(_pos, _exp) MK_STMT(ae_stmt_exp, _pos, .stmt_exp = { .val = _exp })
216#define MK_STMT_RETURN(_pos, _exp) MK_STMT(ae_stmt_return, _pos, .stmt_exp = { .val = _exp })
219 return container_of((
char *)data,
Stmt, d);
228 const bool,
const loc_t);
248#define MK_VAR(a, b) (Variable){ .td = (a), .vd = (b) }
266#define MK_TMPLARG_TD(a) \
268 .type = tmplarg_td, \
269 .d = { .td = (a) }, \
271#define MK_TMPLARG_EXP(a) \
273 .type = tmplarg_exp, \
274 .d = { .exp = (a) }, \
294 for(uint32_t i = 0; i < tl->len; i++) {
295 const TmplArg ta = tmplarglist_at(tl, i);
303 for(uint32_t i = 0; i < tl->len; i++) {
304 const TmplArg ta = tmplarglist_at(tl, i);
455#define GWINT(a, b) ((struct gwint){ .num = a, .int_type = b})
488 return !strcmp(s_name(spec.
tag.
sym),
"...");
493 if (a && !a->
call)
return true;
641 return container_of((
char *)data,
Exp, d);
659ANEW ANN
AST_NEW(
Exp*, prim_string, const m_str, const uint16_t delim, const
loc_t);
699 for (uint32_t i = 1; i < n; i++) CHECK_O((e = e->
next));
746 const ae_flag flag, const
loc_t);
823#define MK_SECTION(_type, _target, _data, _loc) (Section){ .section_type = ae_section_##_type, .d = { ._target = _data }, .loc = _loc }
888 return (c->
cflag & flag) == flag;
struct Stmt_Flow_ * Stmt_Flow
ANN ANEW Trait_Def new_trait_def(MemPool p, const ae_flag, const Symbol, const Ast, const loc_t)
static bool is_prim_float(const Exp *e)
struct Variable_ Variable
variable declaration
struct Stmt_For_ * Stmt_For
struct Exp_Call_ Exp_Call
struct Extend_Def_ * Extend_Def
struct Class_Def_ * Class_Def
struct Stmt_Exp_ * Stmt_Exp
struct Stmt_Each_ * Stmt_Each
static loc_t prim_pos(const void *data)
static ANN int exp_getuse(const Exp *e)
ANN void free_variablelist(MemPool p, VariableList *)
static ANN uint32_t tmplarg_has_const(const TmplArgList *tl)
static ANN int exp_getprot(const Exp *e)
struct Stmt_PP_ * Stmt_PP
struct EnumValue EnumValue
struct Enum_Def_ * Enum_Def
#define AST_NEW(type, name,...)
ANN void free_tmpl(MemPool p, Tmpl *)
ANN void free_stmt_list(MemPool, StmtList *)
struct Prim_Def_ * Prim_Def
static Stmt * stmt_self(const void *data)
static Exp_Primary * prim_self(const void *data)
static Exp * exp_self(const void *data)
static ANN int exp_getvar(const Exp *e)
ANN void free_ast(MemPool p, Ast)
ANEW Class_Def new_class_def(MemPool p, const ae_flag, const Tag, Type_Decl *, const Ast)
ANN void free_trait_def(MemPool p, Trait_Def)
ANN void free_stmt(MemPool p, Stmt *)
struct Range_ Range
range.
ANN void free_class_def(MemPool p, Class_Def)
ANN void free_union_def(MemPool p, Union_Def)
struct Array_Sub_ * Array_Sub
struct Stmt_Loop_ * Stmt_Loop
ANEW Extend_Def new_extend_def(MemPool p, Type_Decl *const, TagList *const)
ANN void free_type_decl(MemPool p, Type_Decl *)
struct Stmt_Defer_ * Stmt_Defer
struct Match * Stmt_Match
static Exp * prim_exp(const void *data)
struct Stmt_Import_ * Stmt_Import
static bool is_prim_int(const Exp *e)
ANN void free_specialized_list(MemPool p, SpecializedList *)
struct Func_Def_ * Func_Def
struct Specialized Specialized
static Exp * take_exp(Exp *exp, const uint32_t n)
ANN void free_fptr_def(MemPool p, Fptr_Def)
struct Fptr_Def_ * Fptr_Def
struct Trait_Def_ * Trait_Def
struct Func_Base_ Func_Base
struct Var_Decl_ Var_Decl
ANN void free_type_def(MemPool p, Type_Def)
struct Type_Def_ * Type_Def
ANN void free_func_def(MemPool p, Func_Def)
ANN void free_tmplarg_list(MemPool p, TmplArgList *)
ANEW ANN2(1, 3) AST_NEW(Stmt *
static ANN m_str exp_access(const Exp *e)
ANN void free_enum_def(MemPool p, Enum_Def)
struct Stmt_Try_ * Stmt_Try
static ANN void exp_setvar(Exp *e, const bool val)
struct Spread_Def_ * Spread_Def
Exp *ANN void free_array_sub(MemPool p, Array_Sub)
static bool is_prim(const Exp *e)
ANN void free_exp(MemPool p, Exp *)
static ANN void exp_setuse(Exp *e, const bool val)
static uint32_t exp_count(Exp *exp)
ANN void free_arg_list(MemPool p, ArgList *)
static ANN bool is_spread_tmpl(const Tmpl *tmpl)
ANN void free_func_base(MemPool p, Func_Base *)
struct ParserHandler ParserHandler
static ANN void exp_setprot(Exp *e, const bool val)
struct Stmt_Code_ * Stmt_Code
ANEW const Type_Decl Exp * exp
ANN void free_extend_def(MemPool p, Extend_Def)
struct Stmt_If_ * Stmt_If
static ANN void exp_setmeta(Exp *e, const bool val)
static ANN uint32_t tmplarg_ntypes(const TmplArgList *tl)
struct Stmt_Index_ * Stmt_Index
ANN void free_prim_def(MemPool p, Prim_Def)
static bool tmpl_base(const Tmpl *a)
static ANN int exp_getmeta(const Exp *e)
struct Union_Def_ * Union_Def
struct Stmt_Using_ * Stmt_Using
Array_Sub prepend_array_sub(const Array_Sub a, Exp *exp)
enum unary_type unary_type
enum exp_comptime comptime
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 Value_ * value
corresponding value
a gwint with a larger int type for parsing
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_Index_ stmt_index
struct Stmt_Using_ stmt_using
struct Stmt_For_ stmt_for
struct Stmt_Flow_ stmt_flow
struct Stmt_Exp_ stmt_exp