1 /* This C file is generated by NIT to compile module genericity. */
2 #include "genericity._sep.h"
3 val_t
genericity___MMLocalClass___get_formal(val_t self
, val_t param0
) {
4 struct trace_t trace
= {NULL
, NULL
, 25, LOCATE_genericity___MMLocalClass___get_formal
};
10 trace
.prev
= tracehead
; tracehead
= &trace
;
11 trace
.file
= LOCATE_genericity
;
13 variable1
= ((genericity___MMLocalClass___formals_types_t
)CALL( self
,COLOR_genericity___MMLocalClass___formals_types
))( self
) /*MMLocalClass::formals_types*/;
14 variable2
= variable0
/*pos*/;
15 variable3
= TAG_Bool(UNTAG_Int( variable2
/*index*/)>=UNTAG_Int( TAG_Int(0)));
16 variable4
= variable3
;
17 if (UNTAG_Bool(variable4
)) { /* and */
18 variable4
= variable1
;
19 variable4
= ATTR_array___AbstractArray____length(variable4
) /*AbstractArray::_length*/;
20 variable4
= TAG_Bool(UNTAG_Int( variable2
/*index*/)<UNTAG_Int(variable4
));
22 variable3
= variable4
;
23 if (!UNTAG_Bool(variable3
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
24 variable3
= variable1
;
25 variable3
= ATTR_array___Array____items(variable3
) /*Array::_items*/;
26 variable3
= UNBOX_NativeArray(variable3
)[UNTAG_Int( variable2
/*index*/)];
28 return_label1
: while(false);
29 variable1
= variable3
;
31 return_label0
: while(false);
32 tracehead
= trace
.prev
;
35 void genericity___MMLocalClass___register_formal(val_t self
, val_t param0
) {
36 struct trace_t trace
= {NULL
, NULL
, 31, LOCATE_genericity___MMLocalClass___register_formal
};
40 trace
.prev
= tracehead
; tracehead
= &trace
;
41 trace
.file
= LOCATE_genericity
;
43 variable1
= ((genericity___MMTypeFormalParameter___def_class_t
)CALL( variable0
/*f*/,COLOR_genericity___MMTypeFormalParameter___def_class
))( variable0
/*f*/) /*MMTypeFormalParameter::def_class*/;
44 variable1
= TAG_Bool((variable1
== self
) || ((variable1
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable1
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable1
, self
)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable1
,COLOR_kernel___Object_____eqeq
))(variable1
, self
) /*Object::==*/)))));
45 if (!UNTAG_Bool(variable1
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMLocalClass___register_formal
, LOCATE_genericity
, 35); nit_exit(1);}
46 variable1
= ((genericity___MMTypeFormalParameter___position_t
)CALL( variable0
/*f*/,COLOR_genericity___MMTypeFormalParameter___position
))( variable0
/*f*/) /*MMTypeFormalParameter::position*/;
47 variable2
= ATTR_genericity___MMLocalClass____formals_types( self
) /*MMLocalClass::_formals_types*/;
48 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*AbstractArray::length*/;
49 variable1
= TAG_Bool((variable1
)==(variable2
));
50 if (!UNTAG_Bool(variable1
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMLocalClass___register_formal
, LOCATE_genericity
, 36); nit_exit(1);}
51 variable1
= ATTR_genericity___MMLocalClass____formals_types( self
) /*MMLocalClass::_formals_types*/;
52 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable0
/*f*/) /*AbstractArray::add*/;
53 tracehead
= trace
.prev
;
56 val_t
genericity___MMLocalClass___get_instantiate_type(val_t self
, val_t param0
) {
57 struct trace_t trace
= {NULL
, NULL
, 43, LOCATE_genericity___MMLocalClass___get_instantiate_type
};
62 trace
.prev
= tracehead
; tracehead
= &trace
;
63 trace
.file
= LOCATE_genericity
;
65 variable1
= ATTR_genericity___MMLocalClass____types( self
) /*MMLocalClass::_types*/;
66 variable1
= ((array___AbstractArray___iterator_t
)CALL(variable1
,COLOR_abstract_collection___Collection___iterator
))(variable1
) /*AbstractArray::iterator*/;
67 while (true) { /*for*/
68 variable2
= ((array___ArrayIterator___is_ok_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___is_ok
))(variable1
) /*ArrayIterator::is_ok*/;
69 if (!UNTAG_Bool(variable2
)) break; /*for*/
70 variable2
= ((array___ArrayIterator___item_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___item
))(variable1
) /*ArrayIterator::item*/;
71 variable3
= ((genericity___MMTypeGeneric___params_equals_t
)CALL( variable2
/*g*/,COLOR_genericity___MMTypeGeneric___params_equals
))( variable2
/*g*/, variable0
/*t*/) /*MMTypeGeneric::params_equals*/;
72 if (UNTAG_Bool(variable3
)) { /*if*/
73 variable1
= variable2
/*g*/;
77 ((array___ArrayIterator___next_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___next
))(variable1
) /*ArrayIterator::next*/;
80 variable2
= NEW_genericity___MMTypeGeneric___init( self
, variable0
/*t*/); /*new MMTypeGeneric*/
81 variable1
= variable2
;
82 variable2
= ATTR_genericity___MMLocalClass____types( self
) /*MMLocalClass::_types*/;
83 ((array___AbstractArray___add_t
)CALL(variable2
,COLOR_abstract_collection___SimpleCollection___add
))(variable2
, variable1
/*g*/) /*AbstractArray::add*/;
84 variable1
= variable1
/*g*/;
86 return_label3
: while(false);
87 tracehead
= trace
.prev
;
90 val_t
genericity___MMLocalClass___formals_types(val_t self
) {
91 struct trace_t trace
= {NULL
, NULL
, 57, LOCATE_genericity___MMLocalClass___formals_types
};
100 trace
.prev
= tracehead
; tracehead
= &trace
;
101 trace
.file
= LOCATE_genericity
;
102 variable0
= ATTR_genericity___MMLocalClass____formals_types( self
) /*MMLocalClass::_formals_types*/;
103 variable0
= ((array___AbstractArray___is_empty_t
)CALL(variable0
,COLOR_abstract_collection___Collection___is_empty
))(variable0
) /*AbstractArray::is_empty*/;
104 if (UNTAG_Bool(variable0
)) { /*if*/
105 variable0
= TAG_Bool(( self
==NIT_NULL
) || VAL_ISA( self
, COLOR_MMConcreteClass
, ID_MMConcreteClass
)) /*cast MMConcreteClass*/;
106 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable0
)))) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMLocalClass___formals_types
, LOCATE_genericity
, 62); nit_exit(1);}
107 variable0
= ((abstractmetamodel___MMLocalClass___arity_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass___arity
))( self
) /*MMLocalClass::arity*/;
108 variable1
= NEW_range___Range___without_last( TAG_Int(0), variable0
); /*new Range[E]*/
109 variable0
= variable1
;
110 variable0
= ((range___Range___iterator_t
)CALL(variable0
,COLOR_abstract_collection___Collection___iterator
))(variable0
) /*Range::iterator*/;
111 while (true) { /*for*/
112 variable1
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___is_ok
))(variable0
) /*Iterator::is_ok*/;
113 if (!UNTAG_Bool(variable1
)) break; /*for*/
114 variable1
= ((abstract_collection___Iterator___item_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___item
))(variable0
) /*Iterator::item*/;
115 variable3
= ((abstractmetamodel___MMLocalClass___global_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass___global
))( self
) /*MMLocalClass::global*/;
116 variable3
= ((abstractmetamodel___MMGlobalClass___intro_t
)CALL(variable3
,COLOR_abstractmetamodel___MMGlobalClass___intro
))(variable3
) /*MMGlobalClass::intro*/;
117 variable3
= ((genericity___MMLocalClass___get_formal_t
)CALL(variable3
,COLOR_genericity___MMLocalClass___get_formal
))(variable3
, variable1
/*i*/) /*MMLocalClass::get_formal*/;
118 variable2
= variable3
;
119 variable4
= ((type_formal___MMTypeFormal___name_t
)CALL( variable2
/*oft*/,COLOR_type_formal___MMTypeFormal___name
))( variable2
/*oft*/) /*MMTypeFormal::name*/;
120 variable5
= NEW_genericity___MMTypeFormalParameter___init(variable4
, variable1
/*i*/, self
); /*new MMTypeFormalParameter*/
121 variable4
= variable5
;
122 variable3
= variable4
;
123 ((genericity___MMLocalClass___register_formal_t
)CALL( self
,COLOR_genericity___MMLocalClass___register_formal
))( self
, variable3
/*ft*/) /*MMLocalClass::register_formal*/;
124 continue_6
: while(0);
125 ((abstract_collection___Iterator___next_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___next
))(variable0
) /*Iterator::next*/;
128 variable0
= ((abstractmetamodel___MMLocalClass___arity_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass___arity
))( self
) /*MMLocalClass::arity*/;
129 variable1
= NEW_range___Range___without_last( TAG_Int(0), variable0
); /*new Range[E]*/
130 variable0
= variable1
;
131 variable0
= ((range___Range___iterator_t
)CALL(variable0
,COLOR_abstract_collection___Collection___iterator
))(variable0
) /*Range::iterator*/;
132 while (true) { /*for*/
133 variable1
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___is_ok
))(variable0
) /*Iterator::is_ok*/;
134 if (!UNTAG_Bool(variable1
)) break; /*for*/
135 variable1
= ((abstract_collection___Iterator___item_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___item
))(variable0
) /*Iterator::item*/;
136 variable3
= ((abstractmetamodel___MMLocalClass___global_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass___global
))( self
) /*MMLocalClass::global*/;
137 variable3
= ((abstractmetamodel___MMGlobalClass___intro_t
)CALL(variable3
,COLOR_abstractmetamodel___MMGlobalClass___intro
))(variable3
) /*MMGlobalClass::intro*/;
138 variable3
= ((genericity___MMLocalClass___get_formal_t
)CALL(variable3
,COLOR_genericity___MMLocalClass___get_formal
))(variable3
, variable1
/*i*/) /*MMLocalClass::get_formal*/;
139 variable2
= variable3
;
140 variable4
= ATTR_genericity___MMLocalClass____formals_types( self
) /*MMLocalClass::_formals_types*/;
141 variable5
= variable1
/*i*/;
142 variable6
= TAG_Bool(UNTAG_Int( variable5
/*index*/)>=UNTAG_Int( TAG_Int(0)));
143 variable7
= variable6
;
144 if (UNTAG_Bool(variable7
)) { /* and */
145 variable7
= variable4
;
146 variable7
= ATTR_array___AbstractArray____length(variable7
) /*AbstractArray::_length*/;
147 variable7
= TAG_Bool(UNTAG_Int( variable5
/*index*/)<UNTAG_Int(variable7
));
149 variable6
= variable7
;
150 if (!UNTAG_Bool(variable6
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
151 variable6
= variable4
;
152 variable6
= ATTR_array___Array____items(variable6
) /*Array::_items*/;
153 variable6
= UNBOX_NativeArray(variable6
)[UNTAG_Int( variable5
/*index*/)];
155 return_label8
: while(false);
156 variable4
= variable6
;
157 variable3
= variable4
;
158 variable4
= ((type_formal___MMTypeFormal___bound_t
)CALL( variable2
/*oft*/,COLOR_type_formal___MMTypeFormal___bound
))( variable2
/*oft*/) /*MMTypeFormal::bound*/;
159 variable5
= ((abstractmetamodel___MMLocalClass___module_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass___module
))( self
) /*MMLocalClass::module*/;
160 variable4
= ((static_type___MMType___for_module_t
)CALL(variable4
,COLOR_static_type___MMType___for_module
))(variable4
, variable5
) /*MMType::for_module*/;
161 ((genericity___MMTypeFormalParameter___bound__eq_t
)CALL( variable3
/*ft*/,COLOR_genericity___MMTypeFormalParameter___bound__eq
))( variable3
/*ft*/, variable4
) /*MMTypeFormalParameter::bound=*/;
162 continue_7
: while(0);
163 ((abstract_collection___Iterator___next_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___next
))(variable0
) /*Iterator::next*/;
167 variable0
= ATTR_genericity___MMLocalClass____formals_types( self
) /*MMLocalClass::_formals_types*/;
169 return_label5
: while(false);
170 tracehead
= trace
.prev
;
173 val_t
genericity___MMLocalClass___get_type(val_t self
) {
174 struct trace_t trace
= {NULL
, NULL
, 80, LOCATE_genericity___MMLocalClass___get_type
};
177 trace
.prev
= tracehead
; tracehead
= &trace
;
178 trace
.file
= LOCATE_genericity
;
179 variable0
= ATTR_static_type___MMLocalClass____base_type_cache( self
) /*MMLocalClass::_base_type_cache*/;
180 variable0
= TAG_Bool((variable0
== NIT_NULL
/*null*/) || ((variable0
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable0
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable0
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable0
,COLOR_kernel___Object_____eqeq
))(variable0
, NIT_NULL
/*null*/) /*Object::==*/)))));
181 variable1
= variable0
;
182 if (UNTAG_Bool(variable1
)) { /* and */
183 variable1
= ((genericity___MMLocalClass___is_generic_t
)CALL( self
,COLOR_genericity___MMLocalClass___is_generic
))( self
) /*MMLocalClass::is_generic*/;
185 variable0
= variable1
;
186 if (UNTAG_Bool(variable0
)) { /*if*/
187 variable0
= ((genericity___MMLocalClass___formals_types_t
)CALL( self
,COLOR_genericity___MMLocalClass___formals_types
))( self
) /*MMLocalClass::formals_types*/;
188 variable0
= ((genericity___MMLocalClass___get_instantiate_type_t
)CALL( self
,COLOR_genericity___MMLocalClass___get_instantiate_type
))( self
, variable0
) /*MMLocalClass::get_instantiate_type*/;
189 ATTR_static_type___MMLocalClass____base_type_cache( self
) /*MMLocalClass::_base_type_cache*/ = variable0
;
190 variable0
= ATTR_static_type___MMLocalClass____base_type_cache( self
) /*MMLocalClass::_base_type_cache*/;
193 variable0
= ((genericity___MMLocalClass___get_type_t
)CALL( self
,COLOR_SUPER_genericity___MMLocalClass___get_type
))( self
) /*super MMLocalClass::get_type*/;
196 return_label9
: while(false);
197 tracehead
= trace
.prev
;
200 val_t
genericity___MMLocalClass___is_generic(val_t self
) {
201 struct trace_t trace
= {NULL
, NULL
, 90, LOCATE_genericity___MMLocalClass___is_generic
};
203 trace
.prev
= tracehead
; tracehead
= &trace
;
204 trace
.file
= LOCATE_genericity
;
205 variable0
= ((abstractmetamodel___MMLocalClass___arity_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass___arity
))( self
) /*MMLocalClass::arity*/;
206 variable0
= TAG_Bool(UNTAG_Int(variable0
)>UNTAG_Int( TAG_Int(0)));
208 return_label10
: while(false);
209 tracehead
= trace
.prev
;
212 val_t
genericity___MMType___is_generic(val_t self
) {
213 struct trace_t trace
= {NULL
, NULL
, 95, LOCATE_genericity___MMType___is_generic
};
214 trace
.prev
= tracehead
; tracehead
= &trace
;
215 trace
.file
= LOCATE_genericity
;
216 fprintf(stderr
, "Deferred method %s called");
217 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMLocalClass___is_generic
, LOCATE_genericity
, 95);
219 tracehead
= trace
.prev
;
222 val_t
genericity___MMTypeFormal___is_generic(val_t self
) {
223 struct trace_t trace
= {NULL
, NULL
, 100, LOCATE_genericity___MMTypeFormal___is_generic
};
225 trace
.prev
= tracehead
; tracehead
= &trace
;
226 trace
.file
= LOCATE_genericity
;
227 variable0
= ATTR_type_formal___MMTypeFormal____bound( self
) /*MMTypeFormal::_bound*/;
228 variable0
= ((genericity___MMType___is_generic_t
)CALL(variable0
,COLOR_genericity___MMType___is_generic
))(variable0
) /*MMType::is_generic*/;
230 return_label11
: while(false);
231 tracehead
= trace
.prev
;
234 val_t
genericity___MMTypeSimpleClass___is_generic(val_t self
) {
235 struct trace_t trace
= {NULL
, NULL
, 104, LOCATE_genericity___MMTypeSimpleClass___is_generic
};
237 trace
.prev
= tracehead
; tracehead
= &trace
;
238 trace
.file
= LOCATE_genericity
;
239 variable0
= TAG_Bool(false);
241 return_label12
: while(false);
242 tracehead
= trace
.prev
;
245 val_t
genericity___MMTypeGeneric___params(val_t self
) {
246 struct trace_t trace
= {NULL
, NULL
, 109, LOCATE_genericity___MMTypeGeneric___params
};
247 trace
.prev
= tracehead
; tracehead
= &trace
;
248 trace
.file
= LOCATE_genericity
;
249 tracehead
= trace
.prev
;
250 return ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
252 val_t
genericity___MMTypeGeneric___is_generic(val_t self
) {
253 struct trace_t trace
= {NULL
, NULL
, 112, LOCATE_genericity___MMTypeGeneric___is_generic
};
255 trace
.prev
= tracehead
; tracehead
= &trace
;
256 trace
.file
= LOCATE_genericity
;
257 variable0
= TAG_Bool(true);
259 return_label13
: while(false);
260 tracehead
= trace
.prev
;
263 val_t
genericity___MMTypeGeneric___is_supertype(val_t self
, val_t param0
) {
264 struct trace_t trace
= {NULL
, NULL
, 114, LOCATE_genericity___MMTypeGeneric___is_supertype
};
268 trace
.prev
= tracehead
; tracehead
= &trace
;
269 trace
.file
= LOCATE_genericity
;
271 variable1
= ((static_type___MMType___local_class_t
)CALL( variable0
/*t*/,COLOR_static_type___MMType___local_class
))( variable0
/*t*/) /*MMType::local_class*/;
272 variable1
= ((abstractmetamodel___MMLocalClass___cshe_t
)CALL(variable1
,COLOR_abstractmetamodel___MMLocalClass___cshe
))(variable1
) /*MMLocalClass::cshe*/;
273 variable2
= ATTR_static_type___MMTypeClass____local_class( self
) /*MMTypeClass::_local_class*/;
274 variable1
= ((partial_order___PartialOrderElement_____leq_t
)CALL(variable1
,COLOR_partial_order___PartialOrderElement_____leq
))(variable1
, variable2
) /*PartialOrderElement::<=*/;
275 if (UNTAG_Bool(variable1
)) { /*if*/
276 variable2
= ATTR_static_type___MMTypeClass____local_class( self
) /*MMTypeClass::_local_class*/;
277 variable2
= ((static_type___MMType___upcast_for_t
)CALL( variable0
/*t*/,COLOR_static_type___MMType___upcast_for
))( variable0
/*t*/, variable2
) /*MMType::upcast_for*/;
278 variable1
= variable2
;
279 variable2
= TAG_Bool(( variable1
/*u*/==NIT_NULL
) || VAL_ISA( variable1
/*u*/, COLOR_MMTypeGeneric
, ID_MMTypeGeneric
)) /*cast MMTypeGeneric*/;
280 if (UNTAG_Bool(variable2
)) { /*if*/
281 variable2
= ((genericity___MMTypeGeneric___is_subtype_t
)CALL( self
,COLOR_genericity___MMTypeGeneric___is_subtype
))( self
, variable1
/*u*/) /*MMTypeGeneric::is_subtype*/;
282 variable1
= variable2
;
286 variable1
= TAG_Bool(false);
288 return_label14
: while(false);
289 tracehead
= trace
.prev
;
292 val_t
genericity___MMTypeGeneric___upcast_for(val_t self
, val_t param0
) {
293 struct trace_t trace
= {NULL
, NULL
, 125, LOCATE_genericity___MMTypeGeneric___upcast_for
};
297 trace
.prev
= tracehead
; tracehead
= &trace
;
298 trace
.file
= LOCATE_genericity
;
300 variable2
= ((genericity___MMTypeGeneric___upcast_for_t
)CALL( self
,COLOR_SUPER_genericity___MMTypeGeneric___upcast_for
))( self
, param0
) /*super MMTypeGeneric::upcast_for*/;
301 variable1
= variable2
;
302 variable2
= TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable1
/*t*/ == self
) || (( variable1
/*t*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable1
/*t*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable1
/*t*/, self
)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable1
/*t*/,COLOR_kernel___Object_____eqeq
))( variable1
/*t*/, self
) /*Object::==*/)))))));
303 if (UNTAG_Bool(variable2
)) { /*if*/
304 variable2
= ((static_type___MMType___adapt_to_t
)CALL( variable1
/*t*/,COLOR_static_type___MMType___adapt_to
))( variable1
/*t*/, self
) /*MMType::adapt_to*/;
305 variable1
= variable2
/*t=*/;
307 variable1
= variable1
/*t*/;
309 return_label15
: while(false);
310 tracehead
= trace
.prev
;
313 val_t
genericity___MMTypeGeneric___for_module(val_t self
, val_t param0
) {
314 struct trace_t trace
= {NULL
, NULL
, 134, LOCATE_genericity___MMTypeGeneric___for_module
};
321 trace
.prev
= tracehead
; tracehead
= &trace
;
322 trace
.file
= LOCATE_genericity
;
325 variable2
= ((static_type___MMTypeClass___module_t
)CALL( self
,COLOR_static_type___MMType___module
))( self
) /*MMTypeClass::module*/;
326 variable2
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable2
== variable0
/*mod*/) || ((variable2
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable2
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable2
, variable0
/*mod*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable2
,COLOR_kernel___Object_____eqeq
))(variable2
, variable0
/*mod*/) /*Object::==*/)))))));
327 if (UNTAG_Bool(variable2
)) { /*if*/
328 variable3
= NEW_array___Array___init(); /*new Array[E]*/
329 variable2
= variable3
;
330 variable3
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
331 variable3
= ((array___AbstractArray___iterator_t
)CALL(variable3
,COLOR_abstract_collection___Collection___iterator
))(variable3
) /*AbstractArray::iterator*/;
332 while (true) { /*for*/
333 variable4
= ((array___ArrayIterator___is_ok_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___is_ok
))(variable3
) /*ArrayIterator::is_ok*/;
334 if (!UNTAG_Bool(variable4
)) break; /*for*/
335 variable4
= ((array___ArrayIterator___item_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___item
))(variable3
) /*ArrayIterator::item*/;
336 variable5
= ((static_type___MMType___for_module_t
)CALL( variable4
/*p*/,COLOR_static_type___MMType___for_module
))( variable4
/*p*/, variable0
/*mod*/) /*MMType::for_module*/;
337 ((array___AbstractArray___add_t
)CALL( variable2
/*parms*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*parms*/, variable5
) /*AbstractArray::add*/;
338 continue_17
: while(0);
339 ((array___ArrayIterator___next_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___next
))(variable3
) /*ArrayIterator::next*/;
342 variable4
= ATTR_static_type___MMTypeClass____local_class( self
) /*MMTypeClass::_local_class*/;
343 variable4
= ((abstractmetamodel___MMLocalClass___for_module_t
)CALL(variable4
,COLOR_abstractmetamodel___MMLocalClass___for_module
))(variable4
, variable0
/*mod*/) /*MMLocalClass::for_module*/;
344 variable3
= variable4
;
345 variable4
= ((genericity___MMLocalClass___get_instantiate_type_t
)CALL( variable3
/*b*/,COLOR_genericity___MMLocalClass___get_instantiate_type
))( variable3
/*b*/, variable2
/*parms*/) /*MMLocalClass::get_instantiate_type*/;
346 variable1
= variable4
/*t=*/;
348 variable2
= TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable1
/*t*/ == NIT_NULL
/*null*/) || (( variable1
/*t*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable1
/*t*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable1
/*t*/, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable1
/*t*/,COLOR_kernel___Object_____eqeq
))( variable1
/*t*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
349 if (!UNTAG_Bool(variable2
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeGeneric___for_module
, LOCATE_genericity
, 145); nit_exit(1);}
350 variable1
= variable1
/*t*/;
352 return_label16
: while(false);
353 tracehead
= trace
.prev
;
356 val_t
genericity___MMTypeGeneric___adapt_to(val_t self
, val_t param0
) {
357 struct trace_t trace
= {NULL
, NULL
, 149, LOCATE_genericity___MMTypeGeneric___adapt_to
};
363 trace
.prev
= tracehead
; tracehead
= &trace
;
364 trace
.file
= LOCATE_genericity
;
366 variable2
= NEW_array___Array___init(); /*new Array[E]*/
367 variable1
= variable2
;
368 variable2
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
369 variable2
= ((array___AbstractArray___iterator_t
)CALL(variable2
,COLOR_abstract_collection___Collection___iterator
))(variable2
) /*AbstractArray::iterator*/;
370 while (true) { /*for*/
371 variable3
= ((array___ArrayIterator___is_ok_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___is_ok
))(variable2
) /*ArrayIterator::is_ok*/;
372 if (!UNTAG_Bool(variable3
)) break; /*for*/
373 variable3
= ((array___ArrayIterator___item_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___item
))(variable2
) /*ArrayIterator::item*/;
374 variable4
= ((static_type___MMType___adapt_to_t
)CALL( variable3
/*i*/,COLOR_static_type___MMType___adapt_to
))( variable3
/*i*/, variable0
/*r*/) /*MMType::adapt_to*/;
375 ((array___AbstractArray___add_t
)CALL( variable1
/*rv*/,COLOR_abstract_collection___SimpleCollection___add
))( variable1
/*rv*/, variable4
) /*AbstractArray::add*/;
376 continue_19
: while(0);
377 ((array___ArrayIterator___next_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___next
))(variable2
) /*ArrayIterator::next*/;
380 variable3
= ATTR_static_type___MMTypeClass____local_class( self
) /*MMTypeClass::_local_class*/;
381 variable3
= ((genericity___MMLocalClass___get_instantiate_type_t
)CALL(variable3
,COLOR_genericity___MMLocalClass___get_instantiate_type
))(variable3
, variable1
/*rv*/) /*MMLocalClass::get_instantiate_type*/;
382 variable2
= variable3
;
383 variable1
= variable2
/*l*/;
385 return_label18
: while(false);
386 tracehead
= trace
.prev
;
389 val_t
genericity___MMTypeGeneric___params_equals(val_t self
, val_t param0
) {
390 struct trace_t trace
= {NULL
, NULL
, 159, LOCATE_genericity___MMTypeGeneric___params_equals
};
398 trace
.prev
= tracehead
; tracehead
= &trace
;
399 trace
.file
= LOCATE_genericity
;
401 variable1
= ((array___AbstractArray___length_t
)CALL( variable0
/*t*/,COLOR_abstract_collection___Collection___length
))( variable0
/*t*/) /*AbstractArray::length*/;
402 variable2
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
403 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*AbstractArray::length*/;
404 variable1
= TAG_Bool((variable1
)!=(variable2
));
405 if (UNTAG_Bool(variable1
)) { /*if*/
406 variable1
= TAG_Bool(false);
409 variable1
= ((array___AbstractArray___length_t
)CALL( variable0
/*t*/,COLOR_abstract_collection___Collection___length
))( variable0
/*t*/) /*AbstractArray::length*/;
410 variable2
= NEW_range___Range___without_last( TAG_Int(0), variable1
); /*new Range[E]*/
411 variable1
= variable2
;
412 variable1
= ((range___Range___iterator_t
)CALL(variable1
,COLOR_abstract_collection___Collection___iterator
))(variable1
) /*Range::iterator*/;
413 while (true) { /*for*/
414 variable2
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___is_ok
))(variable1
) /*Iterator::is_ok*/;
415 if (!UNTAG_Bool(variable2
)) break; /*for*/
416 variable2
= ((abstract_collection___Iterator___item_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___item
))(variable1
) /*Iterator::item*/;
417 variable3
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
418 variable4
= variable2
/*i*/;
419 variable5
= TAG_Bool(UNTAG_Int( variable4
/*index*/)>=UNTAG_Int( TAG_Int(0)));
420 variable6
= variable5
;
421 if (UNTAG_Bool(variable6
)) { /* and */
422 variable6
= variable3
;
423 variable6
= ATTR_array___AbstractArray____length(variable6
) /*AbstractArray::_length*/;
424 variable6
= TAG_Bool(UNTAG_Int( variable4
/*index*/)<UNTAG_Int(variable6
));
426 variable5
= variable6
;
427 if (!UNTAG_Bool(variable5
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
428 variable5
= variable3
;
429 variable5
= ATTR_array___Array____items(variable5
) /*Array::_items*/;
430 variable5
= UNBOX_NativeArray(variable5
)[UNTAG_Int( variable4
/*index*/)];
432 return_label22
: while(false);
433 variable3
= variable5
;
434 variable3
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable3
== NIT_NULL
/*null*/) || ((variable3
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable3
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable3
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable3
,COLOR_kernel___Object_____eqeq
))(variable3
, NIT_NULL
/*null*/) /*Object::==*/)))))));
435 if (!UNTAG_Bool(variable3
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 165); nit_exit(1);}
436 variable3
= variable2
/*i*/;
437 variable4
= TAG_Bool(UNTAG_Int( variable3
/*index*/)>=UNTAG_Int( TAG_Int(0)));
438 variable5
= variable4
;
439 if (UNTAG_Bool(variable5
)) { /* and */
440 variable5
= ATTR_array___AbstractArray____length( variable0
/*t*/) /*AbstractArray::_length*/;
441 variable5
= TAG_Bool(UNTAG_Int( variable3
/*index*/)<UNTAG_Int(variable5
));
443 variable4
= variable5
;
444 if (!UNTAG_Bool(variable4
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
445 variable4
= ATTR_array___Array____items( variable0
/*t*/) /*Array::_items*/;
446 variable4
= UNBOX_NativeArray(variable4
)[UNTAG_Int( variable3
/*index*/)];
448 return_label23
: while(false);
449 variable3
= variable4
;
450 variable3
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable3
== NIT_NULL
/*null*/) || ((variable3
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable3
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable3
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable3
,COLOR_kernel___Object_____eqeq
))(variable3
, NIT_NULL
/*null*/) /*Object::==*/)))))));
451 if (!UNTAG_Bool(variable3
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 166); nit_exit(1);}
452 variable3
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
453 variable4
= variable2
/*i*/;
454 variable5
= TAG_Bool(UNTAG_Int( variable4
/*index*/)>=UNTAG_Int( TAG_Int(0)));
455 variable6
= variable5
;
456 if (UNTAG_Bool(variable6
)) { /* and */
457 variable6
= variable3
;
458 variable6
= ATTR_array___AbstractArray____length(variable6
) /*AbstractArray::_length*/;
459 variable6
= TAG_Bool(UNTAG_Int( variable4
/*index*/)<UNTAG_Int(variable6
));
461 variable5
= variable6
;
462 if (!UNTAG_Bool(variable5
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
463 variable5
= variable3
;
464 variable5
= ATTR_array___Array____items(variable5
) /*Array::_items*/;
465 variable5
= UNBOX_NativeArray(variable5
)[UNTAG_Int( variable4
/*index*/)];
467 return_label24
: while(false);
468 variable3
= variable5
;
469 variable4
= variable2
/*i*/;
470 variable5
= TAG_Bool(UNTAG_Int( variable4
/*index*/)>=UNTAG_Int( TAG_Int(0)));
471 variable6
= variable5
;
472 if (UNTAG_Bool(variable6
)) { /* and */
473 variable6
= ATTR_array___AbstractArray____length( variable0
/*t*/) /*AbstractArray::_length*/;
474 variable6
= TAG_Bool(UNTAG_Int( variable4
/*index*/)<UNTAG_Int(variable6
));
476 variable5
= variable6
;
477 if (!UNTAG_Bool(variable5
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
478 variable5
= ATTR_array___Array____items( variable0
/*t*/) /*Array::_items*/;
479 variable5
= UNBOX_NativeArray(variable5
)[UNTAG_Int( variable4
/*index*/)];
481 return_label25
: while(false);
482 variable4
= variable5
;
483 variable3
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable3
== variable4
) || ((variable3
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable3
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable3
,variable4
)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable3
,COLOR_kernel___Object_____eqeq
))(variable3
, variable4
) /*Object::==*/)))))));
484 if (UNTAG_Bool(variable3
)) { /*if*/
485 variable1
= TAG_Bool(false);
488 continue_21
: while(0);
489 ((abstract_collection___Iterator___next_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___next
))(variable1
) /*Iterator::next*/;
492 variable1
= TAG_Bool(true);
494 return_label20
: while(false);
495 tracehead
= trace
.prev
;
498 val_t
genericity___MMTypeGeneric___to_s(val_t self
) {
499 struct trace_t trace
= {NULL
, NULL
, 174, LOCATE_genericity___MMTypeGeneric___to_s
};
511 trace
.prev
= tracehead
; tracehead
= &trace
;
512 trace
.file
= LOCATE_genericity
;
513 variable0
= NEW_string___String___init(); /*new String*/
514 variable1
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
515 variable2
= variable1
;
516 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable2
) /*String::append*/;
517 variable3
= ((genericity___MMTypeGeneric___to_s_t
)CALL( self
,COLOR_SUPER_genericity___MMTypeGeneric___to_s
))( self
) /*super MMTypeGeneric::to_s*/;
518 variable4
= variable3
;
519 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable4
) /*String::append*/;
520 variable5
= NEW_string___String___with_native(BOX_NativeString("["), TAG_Int(1)); /*new String*/
521 variable6
= variable5
;
522 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable6
) /*String::append*/;
523 variable7
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
524 variable8
= NEW_string___String___with_native(BOX_NativeString(", "), TAG_Int(2)); /*new String*/
525 variable7
= ((string___Collection___join_t
)CALL(variable7
,COLOR_string___Collection___join
))(variable7
, variable8
) /*Collection::join*/;
526 variable8
= variable7
;
527 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable8
) /*String::append*/;
528 variable9
= NEW_string___String___with_native(BOX_NativeString("]"), TAG_Int(1)); /*new String*/
529 variable10
= variable9
;
530 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable10
) /*String::append*/;
532 return_label26
: while(false);
533 tracehead
= trace
.prev
;
536 val_t
genericity___MMTypeGeneric___is_subtype(val_t self
, val_t param0
) {
537 struct trace_t trace
= {NULL
, NULL
, 179, LOCATE_genericity___MMTypeGeneric___is_subtype
};
546 trace
.prev
= tracehead
; tracehead
= &trace
;
547 trace
.file
= LOCATE_genericity
;
549 variable1
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
550 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*AbstractArray::length*/;
551 variable2
= NEW_range___Range___without_last( TAG_Int(0), variable1
); /*new Range[E]*/
552 variable1
= variable2
;
553 variable1
= ((range___Range___iterator_t
)CALL(variable1
,COLOR_abstract_collection___Collection___iterator
))(variable1
) /*Range::iterator*/;
554 while (true) { /*for*/
555 variable2
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___is_ok
))(variable1
) /*Iterator::is_ok*/;
556 if (!UNTAG_Bool(variable2
)) break; /*for*/
557 variable2
= ((abstract_collection___Iterator___item_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___item
))(variable1
) /*Iterator::item*/;
558 variable3
= ((genericity___MMTypeGeneric___params_t
)CALL( variable0
/*t*/,COLOR_genericity___MMTypeGeneric___params
))( variable0
/*t*/) /*MMTypeGeneric::params*/;
559 variable4
= variable2
/*i*/;
560 variable5
= TAG_Bool(UNTAG_Int( variable4
/*index*/)>=UNTAG_Int( TAG_Int(0)));
561 variable6
= variable5
;
562 if (UNTAG_Bool(variable6
)) { /* and */
563 variable6
= variable3
;
564 variable6
= ATTR_array___AbstractArray____length(variable6
) /*AbstractArray::_length*/;
565 variable6
= TAG_Bool(UNTAG_Int( variable4
/*index*/)<UNTAG_Int(variable6
));
567 variable5
= variable6
;
568 if (!UNTAG_Bool(variable5
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
569 variable5
= variable3
;
570 variable5
= ATTR_array___Array____items(variable5
) /*Array::_items*/;
571 variable5
= UNBOX_NativeArray(variable5
)[UNTAG_Int( variable4
/*index*/)];
573 return_label29
: while(false);
574 variable3
= variable5
;
575 variable4
= ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/;
576 variable5
= variable2
/*i*/;
577 variable6
= TAG_Bool(UNTAG_Int( variable5
/*index*/)>=UNTAG_Int( TAG_Int(0)));
578 variable7
= variable6
;
579 if (UNTAG_Bool(variable7
)) { /* and */
580 variable7
= variable4
;
581 variable7
= ATTR_array___AbstractArray____length(variable7
) /*AbstractArray::_length*/;
582 variable7
= TAG_Bool(UNTAG_Int( variable5
/*index*/)<UNTAG_Int(variable7
));
584 variable6
= variable7
;
585 if (!UNTAG_Bool(variable6
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
586 variable6
= variable4
;
587 variable6
= ATTR_array___Array____items(variable6
) /*Array::_items*/;
588 variable6
= UNBOX_NativeArray(variable6
)[UNTAG_Int( variable5
/*index*/)];
590 return_label30
: while(false);
591 variable4
= variable6
;
592 variable3
= ((static_type___MMType_____l_t
)CALL(variable3
,COLOR_static_type___MMType_____l
))(variable3
, variable4
) /*MMType::<*/;
593 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable3
)))) { /*if*/
594 variable1
= TAG_Bool(false);
597 continue_28
: while(0);
598 ((abstract_collection___Iterator___next_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___next
))(variable1
) /*Iterator::next*/;
601 variable1
= TAG_Bool(true);
603 return_label27
: while(false);
604 tracehead
= trace
.prev
;
607 void genericity___MMTypeGeneric___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
608 struct trace_t trace
= {NULL
, NULL
, 192, LOCATE_genericity___MMTypeGeneric___init
};
611 trace
.prev
= tracehead
; tracehead
= &trace
;
612 trace
.file
= LOCATE_genericity
;
615 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMTypeGeneric
].i
]) return;
616 ((static_type___MMTypeClass___init_t
)CALL( self
,COLOR_static_type___MMTypeClass___init
))( self
, variable0
/*c*/, init_table
/*YYY*/) /*MMTypeClass::init*/;
617 ATTR_genericity___MMTypeGeneric____params( self
) /*MMTypeGeneric::_params*/ = variable1
/*p*/;
618 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMTypeGeneric
].i
] = 1;
619 tracehead
= trace
.prev
;
622 val_t
genericity___MMTypeFormalParameter___def_class(val_t self
) {
623 struct trace_t trace
= {NULL
, NULL
, 201, LOCATE_genericity___MMTypeFormalParameter___def_class
};
624 trace
.prev
= tracehead
; tracehead
= &trace
;
625 trace
.file
= LOCATE_genericity
;
626 tracehead
= trace
.prev
;
627 return ATTR_genericity___MMTypeFormalParameter____def_class( self
) /*MMTypeFormalParameter::_def_class*/;
629 val_t
genericity___MMTypeFormalParameter___position(val_t self
) {
630 struct trace_t trace
= {NULL
, NULL
, 204, LOCATE_genericity___MMTypeFormalParameter___position
};
631 trace
.prev
= tracehead
; tracehead
= &trace
;
632 trace
.file
= LOCATE_genericity
;
633 tracehead
= trace
.prev
;
634 return ATTR_genericity___MMTypeFormalParameter____position( self
) /*MMTypeFormalParameter::_position*/;
636 val_t
genericity___MMTypeFormalParameter___module(val_t self
) {
637 struct trace_t trace
= {NULL
, NULL
, 207, LOCATE_genericity___MMTypeFormalParameter___module
};
639 trace
.prev
= tracehead
; tracehead
= &trace
;
640 trace
.file
= LOCATE_genericity
;
641 variable0
= ATTR_genericity___MMTypeFormalParameter____def_class( self
) /*MMTypeFormalParameter::_def_class*/;
642 variable0
= ((abstractmetamodel___MMLocalClass___module_t
)CALL(variable0
,COLOR_abstractmetamodel___MMLocalClass___module
))(variable0
) /*MMLocalClass::module*/;
644 return_label32
: while(false);
645 tracehead
= trace
.prev
;
648 val_t
genericity___MMTypeFormalParameter___for_module(val_t self
, val_t param0
) {
649 struct trace_t trace
= {NULL
, NULL
, 209, LOCATE_genericity___MMTypeFormalParameter___for_module
};
654 trace
.prev
= tracehead
; tracehead
= &trace
;
655 trace
.file
= LOCATE_genericity
;
658 variable2
= ((genericity___MMTypeFormalParameter___module_t
)CALL( self
,COLOR_static_type___MMType___module
))( self
) /*MMTypeFormalParameter::module*/;
659 variable2
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable2
== variable0
/*mod*/) || ((variable2
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable2
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable2
, variable0
/*mod*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable2
,COLOR_kernel___Object_____eqeq
))(variable2
, variable0
/*mod*/) /*Object::==*/)))))));
660 if (UNTAG_Bool(variable2
)) { /*if*/
661 variable2
= ATTR_genericity___MMTypeFormalParameter____def_class( self
) /*MMTypeFormalParameter::_def_class*/;
662 variable2
= ((abstractmetamodel___MMLocalClass___global_t
)CALL(variable2
,COLOR_abstractmetamodel___MMLocalClass___global
))(variable2
) /*MMLocalClass::global*/;
663 variable2
= ((abstractmetamodel___MMModule_____bra_t
)CALL( variable0
/*mod*/,COLOR_abstractmetamodel___MMModule_____bra
))( variable0
/*mod*/, variable2
) /*MMModule::[]*/;
664 variable3
= ((genericity___MMTypeFormalParameter___position_t
)CALL( self
,COLOR_genericity___MMTypeFormalParameter___position
))( self
) /*MMTypeFormalParameter::position*/;
665 variable2
= ((genericity___MMLocalClass___get_formal_t
)CALL(variable2
,COLOR_genericity___MMLocalClass___get_formal
))(variable2
, variable3
) /*MMLocalClass::get_formal*/;
666 variable1
= variable2
/*t=*/;
668 variable2
= TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable1
/*t*/ == NIT_NULL
/*null*/) || (( variable1
/*t*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable1
/*t*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable1
/*t*/, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable1
/*t*/,COLOR_kernel___Object_____eqeq
))( variable1
/*t*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
669 if (!UNTAG_Bool(variable2
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___for_module
, LOCATE_genericity
, 215); nit_exit(1);}
670 variable1
= variable1
/*t*/;
672 return_label33
: while(false);
673 tracehead
= trace
.prev
;
676 val_t
genericity___MMTypeFormalParameter___upcast_for(val_t self
, val_t param0
) {
677 struct trace_t trace
= {NULL
, NULL
, 219, LOCATE_genericity___MMTypeFormalParameter___upcast_for
};
680 trace
.prev
= tracehead
; tracehead
= &trace
;
681 trace
.file
= LOCATE_genericity
;
685 return_label34
: while(false);
686 tracehead
= trace
.prev
;
689 void genericity___MMTypeFormalParameter___bound__eq(val_t self
, val_t param0
) {
690 struct trace_t trace
= {NULL
, NULL
, 221, LOCATE_genericity___MMTypeFormalParameter___bound__eq
};
693 trace
.prev
= tracehead
; tracehead
= &trace
;
694 trace
.file
= LOCATE_genericity
;
696 variable1
= ATTR_type_formal___MMTypeFormal____bound( self
) /*MMTypeFormal::_bound*/;
697 variable1
= TAG_Bool((variable1
== NIT_NULL
/*null*/) || ((variable1
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable1
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable1
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable1
,COLOR_kernel___Object_____eqeq
))(variable1
, NIT_NULL
/*null*/) /*Object::==*/)))));
698 if (!UNTAG_Bool(variable1
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___bound__eq
, LOCATE_genericity
, 223); nit_exit(1);}
699 ATTR_type_formal___MMTypeFormal____bound( self
) /*MMTypeFormal::_bound*/ = variable0
/*t*/;
700 tracehead
= trace
.prev
;
703 val_t
genericity___MMTypeFormalParameter___adapt_to(val_t self
, val_t param0
) {
704 struct trace_t trace
= {NULL
, NULL
, 227, LOCATE_genericity___MMTypeFormalParameter___adapt_to
};
713 trace
.prev
= tracehead
; tracehead
= &trace
;
714 trace
.file
= LOCATE_genericity
;
716 variable1
= ((type_formal___MMType___direct_type_t
)CALL( variable0
/*r*/,COLOR_type_formal___MMType___direct_type
))( variable0
/*r*/) /*MMType::direct_type*/;
717 variable0
= variable1
/*r=*/;
718 variable2
= ((genericity___MMTypeFormalParameter___def_class_t
)CALL( self
,COLOR_genericity___MMTypeFormalParameter___def_class
))( self
) /*MMTypeFormalParameter::def_class*/;
719 variable2
= ((static_type___MMType___upcast_for_t
)CALL( variable0
/*r*/,COLOR_static_type___MMType___upcast_for
))( variable0
/*r*/, variable2
) /*MMType::upcast_for*/;
720 variable1
= variable2
;
721 variable2
= TAG_Bool(( variable1
/*old_r*/==NIT_NULL
) || VAL_ISA( variable1
/*old_r*/, COLOR_MMTypeGeneric
, ID_MMTypeGeneric
)) /*cast MMTypeGeneric*/;
722 if (!UNTAG_Bool(variable2
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___adapt_to
, LOCATE_genericity
, 235); nit_exit(1);}
723 variable3
= ((genericity___MMTypeGeneric___params_t
)CALL( variable1
/*old_r*/,COLOR_genericity___MMTypeGeneric___params
))( variable1
/*old_r*/) /*MMTypeGeneric::params*/;
724 variable4
= ((genericity___MMTypeFormalParameter___position_t
)CALL( self
,COLOR_genericity___MMTypeFormalParameter___position
))( self
) /*MMTypeFormalParameter::position*/;
725 variable5
= variable4
;
726 variable6
= TAG_Bool(UNTAG_Int( variable5
/*index*/)>=UNTAG_Int( TAG_Int(0)));
727 variable7
= variable6
;
728 if (UNTAG_Bool(variable7
)) { /* and */
729 variable7
= variable3
;
730 variable7
= ATTR_array___AbstractArray____length(variable7
) /*AbstractArray::_length*/;
731 variable7
= TAG_Bool(UNTAG_Int( variable5
/*index*/)<UNTAG_Int(variable7
));
733 variable6
= variable7
;
734 if (!UNTAG_Bool(variable6
)) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 229); nit_exit(1);}
735 variable6
= variable3
;
736 variable6
= ATTR_array___Array____items(variable6
) /*Array::_items*/;
737 variable6
= UNBOX_NativeArray(variable6
)[UNTAG_Int( variable5
/*index*/)];
739 return_label37
: while(false);
740 variable3
= variable6
;
741 variable2
= variable3
;
742 variable3
= TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable2
/*reduct*/ == NIT_NULL
/*null*/) || (( variable2
/*reduct*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable2
/*reduct*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable2
/*reduct*/, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable2
/*reduct*/,COLOR_kernel___Object_____eqeq
))( variable2
/*reduct*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
743 if (!UNTAG_Bool(variable3
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_genericity
, 237); nit_exit(1);}
744 variable1
= variable2
/*reduct*/;
746 return_label36
: while(false);
747 tracehead
= trace
.prev
;
750 void genericity___MMTypeFormalParameter___with_bound(val_t self
, val_t param0
, val_t param1
, val_t param2
, val_t param3
, int* init_table
) {
751 struct trace_t trace
= {NULL
, NULL
, 241, LOCATE_genericity___MMTypeFormalParameter___with_bound
};
756 trace
.prev
= tracehead
; tracehead
= &trace
;
757 trace
.file
= LOCATE_genericity
;
762 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMTypeFormalParameter
].i
]) return;
763 ((genericity___MMTypeFormalParameter___init_t
)CALL( self
,COLOR_genericity___MMTypeFormalParameter___init
))( self
, variable0
/*n*/, variable1
/*p*/, variable2
/*intro*/, init_table
/*YYY*/) /*MMTypeFormalParameter::init*/;
764 ATTR_type_formal___MMTypeFormal____bound( self
) /*MMTypeFormal::_bound*/ = variable3
/*b*/;
765 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMTypeFormalParameter
].i
] = 1;
766 tracehead
= trace
.prev
;
769 void genericity___MMTypeFormalParameter___init(val_t self
, val_t param0
, val_t param1
, val_t param2
, int* init_table
) {
770 struct trace_t trace
= {NULL
, NULL
, 247, LOCATE_genericity___MMTypeFormalParameter___init
};
775 trace
.prev
= tracehead
; tracehead
= &trace
;
776 trace
.file
= LOCATE_genericity
;
780 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMTypeFormalParameter
].i
]) return;
781 variable3
= TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable0
/*n*/ == NIT_NULL
/*null*/) || (( variable0
/*n*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable0
/*n*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable0
/*n*/, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable0
/*n*/,COLOR_kernel___Object_____eqeq
))( variable0
/*n*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
782 if (!UNTAG_Bool(variable3
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___init
, LOCATE_genericity
, 249); nit_exit(1);}
783 ATTR_type_formal___MMTypeFormal____name( self
) /*MMTypeFormal::_name*/ = variable0
/*n*/;
784 ATTR_genericity___MMTypeFormalParameter____position( self
) /*MMTypeFormalParameter::_position*/ = variable1
/*p*/;
785 ATTR_genericity___MMTypeFormalParameter____def_class( self
) /*MMTypeFormalParameter::_def_class*/ = variable2
/*intro*/;
786 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMTypeFormalParameter
].i
] = 1;
787 tracehead
= trace
.prev
;
790 val_t
genericity___MMTypeNone___is_generic(val_t self
) {
791 struct trace_t trace
= {NULL
, NULL
, 257, LOCATE_genericity___MMTypeNone___is_generic
};
793 trace
.prev
= tracehead
; tracehead
= &trace
;
794 trace
.file
= LOCATE_genericity
;
795 variable0
= TAG_Bool(false);
797 return_label40
: while(false);
798 tracehead
= trace
.prev
;
801 val_t
genericity___MMTypeNone___for_module(val_t self
, val_t param0
) {
802 struct trace_t trace
= {NULL
, NULL
, 258, LOCATE_genericity___MMTypeNone___for_module
};
805 trace
.prev
= tracehead
; tracehead
= &trace
;
806 trace
.file
= LOCATE_genericity
;
810 return_label41
: while(false);
811 tracehead
= trace
.prev
;
814 val_t
genericity___MMTypeNone___adapt_to(val_t self
, val_t param0
) {
815 struct trace_t trace
= {NULL
, NULL
, 259, LOCATE_genericity___MMTypeNone___adapt_to
};
818 trace
.prev
= tracehead
; tracehead
= &trace
;
819 trace
.file
= LOCATE_genericity
;
823 return_label42
: while(false);
824 tracehead
= trace
.prev
;