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 void **closurevariable
= NULL
;
7 trace
.prev
= tracehead
; tracehead
= &trace
;
8 trace
.file
= LOCATE_virtualtype
;
10 variable
[2] = variable
[0];
11 variable
[2] = CALL_abstractmetamodel___MMGlobalProperty___intro(variable
[2])(variable
[2]) /*MMGlobalProperty::intro*/;
12 variable
[2] = TAG_Bool((variable
[2]==NIT_NULL
) || VAL_ISA(variable
[2], COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
13 variable
[1] = variable
[2];
15 return_label0
: while(false);
16 tracehead
= trace
.prev
;
19 val_t
virtualtype___MMTypeProperty___stype_for(val_t self
, val_t param0
) {
20 struct trace_t trace
= {NULL
, NULL
, 31, LOCATE_virtualtype___MMTypeProperty___stype_for
};
22 void **closurevariable
= NULL
;
23 trace
.prev
= tracehead
; tracehead
= &trace
;
24 trace
.file
= LOCATE_virtualtype
;
27 variable
[4] = CALL_static_type___MMType___local_class( variable
[1] /*recv*/)( variable
[1] /*recv*/) /*MMType::local_class*/;
28 variable
[5] = variable
[0];
29 variable
[5] = CALL_abstractmetamodel___MMLocalProperty___global(variable
[5])(variable
[5]) /*MMLocalProperty::global*/;
30 variable
[4] = CALL_abstractmetamodel___MMLocalClass_____bra(variable
[4])(variable
[4], variable
[5]) /*MMLocalClass::[]*/;
31 variable
[3] = variable
[4];
32 variable
[4] = TAG_Bool(( variable
[3] /*prop*/==NIT_NULL
) || VAL_ISA( variable
[3] /*prop*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
33 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);}
34 variable
[4] = CALL_virtualtype___MMTypeProperty___real_stype_for( variable
[3] /*prop*/)( variable
[3] /*prop*/, variable
[1] /*recv*/) /*MMTypeProperty::real_stype_for*/;
35 variable
[2] = variable
[4];
37 return_label1
: while(false);
38 tracehead
= trace
.prev
;
41 val_t
virtualtype___MMTypeProperty___real_stype_for(val_t self
, val_t param0
) {
42 struct trace_t trace
= {NULL
, NULL
, 42, LOCATE_virtualtype___MMTypeProperty___real_stype_for
};
44 void **closurevariable
= NULL
;
45 trace
.prev
= tracehead
; tracehead
= &trace
;
46 trace
.file
= LOCATE_virtualtype
;
49 variable
[3] = variable
[0];
50 variable
[3] = CALL_static_type___MMLocalProperty___signature(variable
[3])(variable
[3]) /*MMLocalProperty::signature*/;
51 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::==*/)))));
52 if (UNTAG_Bool(variable
[3])) { /*if*/
53 variable
[2] = NIT_NULL
/*null*/;
56 variable
[3] = variable
[0];
57 variable
[3] = ATTR_virtualtype___MMTypeProperty____stypes_cache(variable
[3]) /*MMTypeProperty::_stypes_cache*/;
58 variable
[3] = CALL_abstract_collection___Map___has_key(variable
[3])(variable
[3], variable
[1] /*recv*/) /*CoupleMap::has_key*/;
59 if (UNTAG_Bool(variable
[3])) { /*if*/
60 variable
[3] = variable
[0];
61 variable
[3] = ATTR_virtualtype___MMTypeProperty____stypes_cache(variable
[3]) /*MMTypeProperty::_stypes_cache*/;
62 variable
[3] = CALL_abstract_collection___Map_____bra(variable
[3])(variable
[3], variable
[1] /*recv*/) /*CoupleMap::[]*/;
63 variable
[2] = variable
[3];
66 variable
[4] = variable
[0];
67 variable
[5] = NEW_MMVirtualType_virtualtype___MMVirtualType___init(variable
[4], variable
[1] /*recv*/); /*new MMVirtualType*/
68 variable
[4] = variable
[5];
69 variable
[3] = variable
[4];
70 variable
[4] = variable
[0];
71 variable
[4] = ATTR_virtualtype___MMTypeProperty____stypes_cache(variable
[4]) /*MMTypeProperty::_stypes_cache*/;
72 CALL_abstract_collection___Map_____braeq(variable
[4])(variable
[4], variable
[1] /*recv*/, variable
[3] /*res*/) /*HashMap::[]=*/;
73 variable
[2] = variable
[3] /*res*/;
75 return_label2
: while(false);
76 tracehead
= trace
.prev
;
79 val_t
virtualtype___MMVirtualType___module(val_t self
) {
80 struct trace_t trace
= {NULL
, NULL
, 71, LOCATE_virtualtype___MMVirtualType___module
};
82 void **closurevariable
= NULL
;
83 trace
.prev
= tracehead
; tracehead
= &trace
;
84 trace
.file
= LOCATE_virtualtype
;
86 variable
[2] = variable
[0];
87 variable
[2] = ATTR_virtualtype___MMVirtualType____recv(variable
[2]) /*MMVirtualType::_recv*/;
88 variable
[2] = CALL_static_type___MMType___module(variable
[2])(variable
[2]) /*MMType::module*/;
89 variable
[1] = variable
[2];
91 return_label3
: while(false);
92 tracehead
= trace
.prev
;
95 val_t
virtualtype___MMVirtualType___for_module(val_t self
, val_t param0
) {
96 struct trace_t trace
= {NULL
, NULL
, 73, LOCATE_virtualtype___MMVirtualType___for_module
};
98 void **closurevariable
= NULL
;
99 trace
.prev
= tracehead
; tracehead
= &trace
;
100 trace
.file
= LOCATE_virtualtype
;
102 variable
[1] = param0
;
103 variable
[3] = variable
[0];
104 variable
[3] = CALL_static_type___MMType___module(variable
[3])(variable
[3]) /*MMVirtualType::module*/;
105 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::==*/)))));
106 if (UNTAG_Bool(variable
[3])) { /*if*/
107 variable
[3] = variable
[0];
108 variable
[2] = variable
[3];
111 variable
[3] = variable
[0];
112 variable
[4] = variable
[0];
113 variable
[4] = CALL_virtualtype___MMVirtualType___recv(variable
[4])(variable
[4]) /*MMVirtualType::recv*/;
114 variable
[4] = CALL_static_type___MMType___for_module(variable
[4])(variable
[4], variable
[1] /*mod*/) /*MMType::for_module*/;
115 variable
[3] = CALL_static_type___MMType___adapt_to(variable
[3])(variable
[3], variable
[4]) /*MMVirtualType::adapt_to*/;
116 variable
[2] = variable
[3];
118 return_label4
: while(false);
119 tracehead
= trace
.prev
;
122 val_t
virtualtype___MMVirtualType___adapt_to(val_t self
, val_t param0
) {
123 struct trace_t trace
= {NULL
, NULL
, 84, LOCATE_virtualtype___MMVirtualType___adapt_to
};
125 void **closurevariable
= NULL
;
126 trace
.prev
= tracehead
; tracehead
= &trace
;
127 trace
.file
= LOCATE_virtualtype
;
129 variable
[1] = param0
;
130 variable
[3] = variable
[0];
131 variable
[3] = CALL_virtualtype___MMVirtualType___property(variable
[3])(variable
[3]) /*MMVirtualType::property*/;
132 variable
[3] = CALL_virtualtype___MMTypeProperty___stype_for(variable
[3])(variable
[3], variable
[1] /*recv*/) /*MMTypeProperty::stype_for*/;
133 variable
[2] = variable
[3];
135 return_label5
: while(false);
136 tracehead
= trace
.prev
;
139 val_t
virtualtype___MMVirtualType___not_for_self(val_t self
) {
140 struct trace_t trace
= {NULL
, NULL
, 79, LOCATE_virtualtype___MMVirtualType___not_for_self
};
142 void **closurevariable
= NULL
;
143 trace
.prev
= tracehead
; tracehead
= &trace
;
144 trace
.file
= LOCATE_virtualtype
;
146 variable
[2] = variable
[0];
147 variable
[2] = CALL_type_formal___MMTypeFormal___bound(variable
[2])(variable
[2]) /*MMTypeFormal::bound*/;
148 variable
[2] = CALL_static_type___MMType___not_for_self(variable
[2])(variable
[2]) /*MMType::not_for_self*/;
149 variable
[1] = variable
[2];
151 return_label6
: while(false);
152 tracehead
= trace
.prev
;
155 val_t
virtualtype___MMVirtualType___property(val_t self
) {
156 struct trace_t trace
= {NULL
, NULL
, 58, LOCATE_virtualtype___MMVirtualType___property
};
157 val_t
*variable
= NULL
;
158 void **closurevariable
= NULL
;
159 trace
.prev
= tracehead
; tracehead
= &trace
;
160 trace
.file
= LOCATE_virtualtype
;
161 tracehead
= trace
.prev
;
162 return ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/;
164 val_t
virtualtype___MMVirtualType___recv(val_t self
) {
165 struct trace_t trace
= {NULL
, NULL
, 61, LOCATE_virtualtype___MMVirtualType___recv
};
166 val_t
*variable
= NULL
;
167 void **closurevariable
= NULL
;
168 trace
.prev
= tracehead
; tracehead
= &trace
;
169 trace
.file
= LOCATE_virtualtype
;
170 tracehead
= trace
.prev
;
171 return ATTR_virtualtype___MMVirtualType____recv( self
) /*MMVirtualType::_recv*/;
173 void virtualtype___MMVirtualType___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
174 struct trace_t trace
= {NULL
, NULL
, 64, LOCATE_virtualtype___MMVirtualType___init
};
176 void **closurevariable
= NULL
;
177 trace
.prev
= tracehead
; tracehead
= &trace
;
178 trace
.file
= LOCATE_virtualtype
;
180 variable
[1] = param0
;
181 variable
[2] = param1
;
182 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_MMVirtualType
].i
]) return;
183 variable
[4] = CALL_abstractmetamodel___MMLocalProperty___name( variable
[1] /*p*/)( variable
[1] /*p*/) /*MMLocalProperty::name*/;
184 variable
[5] = CALL_static_type___MMLocalProperty___signature_for( variable
[1] /*p*/)( variable
[1] /*p*/, variable
[2] /*recv*/) /*MMLocalProperty::signature_for*/;
185 variable
[5] = CALL_static_type___MMSignature___return_type(variable
[5])(variable
[5]) /*MMSignature::return_type*/;
186 CALL_type_formal___MMTypeFormal___init(variable
[0])(variable
[0], variable
[4], variable
[5], init_table
/*YYY*/) /*MMTypeFormal::init*/;
187 variable
[4] = variable
[0];
188 ATTR_virtualtype___MMVirtualType____property(variable
[4]) /*MMVirtualType::_property*/ = variable
[1] /*p*/;
189 variable
[4] = variable
[0];
190 ATTR_virtualtype___MMVirtualType____recv(variable
[4]) /*MMVirtualType::_recv*/ = variable
[2] /*recv*/;
191 return_label7
: while(false);
192 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_MMVirtualType
].i
] = 1;
193 tracehead
= trace
.prev
;
196 val_t
virtualtype___MMLocalClass___virtual_type(val_t self
, val_t param0
) {
197 struct trace_t trace
= {NULL
, NULL
, 91, LOCATE_virtualtype___MMLocalClass___virtual_type
};
199 void **closurevariable
= NULL
;
200 trace
.prev
= tracehead
; tracehead
= &trace
;
201 trace
.file
= LOCATE_virtualtype
;
203 variable
[1] = param0
;
204 variable
[4] = variable
[0];
205 variable
[4] = CALL_abstractmetamodel___MMLocalClass___get_property_by_name(variable
[4])(variable
[4], variable
[1] /*s*/) /*MMLocalClass::get_property_by_name*/;
206 variable
[3] = variable
[4];
207 variable
[4] = CALL_virtualtype___MMGlobalProperty___is_virtual_type( variable
[3] /*prop*/)( variable
[3] /*prop*/) /*MMGlobalProperty::is_virtual_type*/;
208 if (UNTAG_Bool(variable
[4])) { /*if*/
209 variable
[2] = variable
[3] /*prop*/;
212 variable
[2] = NIT_NULL
/*null*/;
214 return_label8
: while(false);
215 tracehead
= trace
.prev
;
218 val_t
virtualtype___MMLocalClass___select_virtual_type(val_t self
, val_t param0
) {
219 struct trace_t trace
= {NULL
, NULL
, 100, LOCATE_virtualtype___MMLocalClass___select_virtual_type
};
221 void **closurevariable
= NULL
;
222 trace
.prev
= tracehead
; tracehead
= &trace
;
223 trace
.file
= LOCATE_virtualtype
;
225 variable
[1] = param0
;
226 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::==*/)))))));
227 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);}
228 variable
[4] = variable
[0];
229 variable
[4] = CALL_virtualtype___MMLocalClass___virtual_type(variable
[4])(variable
[4], variable
[1] /*name*/) /*MMLocalClass::virtual_type*/;
230 variable
[3] = variable
[4];
231 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::==*/)))));
232 if (UNTAG_Bool(variable
[4])) { /*if*/
233 variable
[2] = NIT_NULL
/*null*/;
236 variable
[5] = variable
[0];
237 variable
[5] = CALL_abstractmetamodel___MMLocalClass_____bra(variable
[5])(variable
[5], variable
[3] /*gp*/) /*MMLocalClass::[]*/;
238 variable
[4] = variable
[5];
239 variable
[5] = TAG_Bool(( variable
[4] /*res*/==NIT_NULL
) || VAL_ISA( variable
[4] /*res*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
240 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);}
241 variable
[2] = variable
[4] /*res*/;
243 return_label9
: while(false);
244 tracehead
= trace
.prev
;