+
+ # Make a new assert
+ fun make_assert(n_id : nullable TId , n_expr : AExpr , n_else : nullable AExpr): AAssertExpr
+ do
+ return new AAssertExpr.make(n_id , n_expr , n_else)
+ end
+
+ # Make a new method
+ fun make_method(n_visibility: nullable AVisibility,
+ tk_redef: nullable TKwredef,
+ mmethoddef: nullable MMethodDef,
+ n_signature: nullable ASignature,
+ n_annotations: nullable AAnnotations,
+ n_extern_calls: nullable AExternCalls,
+ n_extern_code_block: nullable AExternCodeBlock,
+ n_block: nullable AExpr): AMethPropdef
+ do
+ return new AMethPropdef.make(n_visibility, tk_redef, mmethoddef, n_signature, n_annotations, n_extern_calls, n_extern_code_block, n_block)
+ end
+
+ # Make a new or with two expr
+ fun make_or(right_expr: AExpr, left_expr: AExpr): AOrExpr
+ do
+ return new AOrExpr.make(right_expr,left_expr)
+ end
+
+ # Make a new and with two expr
+ fun make_and(right_expr: AExpr, left_expr: AExpr): AAndExpr
+ do
+ return new AAndExpr.make(right_expr,left_expr)
+ end
+
+ # Make a new parenthesis expr
+ fun make_parenthesis(expr: AExpr, annotations: nullable AAnnotations): AParExpr
+ do
+ return new AParExpr.make(expr,annotations)
+ end
+
+ # Make a new message super
+ fun make_super_call(args: nullable Array[AExpr], n_qualified: nullable AQualified): ASuperExpr
+ do
+ return new ASuperExpr.make(args,n_qualified)
+ end
+
+ # Make a new return
+ fun make_return(expr: nullable AExpr): AReturnExpr
+ do
+ return new AReturnExpr.make(expr)
+ end
+
+ # Make a new not
+ fun make_not(expr: AExpr): ANotExpr
+ do
+ return new ANotExpr.make(expr)
+ end
+
+ # Make a new attribute
+ fun make_attribute(name: String,
+ n_type: nullable AType,
+ n_visibility: nullable AVisibility,
+ initial_value: nullable AExpr,
+ n_block: nullable AExpr,
+ m_attributedef: nullable MAttributeDef,
+ m_setterdef: nullable MMethodDef,
+ m_getterdef: nullable MMethodDef): AAttrPropdef
+ do
+ return new AAttrPropdef.make(name, n_type, n_visibility, initial_value, n_block, m_attributedef, m_setterdef, m_getterdef)
+ end
+
+ # Make a new class (AStdClassdef)
+ fun make_class(mclassdef: nullable MClassDef,
+ n_visibility: nullable AVisibility,
+ n_formaldefs : Collection[AFormaldef],
+ n_extern_code_block : nullable AExternCodeBlock,
+ n_propdefs : Collection[APropdef],
+ n_classkind: nullable AClasskind): AStdClassdef
+ do
+ return new AStdClassdef.make(mclassdef, n_visibility, n_formaldefs, n_extern_code_block, n_propdefs, n_classkind)
+ end
+
+ fun make_var(variable: Variable, mtype: MType): AVarExpr
+ do
+ return new AVarExpr.make(variable, mtype)
+ end
+
+ # Make a call assignment i.e `a = 10`
+ fun make_call_assign(recv: AExpr, callsite: CallSite, n_args: nullable Collection[AExpr], n_value: AExpr): ACallAssignExpr
+ do
+ return new ACallAssignExpr.make(recv, callsite, n_args, n_value)
+ end
+
+ # Build a callsite to call the `mproperty` in the current method `caller_method`.
+ # `is_self_call` indicate if the method caller is a property of `self`
+ fun create_callsite(modelbuilder: ModelBuilder, caller_method : AMethPropdef, mproperty: MMethod, is_self_call: Bool): CallSite
+ do
+ # FIXME It's not the better solution to call `TypeVisitor` here to build a model entity, but some make need to have a callsite
+ var type_visitor = new TypeVisitor(modelbuilder, caller_method.mpropdef.as(not null))
+ var callsite = type_visitor.build_callsite_by_property(caller_method, mproperty.intro_mclassdef.bound_mtype, mproperty, is_self_call)
+ assert callsite != null
+ return callsite
+ end