First NIT release and new clean mercurial repository
[nit.git] / c_src / virtualtype._sep.c
1 #include "virtualtype._sep.h"
2 val_t virtualtype___MMGlobalProperty___is_virtual_type(val_t self) {
3 struct trace_t trace = {NULL, "virtualtype::MMGlobalProperty::is_virtual_type (src/metamodel//virtualtype.nit:24,2--25:62)"};
4 val_t variable0;
5 trace.prev = tracehead; tracehead = &trace;
6 variable0 = ((abstractmetamodel___MMGlobalProperty___intro_t)CALL( self,COLOR_abstractmetamodel___MMGlobalProperty___intro))( self) /*MMGlobalProperty::intro*/;
7 variable0 = TAG_Bool((variable0==NIT_NULL) || VAL_ISA(variable0, COLOR_MMTypeProperty, ID_MMTypeProperty)) /*cast MMTypeProperty*/;
8 goto return_label0;
9 return_label0: while(false);
10 tracehead = trace.prev;
11 return variable0;
12 }
13 val_t virtualtype___MMTypeProperty___inherit_to(val_t self, val_t param0) {
14 struct trace_t trace = {NULL, "virtualtype::MMTypeProperty::inherit_to (src/metamodel//virtualtype.nit:31,2--33:35)"};
15 val_t variable0;
16 val_t variable1;
17 trace.prev = tracehead; tracehead = &trace;
18 variable0 = param0;
19 variable1 = NEW_virtualtype___MMImplicitType___init( self, variable0 /*t*/); /*new MMImplicitType*/
20 goto return_label1;
21 return_label1: while(false);
22 tracehead = trace.prev;
23 return variable1;
24 }
25 val_t virtualtype___MMTypeProperty___stype(val_t self) {
26 struct trace_t trace = {NULL, "virtualtype::MMTypeProperty::stype (src/metamodel//virtualtype.nit:39,2--50:10)"};
27 val_t variable0;
28 val_t variable1;
29 trace.prev = tracehead; tracehead = &trace;
30 variable0 = ((static_type___MMLocalProperty___signature_t)CALL( self,COLOR_static_type___MMLocalProperty___signature))( self) /*MMTypeProperty::signature*/;
31 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*/) /*MMSignature::==*/)))));
32 if (UNTAG_Bool(variable0)) { /*if*/
33 variable0 = NIT_NULL /*null*/;
34 goto return_label2;
35 }
36 variable1 = ATTR_virtualtype___MMTypeProperty____stype_cache( self) /*MMTypeProperty::_stype_cache*/;
37 variable0 = variable1;
38 variable1 = TAG_Bool(( variable0 /*r*/ == NIT_NULL /*null*/) || (( variable0 /*r*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable0 /*r*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable0 /*r*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable0 /*r*/,COLOR_kernel___Object_____eqeq))( variable0 /*r*/, NIT_NULL /*null*/) /*MMVirtualType::==*/)))));
39 if (UNTAG_Bool(variable1)) { /*if*/
40 variable1 = NEW_virtualtype___MMVirtualType___init( self); /*new MMVirtualType*/
41 variable0 = variable1 /*r=*/;
42 ATTR_virtualtype___MMTypeProperty____stype_cache( self) /*MMTypeProperty::_stype_cache*/ = variable0 /*r*/;
43 }
44 variable0 = variable0 /*r*/;
45 goto return_label2;
46 return_label2: while(false);
47 tracehead = trace.prev;
48 return variable0;
49 }
50 val_t virtualtype___MMType___select_virtual_type(val_t self, val_t param0) {
51 struct trace_t trace = {NULL, "virtualtype::MMType::select_virtual_type (src/metamodel//virtualtype.nit:55,2--62:12)"};
52 val_t variable0;
53 val_t variable1;
54 val_t variable2;
55 trace.prev = tracehead; tracehead = &trace;
56 variable0 = param0;
57 variable1 = ((static_type___MMType___local_class_t)CALL( self,COLOR_static_type___MMType___local_class))( self) /*MMType::local_class*/;
58 variable1 = TAG_Bool(!UNTAG_Bool(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*/) /*MMLocalClass::==*/)))))));
59 if (!UNTAG_Bool(variable1)) { fprintf(stderr, "Assert failed: src/metamodel//virtualtype.nit:58,3--28\n"); nit_exit(1);}
60 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*/) /*Symbol::==*/)))))));
61 if (!UNTAG_Bool(variable1)) { fprintf(stderr, "Assert failed: src/metamodel//virtualtype.nit:59,3--21\n"); nit_exit(1);}
62 variable2 = ((static_type___MMType___local_class_t)CALL( self,COLOR_static_type___MMType___local_class))( self) /*MMType::local_class*/;
63 variable2 = ((virtualtype___MMLocalClass___virtual_type_t)CALL(variable2,COLOR_virtualtype___MMLocalClass___virtual_type))(variable2, variable0 /*name*/) /*MMLocalClass::virtual_type*/;
64 variable2 = ((static_type___MMType___select_property_t)CALL( self,COLOR_static_type___MMType___select_property))( self, variable2) /*MMType::select_property*/;
65 variable1 = variable2;
66 variable2 = TAG_Bool(( variable1 /*res*/==NIT_NULL) || VAL_ISA( variable1 /*res*/, COLOR_MMTypeProperty, ID_MMTypeProperty)) /*cast MMTypeProperty*/;
67 if (!UNTAG_Bool(variable2)) { fprintf(stderr, "Assert failed: src/metamodel//virtualtype.nit:61,3--31\n"); nit_exit(1);}
68 variable1 = variable1 /*res*/;
69 goto return_label3;
70 return_label3: while(false);
71 tracehead = trace.prev;
72 return variable1;
73 }
74 val_t virtualtype___MMVirtualType___property(val_t self) {
75 struct trace_t trace = {NULL, "virtualtype::MMVirtualType::property (src/metamodel//virtualtype.nit:68,2--69:40)"};
76 trace.prev = tracehead; tracehead = &trace;
77 tracehead = trace.prev;
78 return ATTR_virtualtype___MMVirtualType____property( self) /*MMVirtualType::_property*/;
79 }
80 void virtualtype___MMVirtualType___init(val_t self, val_t param0, int* init_table) {
81 struct trace_t trace = {NULL, "virtualtype::MMVirtualType::init (src/metamodel//virtualtype.nit:71,2--74:15)"};
82 val_t variable0;
83 val_t variable1;
84 val_t variable2;
85 trace.prev = tracehead; tracehead = &trace;
86 variable0 = param0;
87 if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_MMVirtualType].i]) return;
88 variable1 = ((abstractmetamodel___MMLocalProperty___name_t)CALL( variable0 /*p*/,COLOR_abstractmetamodel___MMLocalProperty___name))( variable0 /*p*/) /*MMTypeProperty::name*/;
89 variable2 = ((static_type___MMLocalProperty___signature_t)CALL( variable0 /*p*/,COLOR_static_type___MMLocalProperty___signature))( variable0 /*p*/) /*MMTypeProperty::signature*/;
90 variable2 = ((static_type___MMSignature___return_type_t)CALL(variable2,COLOR_static_type___MMSignature___return_type))(variable2) /*MMSignature::return_type*/;
91 ((type_formal___MMTypeFormal___init_t)CALL( self,COLOR_type_formal___MMTypeFormal___init))( self, variable1, variable2, init_table /*YYY*/) /*MMTypeFormal::init*/;
92 ATTR_virtualtype___MMVirtualType____property( self) /*MMVirtualType::_property*/ = variable0 /*p*/;
93 init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_MMVirtualType].i] = 1;
94 tracehead = trace.prev;
95 return;
96 }
97 val_t virtualtype___MMVirtualType___for_module(val_t self, val_t param0) {
98 struct trace_t trace = {NULL, "virtualtype::MMVirtualType::for_module (src/metamodel//virtualtype.nit:77,2--80:22)"};
99 val_t variable0;
100 val_t variable1;
101 val_t variable2;
102 trace.prev = tracehead; tracehead = &trace;
103 variable0 = param0;
104 variable2 = ATTR_virtualtype___MMVirtualType____property( self) /*MMVirtualType::_property*/;
105 variable2 = ((static_type___MMLocalProperty___signature_t)CALL(variable2,COLOR_static_type___MMLocalProperty___signature))(variable2) /*MMTypeProperty::signature*/;
106 variable2 = ((static_type___MMSignature___recv_t)CALL(variable2,COLOR_static_type___MMSignature___recv))(variable2) /*MMSignature::recv*/;
107 variable2 = ((static_type___MMType___for_module_t)CALL(variable2,COLOR_static_type___MMType___for_module))(variable2, variable0 /*mod*/) /*MMType::for_module*/;
108 variable1 = variable2;
109 variable2 = ((virtualtype___MMVirtualType___adapt_to_t)CALL( self,COLOR_static_type___MMType___adapt_to))( self, variable1 /*recv*/) /*MMVirtualType::adapt_to*/;
110 variable1 = variable2;
111 goto return_label5;
112 return_label5: while(false);
113 tracehead = trace.prev;
114 return variable1;
115 }
116 val_t virtualtype___MMVirtualType___not_for_self(val_t self) {
117 struct trace_t trace = {NULL, "virtualtype::MMVirtualType::not_for_self (src/metamodel//virtualtype.nit:83,2--85:27)"};
118 val_t variable0;
119 trace.prev = tracehead; tracehead = &trace;
120 variable0 = ((type_formal___MMTypeFormal___bound_t)CALL( self,COLOR_type_formal___MMTypeFormal___bound))( self) /*MMVirtualType::bound*/;
121 variable0 = ((static_type___MMType___not_for_self_t)CALL(variable0,COLOR_static_type___MMType___not_for_self))(variable0) /*MMType::not_for_self*/;
122 goto return_label6;
123 return_label6: while(false);
124 tracehead = trace.prev;
125 return variable0;
126 }
127 val_t virtualtype___MMVirtualType___adapt_to(val_t self, val_t param0) {
128 struct trace_t trace = {NULL, "virtualtype::MMVirtualType::adapt_to (src/metamodel//virtualtype.nit:88,2--93:19)"};
129 val_t variable0;
130 val_t variable1;
131 val_t variable2;
132 trace.prev = tracehead; tracehead = &trace;
133 variable0 = param0;
134 variable2 = ATTR_virtualtype___MMVirtualType____property( self) /*MMVirtualType::_property*/;
135 variable2 = ((abstractmetamodel___MMLocalProperty___global_t)CALL(variable2,COLOR_abstractmetamodel___MMLocalProperty___global))(variable2) /*MMTypeProperty::global*/;
136 variable2 = ((static_type___MMType___select_property_t)CALL( variable0 /*recv*/,COLOR_static_type___MMType___select_property))( variable0 /*recv*/, variable2) /*MMType::select_property*/;
137 variable1 = variable2;
138 variable2 = TAG_Bool(( variable1 /*prop*/==NIT_NULL) || VAL_ISA( variable1 /*prop*/, COLOR_MMTypeProperty, ID_MMTypeProperty)) /*cast MMTypeProperty*/;
139 if (!UNTAG_Bool(variable2)) { fprintf(stderr, "Assert failed: src/metamodel//virtualtype.nit:92,3--32\n"); nit_exit(1);}
140 variable2 = ((virtualtype___MMTypeProperty___stype_t)CALL( variable1 /*prop*/,COLOR_virtualtype___MMTypeProperty___stype))( variable1 /*prop*/) /*MMTypeProperty::stype*/;
141 variable1 = variable2;
142 goto return_label7;
143 return_label7: while(false);
144 tracehead = trace.prev;
145 return variable1;
146 }
147 val_t virtualtype___MMLocalClass___virtual_type(val_t self, val_t param0) {
148 struct trace_t trace = {NULL, "virtualtype::MMLocalClass::virtual_type (src/metamodel//virtualtype.nit:98,2--104:13)"};
149 val_t variable0;
150 val_t variable1;
151 val_t variable2;
152 trace.prev = tracehead; tracehead = &trace;
153 variable0 = param0;
154 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*/;
155 variable1 = variable2;
156 variable2 = ((virtualtype___MMGlobalProperty___is_virtual_type_t)CALL( variable1 /*prop*/,COLOR_virtualtype___MMGlobalProperty___is_virtual_type))( variable1 /*prop*/) /*MMGlobalProperty::is_virtual_type*/;
157 if (UNTAG_Bool(variable2)) { /*if*/
158 variable1 = variable1 /*prop*/;
159 goto return_label8;
160 }
161 variable1 = NIT_NULL /*null*/;
162 goto return_label8;
163 return_label8: while(false);
164 tracehead = trace.prev;
165 return variable1;
166 }
167 void virtualtype___MMImplicitType___init(val_t self, val_t param0, val_t param1, int* init_table) {
168 struct trace_t trace = {NULL, "virtualtype::MMImplicitType::init (src/metamodel//virtualtype.nit:111,2--20)"};
169 val_t variable0;
170 val_t variable1;
171 trace.prev = tracehead; tracehead = &trace;
172 variable0 = param0;
173 variable1 = param1;
174 if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_MMImplicitType].i]) return;
175 ((inheritance___MMImplicitProperty___init_t)CALL( self,COLOR_inheritance___MMImplicitProperty___init))( self, param0, param1, init_table /*YYY*/) /*MMImplicitProperty::init*/;
176 init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_MMImplicitType].i] = 1;
177 tracehead = trace.prev;
178 return;
179 }