7bc0408217ffdfd3a869f88376dbd87df1dc3a01
[nit.git] / c_src / virtualtype._sep.c
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};
5 val_t variable0;
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*/;
10 goto return_label0;
11 return_label0: while(false);
12 tracehead = trace.prev;
13 return variable0;
14 }
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};
17 val_t variable0;
18 val_t variable1;
19 val_t variable2;
20 val_t variable3;
21 trace.prev = tracehead; tracehead = &trace;
22 trace.file = LOCATE_virtualtype;
23 variable0 = param0;
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;
32 goto return_label1;
33 return_label1: while(false);
34 tracehead = trace.prev;
35 return variable1;
36 }
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};
39 val_t variable0;
40 val_t variable1;
41 val_t variable2;
42 trace.prev = tracehead; tracehead = &trace;
43 trace.file = LOCATE_virtualtype;
44 variable0 = param0;
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*/;
49 goto return_label2;
50 }
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::[]*/;
56 goto return_label2;
57 }
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*/;
63 goto return_label2;
64 return_label2: while(false);
65 tracehead = trace.prev;
66 return variable1;
67 }
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*/;
74 }
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*/;
81 }
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};
84 val_t variable0;
85 val_t variable1;
86 val_t variable2;
87 val_t variable3;
88 trace.prev = tracehead; tracehead = &trace;
89 trace.file = LOCATE_virtualtype;
90 variable0 = param0;
91 variable1 = param1;
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;
101 return;
102 }
103 val_t virtualtype___MMVirtualType___module(val_t self) {
104 struct trace_t trace = {NULL, NULL, 71, LOCATE_virtualtype___MMVirtualType___module};
105 val_t variable0;
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*/;
110 goto return_label4;
111 return_label4: while(false);
112 tracehead = trace.prev;
113 return variable0;
114 }
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};
117 val_t variable0;
118 val_t variable1;
119 trace.prev = tracehead; tracehead = &trace;
120 trace.file = LOCATE_virtualtype;
121 variable0 = param0;
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*/
125 variable1 = self;
126 goto return_label5;
127 }
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*/;
131 goto return_label5;
132 return_label5: while(false);
133 tracehead = trace.prev;
134 return variable1;
135 }
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};
138 val_t variable0;
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*/;
143 goto return_label6;
144 return_label6: while(false);
145 tracehead = trace.prev;
146 return variable0;
147 }
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};
150 val_t variable0;
151 val_t variable1;
152 trace.prev = tracehead; tracehead = &trace;
153 trace.file = LOCATE_virtualtype;
154 variable0 = param0;
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*/;
157 goto return_label7;
158 return_label7: while(false);
159 tracehead = trace.prev;
160 return variable1;
161 }
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};
164 val_t variable0;
165 val_t variable1;
166 val_t variable2;
167 trace.prev = tracehead; tracehead = &trace;
168 trace.file = LOCATE_virtualtype;
169 variable0 = param0;
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*/;
175 goto return_label8;
176 }
177 variable1 = NIT_NULL /*null*/;
178 goto return_label8;
179 return_label8: while(false);
180 tracehead = trace.prev;
181 return variable1;
182 }
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};
185 val_t variable0;
186 val_t variable1;
187 val_t variable2;
188 val_t variable3;
189 trace.prev = tracehead; tracehead = &trace;
190 trace.file = LOCATE_virtualtype;
191 variable0 = param0;
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*/;
199 goto return_label9;
200 }
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*/;
206 goto return_label9;
207 return_label9: while(false);
208 tracehead = trace.prev;
209 return variable1;
210 }