1 /* This C file is generated by NIT to compile module virtualtype. */
2 #include "virtualtype._sep.h"
3 val_t
virtualtype___MMGlobalProperty___is_virtual_type(val_t self
) {
4 struct trace_t trace
= {NULL
, NULL
, 24, LOCATE_virtualtype___MMGlobalProperty___is_virtual_type
};
6 struct WBT_
**closurevariable
= NULL
;
7 trace
.prev
= tracehead
; tracehead
= &trace
;
8 trace
.file
= LOCATE_virtualtype
;
9 /* Register variable[0]: Local variable */
11 /* Register variable[1]: Method return value and escape marker */
12 /* Register variable[2]: Result */
13 variable
[2] = CALL_abstractmetamodel___MMGlobalProperty___intro(variable
[0])(variable
[0]) /*MMGlobalProperty::intro*/;
14 /* Register variable[2]: Result */
15 variable
[2] = TAG_Bool((variable
[2]==NIT_NULL
) || VAL_ISA(variable
[2], COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
16 variable
[1] = variable
[2];
18 return_label0
: while(false);
19 tracehead
= trace
.prev
;
22 val_t
virtualtype___MMTypeProperty___stype_for(val_t self
, val_t param0
) {
23 struct trace_t trace
= {NULL
, NULL
, 31, LOCATE_virtualtype___MMTypeProperty___stype_for
};
25 struct WBT_
**closurevariable
= NULL
;
26 trace
.prev
= tracehead
; tracehead
= &trace
;
27 trace
.file
= LOCATE_virtualtype
;
28 /* Register variable[0]: Local variable */
30 /* Register variable[1]: Local variable */
32 /* Register variable[2]: Method return value and escape marker */
33 /* Register variable[3]: Local variable */
34 /* Register variable[4]: Result */
35 variable
[4] = CALL_static_type___MMType___local_class( variable
[1] /*recv*/)( variable
[1] /*recv*/) /*MMType::local_class*/;
36 /* Register variable[5]: Result */
37 variable
[5] = CALL_abstractmetamodel___MMLocalProperty___global(variable
[0])(variable
[0]) /*MMLocalProperty::global*/;
38 /* Register variable[4]: Result */
39 variable
[4] = CALL_abstractmetamodel___MMLocalClass_____bra(variable
[4])(variable
[4], variable
[5]) /*MMLocalClass::[]*/;
40 variable
[3] = variable
[4];
41 /* Register variable[4]: Result */
42 variable
[4] = TAG_Bool(( variable
[3] /*prop*/==NIT_NULL
) || VAL_ISA( variable
[3] /*prop*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
43 if (!UNTAG_Bool(variable
[4])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_virtualtype___MMTypeProperty___stype_for
, LOCATE_virtualtype
, 35); nit_exit(1);}
44 /* Register variable[4]: Result */
45 variable
[4] = CALL_virtualtype___MMTypeProperty___real_stype_for( variable
[3] /*prop*/)( variable
[3] /*prop*/, variable
[1] /*recv*/) /*MMTypeProperty::real_stype_for*/;
46 variable
[2] = variable
[4];
48 return_label1
: while(false);
49 tracehead
= trace
.prev
;
52 val_t
virtualtype___MMTypeProperty___real_stype_for(val_t self
, val_t param0
) {
53 struct trace_t trace
= {NULL
, NULL
, 42, LOCATE_virtualtype___MMTypeProperty___real_stype_for
};
55 struct WBT_
**closurevariable
= NULL
;
56 trace
.prev
= tracehead
; tracehead
= &trace
;
57 trace
.file
= LOCATE_virtualtype
;
58 /* Register variable[0]: Local variable */
60 /* Register variable[1]: Local variable */
62 /* Register variable[2]: Method return value and escape marker */
63 /* Register variable[3]: Result */
64 variable
[3] = CALL_static_type___MMLocalProperty___signature(variable
[0])(variable
[0]) /*MMLocalProperty::signature*/;
65 /* Register variable[3]: Result */
66 variable
[3] = TAG_Bool((variable
[3] == NIT_NULL
/*null*/) || ((variable
[3] != NIT_NULL
) && ((CALL_kernel___Object_____eqeq(variable
[3])==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable
[3], NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[3])(variable
[3], NIT_NULL
/*null*/) /*Object::==*/)))));
67 if (UNTAG_Bool(variable
[3])) { /*if*/
68 variable
[2] = NIT_NULL
/*null*/;
71 /* Register variable[3]: Result */
72 variable
[3] = ATTR_virtualtype___MMTypeProperty____stypes_cache(variable
[0]) /*MMTypeProperty::_stypes_cache*/;
73 /* Register variable[3]: Result */
74 variable
[3] = CALL_abstract_collection___MapRead___has_key(variable
[3])(variable
[3], variable
[1] /*recv*/) /*CoupleMap::has_key*/;
75 if (UNTAG_Bool(variable
[3])) { /*if*/
76 /* Register variable[3]: Result */
77 variable
[3] = ATTR_virtualtype___MMTypeProperty____stypes_cache(variable
[0]) /*MMTypeProperty::_stypes_cache*/;
78 /* Register variable[3]: Result */
79 variable
[3] = CALL_abstract_collection___MapRead_____bra(variable
[3])(variable
[3], variable
[1] /*recv*/) /*CoupleMap::[]*/;
80 variable
[2] = variable
[3];
83 /* Register variable[3]: Local variable */
84 /* Register variable[4]: Result */
85 variable
[4] = NEW_MMVirtualType_virtualtype___MMVirtualType___init(variable
[0], variable
[1] /*recv*/) /*new MMVirtualType*/;
86 variable
[3] = variable
[4];
87 /* Register variable[4]: Result */
88 variable
[4] = ATTR_virtualtype___MMTypeProperty____stypes_cache(variable
[0]) /*MMTypeProperty::_stypes_cache*/;
89 CALL_abstract_collection___Map_____braeq(variable
[4])(variable
[4], variable
[1] /*recv*/, variable
[3] /*res*/) /*HashMap::[]=*/;
90 variable
[2] = variable
[3] /*res*/;
92 return_label2
: while(false);
93 tracehead
= trace
.prev
;
96 val_t
virtualtype___MMVirtualType___module(val_t self
) {
97 struct trace_t trace
= {NULL
, NULL
, 71, LOCATE_virtualtype___MMVirtualType___module
};
99 struct WBT_
**closurevariable
= NULL
;
100 trace
.prev
= tracehead
; tracehead
= &trace
;
101 trace
.file
= LOCATE_virtualtype
;
102 /* Register variable[0]: Local variable */
104 /* Register variable[1]: Method return value and escape marker */
105 /* Register variable[2]: Result */
106 variable
[2] = ATTR_virtualtype___MMVirtualType____recv(variable
[0]) /*MMVirtualType::_recv*/;
107 /* Register variable[2]: Result */
108 variable
[2] = CALL_static_type___MMType___module(variable
[2])(variable
[2]) /*MMType::module*/;
109 variable
[1] = variable
[2];
111 return_label3
: while(false);
112 tracehead
= trace
.prev
;
115 val_t
virtualtype___MMVirtualType___for_module(val_t self
, val_t param0
) {
116 struct trace_t trace
= {NULL
, NULL
, 73, LOCATE_virtualtype___MMVirtualType___for_module
};
118 struct WBT_
**closurevariable
= NULL
;
119 trace
.prev
= tracehead
; tracehead
= &trace
;
120 trace
.file
= LOCATE_virtualtype
;
121 /* Register variable[0]: Local variable */
123 /* Register variable[1]: Local variable */
124 variable
[1] = param0
;
125 /* Register variable[2]: Method return value and escape marker */
126 /* Register variable[3]: Result */
127 variable
[3] = CALL_static_type___MMType___module(variable
[0])(variable
[0]) /*MMVirtualType::module*/;
128 /* Register variable[3]: Result */
129 variable
[3] = TAG_Bool(( variable
[1] /*mod*/ == variable
[3]) || (( variable
[1] /*mod*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[1] /*mod*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[1] /*mod*/,variable
[3])):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[1] /*mod*/)( variable
[1] /*mod*/, variable
[3]) /*Object::==*/)))));
130 if (UNTAG_Bool(variable
[3])) { /*if*/
131 variable
[2] = variable
[0];
134 /* Register variable[3]: Result */
135 variable
[3] = CALL_virtualtype___MMVirtualType___recv(variable
[0])(variable
[0]) /*MMVirtualType::recv*/;
136 /* Register variable[3]: Result */
137 variable
[3] = CALL_static_type___MMType___for_module(variable
[3])(variable
[3], variable
[1] /*mod*/) /*MMType::for_module*/;
138 /* Register variable[3]: Result */
139 variable
[3] = CALL_static_type___MMType___adapt_to(variable
[0])(variable
[0], variable
[3]) /*MMVirtualType::adapt_to*/;
140 variable
[2] = variable
[3];
142 return_label4
: while(false);
143 tracehead
= trace
.prev
;
146 val_t
virtualtype___MMVirtualType___adapt_to(val_t self
, val_t param0
) {
147 struct trace_t trace
= {NULL
, NULL
, 84, LOCATE_virtualtype___MMVirtualType___adapt_to
};
149 struct WBT_
**closurevariable
= NULL
;
150 trace
.prev
= tracehead
; tracehead
= &trace
;
151 trace
.file
= LOCATE_virtualtype
;
152 /* Register variable[0]: Local variable */
154 /* Register variable[1]: Local variable */
155 variable
[1] = param0
;
156 /* Register variable[2]: Method return value and escape marker */
157 /* Register variable[3]: Result */
158 variable
[3] = CALL_virtualtype___MMVirtualType___property(variable
[0])(variable
[0]) /*MMVirtualType::property*/;
159 /* Register variable[3]: Result */
160 variable
[3] = CALL_virtualtype___MMTypeProperty___stype_for(variable
[3])(variable
[3], variable
[1] /*recv*/) /*MMTypeProperty::stype_for*/;
161 variable
[2] = variable
[3];
163 return_label5
: while(false);
164 tracehead
= trace
.prev
;
167 val_t
virtualtype___MMVirtualType___not_for_self(val_t self
) {
168 struct trace_t trace
= {NULL
, NULL
, 79, LOCATE_virtualtype___MMVirtualType___not_for_self
};
170 struct WBT_
**closurevariable
= NULL
;
171 trace
.prev
= tracehead
; tracehead
= &trace
;
172 trace
.file
= LOCATE_virtualtype
;
173 /* Register variable[0]: Local variable */
175 /* Register variable[1]: Method return value and escape marker */
176 /* Register variable[2]: Result */
177 variable
[2] = CALL_type_formal___MMTypeFormal___bound(variable
[0])(variable
[0]) /*MMTypeFormal::bound*/;
178 /* Register variable[2]: Result */
179 variable
[2] = CALL_static_type___MMType___not_for_self(variable
[2])(variable
[2]) /*MMType::not_for_self*/;
180 variable
[1] = variable
[2];
182 return_label6
: while(false);
183 tracehead
= trace
.prev
;
186 val_t
virtualtype___MMVirtualType___property(val_t self
) {
187 struct trace_t trace
= {NULL
, NULL
, 58, LOCATE_virtualtype___MMVirtualType___property
};
188 val_t
*variable
= NULL
;
189 struct WBT_
**closurevariable
= NULL
;
190 trace
.prev
= tracehead
; tracehead
= &trace
;
191 trace
.file
= LOCATE_virtualtype
;
192 tracehead
= trace
.prev
;
193 return ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/;
195 val_t
virtualtype___MMVirtualType___recv(val_t self
) {
196 struct trace_t trace
= {NULL
, NULL
, 61, LOCATE_virtualtype___MMVirtualType___recv
};
197 val_t
*variable
= NULL
;
198 struct WBT_
**closurevariable
= NULL
;
199 trace
.prev
= tracehead
; tracehead
= &trace
;
200 trace
.file
= LOCATE_virtualtype
;
201 tracehead
= trace
.prev
;
202 return ATTR_virtualtype___MMVirtualType____recv( self
) /*MMVirtualType::_recv*/;
204 void virtualtype___MMVirtualType___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
205 struct trace_t trace
= {NULL
, NULL
, 64, LOCATE_virtualtype___MMVirtualType___init
};
207 struct WBT_
**closurevariable
= NULL
;
208 trace
.prev
= tracehead
; tracehead
= &trace
;
209 trace
.file
= LOCATE_virtualtype
;
210 /* Register variable[0]: Local variable */
212 /* Register variable[1]: Local variable */
213 variable
[1] = param0
;
214 /* Register variable[2]: Local variable */
215 variable
[2] = param1
;
216 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_MMVirtualType
].i
]) return;
217 /* Register variable[3]: Method return value and escape marker */
218 /* Register variable[4]: Result */
219 variable
[4] = CALL_abstractmetamodel___MMLocalProperty___name( variable
[1] /*p*/)( variable
[1] /*p*/) /*MMLocalProperty::name*/;
220 /* Register variable[5]: Result */
221 variable
[5] = CALL_static_type___MMLocalProperty___signature_for( variable
[1] /*p*/)( variable
[1] /*p*/, variable
[2] /*recv*/) /*MMLocalProperty::signature_for*/;
222 /* Register variable[5]: Result */
223 variable
[5] = CALL_static_type___MMSignature___return_type(variable
[5])(variable
[5]) /*MMSignature::return_type*/;
224 CALL_type_formal___MMTypeFormal___init(variable
[0])(variable
[0], variable
[4], variable
[5], init_table
/*YYY*/) /*MMTypeFormal::init*/;
225 ATTR_virtualtype___MMVirtualType____property(variable
[0]) /*MMVirtualType::_property*/ = variable
[1] /*p*/;
226 ATTR_virtualtype___MMVirtualType____recv(variable
[0]) /*MMVirtualType::_recv*/ = variable
[2] /*recv*/;
227 return_label7
: while(false);
228 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_MMVirtualType
].i
] = 1;
229 tracehead
= trace
.prev
;
232 val_t
virtualtype___MMLocalClass___virtual_type(val_t self
, val_t param0
) {
233 struct trace_t trace
= {NULL
, NULL
, 91, LOCATE_virtualtype___MMLocalClass___virtual_type
};
235 struct WBT_
**closurevariable
= NULL
;
236 trace
.prev
= tracehead
; tracehead
= &trace
;
237 trace
.file
= LOCATE_virtualtype
;
238 /* Register variable[0]: Local variable */
240 /* Register variable[1]: Local variable */
241 variable
[1] = param0
;
242 /* Register variable[2]: Method return value and escape marker */
243 /* Register variable[3]: Local variable */
244 /* Register variable[4]: Result */
245 variable
[4] = CALL_abstractmetamodel___MMLocalClass___get_property_by_name(variable
[0])(variable
[0], variable
[1] /*s*/) /*MMLocalClass::get_property_by_name*/;
246 variable
[3] = variable
[4];
247 /* Register variable[4]: Result */
248 variable
[4] = CALL_virtualtype___MMGlobalProperty___is_virtual_type( variable
[3] /*prop*/)( variable
[3] /*prop*/) /*MMGlobalProperty::is_virtual_type*/;
249 if (UNTAG_Bool(variable
[4])) { /*if*/
250 variable
[2] = variable
[3] /*prop*/;
253 variable
[2] = NIT_NULL
/*null*/;
255 return_label8
: while(false);
256 tracehead
= trace
.prev
;
259 val_t
virtualtype___MMLocalClass___select_virtual_type(val_t self
, val_t param0
) {
260 struct trace_t trace
= {NULL
, NULL
, 100, LOCATE_virtualtype___MMLocalClass___select_virtual_type
};
262 struct WBT_
**closurevariable
= NULL
;
263 trace
.prev
= tracehead
; tracehead
= &trace
;
264 trace
.file
= LOCATE_virtualtype
;
265 /* Register variable[0]: Local variable */
267 /* Register variable[1]: Local variable */
268 variable
[1] = param0
;
269 /* Register variable[2]: Method return value and escape marker */
270 /* Register variable[3]: Result */
271 variable
[3] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable
[1] /*name*/ == NIT_NULL
/*null*/) || (( variable
[1] /*name*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[1] /*name*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[1] /*name*/, NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[1] /*name*/)( variable
[1] /*name*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
272 if (!UNTAG_Bool(variable
[3])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_virtualtype___MMLocalClass___select_virtual_type
, LOCATE_virtualtype
, 103); nit_exit(1);}
273 /* Register variable[3]: Local variable */
274 /* Register variable[4]: Result */
275 variable
[4] = CALL_virtualtype___MMLocalClass___virtual_type(variable
[0])(variable
[0], variable
[1] /*name*/) /*MMLocalClass::virtual_type*/;
276 variable
[3] = variable
[4];
277 /* Register variable[4]: Result */
278 variable
[4] = TAG_Bool(( variable
[3] /*gp*/ == NIT_NULL
/*null*/) || (( variable
[3] /*gp*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[3] /*gp*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[3] /*gp*/, NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[3] /*gp*/)( variable
[3] /*gp*/, NIT_NULL
/*null*/) /*Object::==*/)))));
279 if (UNTAG_Bool(variable
[4])) { /*if*/
280 variable
[2] = NIT_NULL
/*null*/;
283 /* Register variable[4]: Local variable */
284 /* Register variable[5]: Result */
285 variable
[5] = CALL_abstractmetamodel___MMLocalClass_____bra(variable
[0])(variable
[0], variable
[3] /*gp*/) /*MMLocalClass::[]*/;
286 variable
[4] = variable
[5];
287 /* Register variable[5]: Result */
288 variable
[5] = TAG_Bool(( variable
[4] /*res*/==NIT_NULL
) || VAL_ISA( variable
[4] /*res*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
289 if (!UNTAG_Bool(variable
[5])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_virtualtype___MMLocalClass___select_virtual_type
, LOCATE_virtualtype
, 107); nit_exit(1);}
290 variable
[2] = variable
[4] /*res*/;
292 return_label9
: while(false);
293 tracehead
= trace
.prev
;