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 trace
.prev
= tracehead
; tracehead
= &trace
;
7 trace
.file
= LOCATE_virtualtype
;
8 variable0
= ((abstractmetamodel___MMGlobalProperty___intro_t
)CALL( self
,COLOR_abstractmetamodel___MMGlobalProperty___intro
))( self
) /*MMGlobalProperty::intro*/;
9 variable0
= TAG_Bool((variable0
==NIT_NULL
) || VAL_ISA(variable0
, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
11 return_label0
: while(false);
12 tracehead
= trace
.prev
;
15 val_t
virtualtype___MMTypeProperty___stype_for(val_t self
, val_t param0
) {
16 struct trace_t trace
= {NULL
, NULL
, 31, LOCATE_virtualtype___MMTypeProperty___stype_for
};
21 trace
.prev
= tracehead
; tracehead
= &trace
;
22 trace
.file
= LOCATE_virtualtype
;
24 variable2
= ((static_type___MMType___local_class_t
)CALL( variable0
/*recv*/,COLOR_static_type___MMType___local_class
))( variable0
/*recv*/) /*MMType::local_class*/;
25 variable3
= ((abstractmetamodel___MMLocalProperty___global_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalProperty___global
))( self
) /*MMLocalProperty::global*/;
26 variable2
= ((inheritance___MMLocalClass_____bra_t
)CALL(variable2
,COLOR_abstractmetamodel___MMLocalClass_____bra
))(variable2
, variable3
) /*MMLocalClass::[]*/;
27 variable1
= variable2
;
28 variable2
= TAG_Bool(( variable1
/*prop*/==NIT_NULL
) || VAL_ISA( variable1
/*prop*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
29 if (!UNTAG_Bool(variable2
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_virtualtype___MMTypeProperty___stype_for
, LOCATE_virtualtype
, 35); nit_exit(1);}
30 variable2
= ((virtualtype___MMTypeProperty___real_stype_for_t
)CALL( variable1
/*prop*/,COLOR_virtualtype___MMTypeProperty___real_stype_for
))( variable1
/*prop*/, variable0
/*recv*/) /*MMTypeProperty::real_stype_for*/;
31 variable1
= variable2
;
33 return_label1
: while(false);
34 tracehead
= trace
.prev
;
37 val_t
virtualtype___MMTypeProperty___real_stype_for(val_t self
, val_t param0
) {
38 struct trace_t trace
= {NULL
, NULL
, 42, LOCATE_virtualtype___MMTypeProperty___real_stype_for
};
42 trace
.prev
= tracehead
; tracehead
= &trace
;
43 trace
.file
= LOCATE_virtualtype
;
45 variable1
= ((static_type___MMLocalProperty___signature_t
)CALL( self
,COLOR_static_type___MMLocalProperty___signature
))( self
) /*MMLocalProperty::signature*/;
46 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::==*/)))));
47 if (UNTAG_Bool(variable1
)) { /*if*/
48 variable1
= NIT_NULL
/*null*/;
51 variable1
= ATTR_virtualtype___MMTypeProperty____stypes_cache( self
) /*MMTypeProperty::_stypes_cache*/;
52 variable1
= ((abstract_collection___CoupleMap___has_key_t
)CALL(variable1
,COLOR_abstract_collection___Map___has_key
))(variable1
, variable0
/*recv*/) /*CoupleMap::has_key*/;
53 if (UNTAG_Bool(variable1
)) { /*if*/
54 variable1
= ATTR_virtualtype___MMTypeProperty____stypes_cache( self
) /*MMTypeProperty::_stypes_cache*/;
55 variable1
= ((abstract_collection___CoupleMap_____bra_t
)CALL(variable1
,COLOR_abstract_collection___Map_____bra
))(variable1
, variable0
/*recv*/) /*CoupleMap::[]*/;
58 variable2
= NEW_virtualtype___MMVirtualType___init( self
, variable0
/*recv*/); /*new MMVirtualType*/
59 variable1
= variable2
;
60 variable2
= ATTR_virtualtype___MMTypeProperty____stypes_cache( self
) /*MMTypeProperty::_stypes_cache*/;
61 ((hash___HashMap_____braeq_t
)CALL(variable2
,COLOR_abstract_collection___Map_____braeq
))(variable2
, variable0
/*recv*/, variable1
/*res*/) /*HashMap::[]=*/;
62 variable1
= variable1
/*res*/;
64 return_label2
: while(false);
65 tracehead
= trace
.prev
;
68 val_t
virtualtype___MMVirtualType___property(val_t self
) {
69 struct trace_t trace
= {NULL
, NULL
, 58, LOCATE_virtualtype___MMVirtualType___property
};
70 trace
.prev
= tracehead
; tracehead
= &trace
;
71 trace
.file
= LOCATE_virtualtype
;
72 tracehead
= trace
.prev
;
73 return ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/;
75 val_t
virtualtype___MMVirtualType___recv(val_t self
) {
76 struct trace_t trace
= {NULL
, NULL
, 61, LOCATE_virtualtype___MMVirtualType___recv
};
77 trace
.prev
= tracehead
; tracehead
= &trace
;
78 trace
.file
= LOCATE_virtualtype
;
79 tracehead
= trace
.prev
;
80 return ATTR_virtualtype___MMVirtualType____recv( self
) /*MMVirtualType::_recv*/;
82 void virtualtype___MMVirtualType___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
83 struct trace_t trace
= {NULL
, NULL
, 64, LOCATE_virtualtype___MMVirtualType___init
};
88 trace
.prev
= tracehead
; tracehead
= &trace
;
89 trace
.file
= LOCATE_virtualtype
;
92 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMVirtualType
].i
]) return;
93 variable2
= ((abstractmetamodel___MMLocalProperty___name_t
)CALL( variable0
/*p*/,COLOR_abstractmetamodel___MMLocalProperty___name
))( variable0
/*p*/) /*MMLocalProperty::name*/;
94 variable3
= ((static_type___MMLocalProperty___signature_for_t
)CALL( variable0
/*p*/,COLOR_static_type___MMLocalProperty___signature_for
))( variable0
/*p*/, variable1
/*recv*/) /*MMLocalProperty::signature_for*/;
95 variable3
= ((static_type___MMSignature___return_type_t
)CALL(variable3
,COLOR_static_type___MMSignature___return_type
))(variable3
) /*MMSignature::return_type*/;
96 ((type_formal___MMTypeFormal___init_t
)CALL( self
,COLOR_type_formal___MMTypeFormal___init
))( self
, variable2
, variable3
, init_table
/*YYY*/) /*MMTypeFormal::init*/;
97 ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/ = variable0
/*p*/;
98 ATTR_virtualtype___MMVirtualType____recv( self
) /*MMVirtualType::_recv*/ = variable1
/*recv*/;
99 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMVirtualType
].i
] = 1;
100 tracehead
= trace
.prev
;
103 val_t
virtualtype___MMVirtualType___module(val_t self
) {
104 struct trace_t trace
= {NULL
, NULL
, 71, LOCATE_virtualtype___MMVirtualType___module
};
106 trace
.prev
= tracehead
; tracehead
= &trace
;
107 trace
.file
= LOCATE_virtualtype
;
108 variable0
= ATTR_virtualtype___MMVirtualType____recv( self
) /*MMVirtualType::_recv*/;
109 variable0
= ((static_type___MMType___module_t
)CALL(variable0
,COLOR_static_type___MMType___module
))(variable0
) /*MMType::module*/;
111 return_label4
: 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
};
119 trace
.prev
= tracehead
; tracehead
= &trace
;
120 trace
.file
= LOCATE_virtualtype
;
122 variable1
= ((virtualtype___MMVirtualType___module_t
)CALL( self
,COLOR_static_type___MMType___module
))( self
) /*MMVirtualType::module*/;
123 variable1
= TAG_Bool(( variable0
/*mod*/ == variable1
) || (( variable0
/*mod*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable0
/*mod*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable0
/*mod*/,variable1
)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable0
/*mod*/,COLOR_kernel___Object_____eqeq
))( variable0
/*mod*/, variable1
) /*Object::==*/)))));
124 if (UNTAG_Bool(variable1
)) { /*if*/
128 variable1
= ((virtualtype___MMVirtualType___recv_t
)CALL( self
,COLOR_virtualtype___MMVirtualType___recv
))( self
) /*MMVirtualType::recv*/;
129 variable1
= ((static_type___MMType___for_module_t
)CALL(variable1
,COLOR_static_type___MMType___for_module
))(variable1
, variable0
/*mod*/) /*MMType::for_module*/;
130 variable1
= ((virtualtype___MMVirtualType___adapt_to_t
)CALL( self
,COLOR_static_type___MMType___adapt_to
))( self
, variable1
) /*MMVirtualType::adapt_to*/;
132 return_label5
: while(false);
133 tracehead
= trace
.prev
;
136 val_t
virtualtype___MMVirtualType___not_for_self(val_t self
) {
137 struct trace_t trace
= {NULL
, NULL
, 79, LOCATE_virtualtype___MMVirtualType___not_for_self
};
139 trace
.prev
= tracehead
; tracehead
= &trace
;
140 trace
.file
= LOCATE_virtualtype
;
141 variable0
= ((type_formal___MMTypeFormal___bound_t
)CALL( self
,COLOR_type_formal___MMTypeFormal___bound
))( self
) /*MMTypeFormal::bound*/;
142 variable0
= ((static_type___MMType___not_for_self_t
)CALL(variable0
,COLOR_static_type___MMType___not_for_self
))(variable0
) /*MMType::not_for_self*/;
144 return_label6
: while(false);
145 tracehead
= trace
.prev
;
148 val_t
virtualtype___MMVirtualType___adapt_to(val_t self
, val_t param0
) {
149 struct trace_t trace
= {NULL
, NULL
, 84, LOCATE_virtualtype___MMVirtualType___adapt_to
};
152 trace
.prev
= tracehead
; tracehead
= &trace
;
153 trace
.file
= LOCATE_virtualtype
;
155 variable1
= ((virtualtype___MMVirtualType___property_t
)CALL( self
,COLOR_virtualtype___MMVirtualType___property
))( self
) /*MMVirtualType::property*/;
156 variable1
= ((virtualtype___MMTypeProperty___stype_for_t
)CALL(variable1
,COLOR_virtualtype___MMTypeProperty___stype_for
))(variable1
, variable0
/*recv*/) /*MMTypeProperty::stype_for*/;
158 return_label7
: while(false);
159 tracehead
= trace
.prev
;
162 val_t
virtualtype___MMLocalClass___virtual_type(val_t self
, val_t param0
) {
163 struct trace_t trace
= {NULL
, NULL
, 91, LOCATE_virtualtype___MMLocalClass___virtual_type
};
167 trace
.prev
= tracehead
; tracehead
= &trace
;
168 trace
.file
= LOCATE_virtualtype
;
170 variable2
= ((abstractmetamodel___MMLocalClass___get_property_by_name_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass___get_property_by_name
))( self
, variable0
/*s*/) /*MMLocalClass::get_property_by_name*/;
171 variable1
= variable2
;
172 variable2
= ((virtualtype___MMGlobalProperty___is_virtual_type_t
)CALL( variable1
/*prop*/,COLOR_virtualtype___MMGlobalProperty___is_virtual_type
))( variable1
/*prop*/) /*MMGlobalProperty::is_virtual_type*/;
173 if (UNTAG_Bool(variable2
)) { /*if*/
174 variable1
= variable1
/*prop*/;
177 variable1
= NIT_NULL
/*null*/;
179 return_label8
: while(false);
180 tracehead
= trace
.prev
;
183 val_t
virtualtype___MMLocalClass___select_virtual_type(val_t self
, val_t param0
) {
184 struct trace_t trace
= {NULL
, NULL
, 100, LOCATE_virtualtype___MMLocalClass___select_virtual_type
};
189 trace
.prev
= tracehead
; tracehead
= &trace
;
190 trace
.file
= LOCATE_virtualtype
;
192 variable1
= TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable0
/*name*/ == NIT_NULL
/*null*/) || (( variable0
/*name*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable0
/*name*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable0
/*name*/, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable0
/*name*/,COLOR_kernel___Object_____eqeq
))( variable0
/*name*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
193 if (!UNTAG_Bool(variable1
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_virtualtype___MMLocalClass___select_virtual_type
, LOCATE_virtualtype
, 103); nit_exit(1);}
194 variable2
= ((virtualtype___MMLocalClass___virtual_type_t
)CALL( self
,COLOR_virtualtype___MMLocalClass___virtual_type
))( self
, variable0
/*name*/) /*MMLocalClass::virtual_type*/;
195 variable1
= variable2
;
196 variable2
= TAG_Bool(( variable1
/*gp*/ == NIT_NULL
/*null*/) || (( variable1
/*gp*/ != NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL( variable1
/*gp*/,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable1
/*gp*/, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL( variable1
/*gp*/,COLOR_kernel___Object_____eqeq
))( variable1
/*gp*/, NIT_NULL
/*null*/) /*Object::==*/)))));
197 if (UNTAG_Bool(variable2
)) { /*if*/
198 variable1
= NIT_NULL
/*null*/;
201 variable3
= ((inheritance___MMLocalClass_____bra_t
)CALL( self
,COLOR_abstractmetamodel___MMLocalClass_____bra
))( self
, variable1
/*gp*/) /*MMLocalClass::[]*/;
202 variable2
= variable3
;
203 variable3
= TAG_Bool(( variable2
/*res*/==NIT_NULL
) || VAL_ISA( variable2
/*res*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
204 if (!UNTAG_Bool(variable3
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_virtualtype___MMLocalClass___select_virtual_type
, LOCATE_virtualtype
, 107); nit_exit(1);}
205 variable1
= variable2
/*res*/;
207 return_label9
: while(false);
208 tracehead
= trace
.prev
;