Update c_src with new default constructor rules.
[nit.git] / c_src / genericity._sep.c
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};
5 val_t variable0;
6 val_t variable1;
7 val_t variable2;
8 val_t variable3;
9 val_t variable4;
10 trace.prev = tracehead; tracehead = &trace;
11 trace.file = LOCATE_genericity;
12 variable0 = param0;
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));
21 }
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*/)];
27 goto return_label1;
28 return_label1: while(false);
29 variable1 = variable3;
30 goto return_label0;
31 return_label0: while(false);
32 tracehead = trace.prev;
33 return variable1;
34 }
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};
37 val_t variable0;
38 val_t variable1;
39 val_t variable2;
40 trace.prev = tracehead; tracehead = &trace;
41 trace.file = LOCATE_genericity;
42 variable0 = param0;
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;
54 return;
55 }
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};
58 val_t variable0;
59 val_t variable1;
60 val_t variable2;
61 val_t variable3;
62 trace.prev = tracehead; tracehead = &trace;
63 trace.file = LOCATE_genericity;
64 variable0 = param0;
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*/;
74 goto return_label3;
75 }
76 continue_4: while(0);
77 ((array___ArrayIterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*ArrayIterator::next*/;
78 }
79 break_4: while(0);
80 variable2 = NEW_MMTypeGeneric_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*/;
85 goto return_label3;
86 return_label3: while(false);
87 tracehead = trace.prev;
88 return variable1;
89 }
90 val_t genericity___MMLocalClass___formals_types(val_t self) {
91 struct trace_t trace = {NULL, NULL, 57, LOCATE_genericity___MMLocalClass___formals_types};
92 val_t variable0;
93 val_t variable1;
94 val_t variable2;
95 val_t variable3;
96 val_t variable4;
97 val_t variable5;
98 val_t variable6;
99 val_t variable7;
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___Range___without_last( TAG_Int(0), variable0); /*new Range[Int]*/
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_MMTypeFormalParameter_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*/;
126 }
127 break_6: while(0);
128 variable0 = ((abstractmetamodel___MMLocalClass___arity_t)CALL( self,COLOR_abstractmetamodel___MMLocalClass___arity))( self) /*MMLocalClass::arity*/;
129 variable1 = NEW_Range_range___Range___without_last( TAG_Int(0), variable0); /*new Range[Int]*/
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));
148 }
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*/)];
154 goto return_label8;
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*/;
164 }
165 break_7: while(0);
166 }
167 variable0 = ATTR_genericity___MMLocalClass____formals_types( self) /*MMLocalClass::_formals_types*/;
168 goto return_label5;
169 return_label5: while(false);
170 tracehead = trace.prev;
171 return variable0;
172 }
173 val_t genericity___MMLocalClass___get_type(val_t self) {
174 struct trace_t trace = {NULL, NULL, 80, LOCATE_genericity___MMLocalClass___get_type};
175 val_t variable0;
176 val_t variable1;
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*/;
184 }
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*/;
191 goto return_label9;
192 } else { /*if*/
193 variable0 = ((genericity___MMLocalClass___get_type_t)CALL( self,COLOR_SUPER_genericity___MMLocalClass___get_type))( self) /*super MMLocalClass::get_type*/;
194 goto return_label9;
195 }
196 return_label9: while(false);
197 tracehead = trace.prev;
198 return variable0;
199 }
200 val_t genericity___MMLocalClass___is_generic(val_t self) {
201 struct trace_t trace = {NULL, NULL, 90, LOCATE_genericity___MMLocalClass___is_generic};
202 val_t variable0;
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)));
207 goto return_label10;
208 return_label10: while(false);
209 tracehead = trace.prev;
210 return variable0;
211 }
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);
218 nit_exit(1);
219 tracehead = trace.prev;
220 return NIT_NULL;
221 }
222 val_t genericity___MMTypeFormal___is_generic(val_t self) {
223 struct trace_t trace = {NULL, NULL, 100, LOCATE_genericity___MMTypeFormal___is_generic};
224 val_t variable0;
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*/;
229 goto return_label11;
230 return_label11: while(false);
231 tracehead = trace.prev;
232 return variable0;
233 }
234 val_t genericity___MMTypeSimpleClass___is_generic(val_t self) {
235 struct trace_t trace = {NULL, NULL, 104, LOCATE_genericity___MMTypeSimpleClass___is_generic};
236 val_t variable0;
237 trace.prev = tracehead; tracehead = &trace;
238 trace.file = LOCATE_genericity;
239 variable0 = TAG_Bool(false);
240 goto return_label12;
241 return_label12: while(false);
242 tracehead = trace.prev;
243 return variable0;
244 }
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*/;
251 }
252 val_t genericity___MMTypeGeneric___is_generic(val_t self) {
253 struct trace_t trace = {NULL, NULL, 112, LOCATE_genericity___MMTypeGeneric___is_generic};
254 val_t variable0;
255 trace.prev = tracehead; tracehead = &trace;
256 trace.file = LOCATE_genericity;
257 variable0 = TAG_Bool(true);
258 goto return_label13;
259 return_label13: while(false);
260 tracehead = trace.prev;
261 return variable0;
262 }
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};
265 val_t variable0;
266 val_t variable1;
267 val_t variable2;
268 trace.prev = tracehead; tracehead = &trace;
269 trace.file = LOCATE_genericity;
270 variable0 = param0;
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;
283 goto return_label14;
284 }
285 }
286 variable1 = TAG_Bool(false);
287 goto return_label14;
288 return_label14: while(false);
289 tracehead = trace.prev;
290 return variable1;
291 }
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};
294 val_t variable0;
295 val_t variable1;
296 val_t variable2;
297 trace.prev = tracehead; tracehead = &trace;
298 trace.file = LOCATE_genericity;
299 variable0 = param0;
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=*/;
306 }
307 variable1 = variable1 /*t*/;
308 goto return_label15;
309 return_label15: while(false);
310 tracehead = trace.prev;
311 return variable1;
312 }
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};
315 val_t variable0;
316 val_t variable1;
317 val_t variable2;
318 val_t variable3;
319 val_t variable4;
320 val_t variable5;
321 trace.prev = tracehead; tracehead = &trace;
322 trace.file = LOCATE_genericity;
323 variable0 = param0;
324 variable1 = self;
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___Array___init(); /*new Array[MMType]*/
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*/;
340 }
341 break_17: while(0);
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=*/;
347 }
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*/;
351 goto return_label16;
352 return_label16: while(false);
353 tracehead = trace.prev;
354 return variable1;
355 }
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};
358 val_t variable0;
359 val_t variable1;
360 val_t variable2;
361 val_t variable3;
362 val_t variable4;
363 trace.prev = tracehead; tracehead = &trace;
364 trace.file = LOCATE_genericity;
365 variable0 = param0;
366 variable2 = NEW_Array_array___Array___init(); /*new Array[MMType]*/
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*/;
378 }
379 break_19: while(0);
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*/;
384 goto return_label18;
385 return_label18: while(false);
386 tracehead = trace.prev;
387 return variable1;
388 }
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};
391 val_t variable0;
392 val_t variable1;
393 val_t variable2;
394 val_t variable3;
395 val_t variable4;
396 val_t variable5;
397 val_t variable6;
398 trace.prev = tracehead; tracehead = &trace;
399 trace.file = LOCATE_genericity;
400 variable0 = param0;
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);
407 goto return_label20;
408 }
409 variable1 = ((array___AbstractArray___length_t)CALL( variable0 /*t*/,COLOR_abstract_collection___Collection___length))( variable0 /*t*/) /*AbstractArray::length*/;
410 variable2 = NEW_Range_range___Range___without_last( TAG_Int(0), variable1); /*new Range[Int]*/
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));
425 }
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*/)];
431 goto return_label22;
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));
442 }
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*/)];
447 goto return_label23;
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));
460 }
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*/)];
466 goto return_label24;
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));
475 }
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*/)];
480 goto return_label25;
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);
486 goto return_label20;
487 }
488 continue_21: while(0);
489 ((abstract_collection___Iterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*Iterator::next*/;
490 }
491 break_21: while(0);
492 variable1 = TAG_Bool(true);
493 goto return_label20;
494 return_label20: while(false);
495 tracehead = trace.prev;
496 return variable1;
497 }
498 val_t genericity___MMTypeGeneric___to_s(val_t self) {
499 struct trace_t trace = {NULL, NULL, 174, LOCATE_genericity___MMTypeGeneric___to_s};
500 val_t variable0;
501 val_t variable1;
502 val_t variable2;
503 val_t variable3;
504 val_t variable4;
505 val_t variable5;
506 val_t variable6;
507 val_t variable7;
508 val_t variable8;
509 val_t variable9;
510 val_t variable10;
511 trace.prev = tracehead; tracehead = &trace;
512 trace.file = LOCATE_genericity;
513 variable0 = NEW_String_string___String___init(); /*new String*/
514 variable1 = NEW_String_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___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___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___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*/;
531 goto return_label26;
532 return_label26: while(false);
533 tracehead = trace.prev;
534 return variable0;
535 }
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};
538 val_t variable0;
539 val_t variable1;
540 val_t variable2;
541 val_t variable3;
542 val_t variable4;
543 val_t variable5;
544 val_t variable6;
545 val_t variable7;
546 trace.prev = tracehead; tracehead = &trace;
547 trace.file = LOCATE_genericity;
548 variable0 = param0;
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___Range___without_last( TAG_Int(0), variable1); /*new Range[Int]*/
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));
566 }
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*/)];
572 goto return_label29;
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));
583 }
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*/)];
589 goto return_label30;
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);
595 goto return_label27;
596 }
597 continue_28: while(0);
598 ((abstract_collection___Iterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*Iterator::next*/;
599 }
600 break_28: while(0);
601 variable1 = TAG_Bool(true);
602 goto return_label27;
603 return_label27: while(false);
604 tracehead = trace.prev;
605 return variable1;
606 }
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};
609 val_t variable0;
610 val_t variable1;
611 trace.prev = tracehead; tracehead = &trace;
612 trace.file = LOCATE_genericity;
613 variable0 = param0;
614 variable1 = param1;
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;
620 return;
621 }
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*/;
628 }
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*/;
635 }
636 val_t genericity___MMTypeFormalParameter___module(val_t self) {
637 struct trace_t trace = {NULL, NULL, 207, LOCATE_genericity___MMTypeFormalParameter___module};
638 val_t variable0;
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*/;
643 goto return_label32;
644 return_label32: while(false);
645 tracehead = trace.prev;
646 return variable0;
647 }
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};
650 val_t variable0;
651 val_t variable1;
652 val_t variable2;
653 val_t variable3;
654 trace.prev = tracehead; tracehead = &trace;
655 trace.file = LOCATE_genericity;
656 variable0 = param0;
657 variable1 = self;
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=*/;
667 }
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*/;
671 goto return_label33;
672 return_label33: while(false);
673 tracehead = trace.prev;
674 return variable1;
675 }
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};
678 val_t variable0;
679 val_t variable1;
680 trace.prev = tracehead; tracehead = &trace;
681 trace.file = LOCATE_genericity;
682 variable0 = param0;
683 variable1 = self;
684 goto return_label34;
685 return_label34: while(false);
686 tracehead = trace.prev;
687 return variable1;
688 }
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};
691 val_t variable0;
692 val_t variable1;
693 trace.prev = tracehead; tracehead = &trace;
694 trace.file = LOCATE_genericity;
695 variable0 = param0;
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;
701 return;
702 }
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};
705 val_t variable0;
706 val_t variable1;
707 val_t variable2;
708 val_t variable3;
709 val_t variable4;
710 val_t variable5;
711 val_t variable6;
712 val_t variable7;
713 trace.prev = tracehead; tracehead = &trace;
714 trace.file = LOCATE_genericity;
715 variable0 = param0;
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));
732 }
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*/)];
738 goto return_label37;
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*/;
745 goto return_label36;
746 return_label36: while(false);
747 tracehead = trace.prev;
748 return variable1;
749 }
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};
752 val_t variable0;
753 val_t variable1;
754 val_t variable2;
755 val_t variable3;
756 trace.prev = tracehead; tracehead = &trace;
757 trace.file = LOCATE_genericity;
758 variable0 = param0;
759 variable1 = param1;
760 variable2 = param2;
761 variable3 = param3;
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;
767 return;
768 }
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};
771 val_t variable0;
772 val_t variable1;
773 val_t variable2;
774 val_t variable3;
775 trace.prev = tracehead; tracehead = &trace;
776 trace.file = LOCATE_genericity;
777 variable0 = param0;
778 variable1 = param1;
779 variable2 = param2;
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;
788 return;
789 }
790 val_t genericity___MMTypeNone___is_generic(val_t self) {
791 struct trace_t trace = {NULL, NULL, 257, LOCATE_genericity___MMTypeNone___is_generic};
792 val_t variable0;
793 trace.prev = tracehead; tracehead = &trace;
794 trace.file = LOCATE_genericity;
795 variable0 = TAG_Bool(false);
796 goto return_label40;
797 return_label40: while(false);
798 tracehead = trace.prev;
799 return variable0;
800 }
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};
803 val_t variable0;
804 val_t variable1;
805 trace.prev = tracehead; tracehead = &trace;
806 trace.file = LOCATE_genericity;
807 variable0 = param0;
808 variable1 = self;
809 goto return_label41;
810 return_label41: while(false);
811 tracehead = trace.prev;
812 return variable1;
813 }
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};
816 val_t variable0;
817 val_t variable1;
818 trace.prev = tracehead; tracehead = &trace;
819 trace.file = LOCATE_genericity;
820 variable0 = param0;
821 variable1 = self;
822 goto return_label42;
823 return_label42: while(false);
824 tracehead = trace.prev;
825 return variable1;
826 }