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
, LOCATE_virtualtype___MMGlobalProperty___is_virtual_type
, 24};
6 trace
.prev
= tracehead
; tracehead
= &trace
;
7 variable0
= ((abstractmetamodel___MMGlobalProperty___intro_t
)CALL( self
,COLOR_abstractmetamodel___MMGlobalProperty___intro
))( self
) /*MMGlobalProperty::intro*/;
8 variable0
= TAG_Bool((variable0
==NIT_NULL
) || VAL_ISA(variable0
, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
10 return_label0
: while(false);
11 tracehead
= trace
.prev
;
14 val_t
virtualtype___MMTypeProperty___inherit_to(val_t self
, val_t param0
) {
15 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMTypeProperty___inherit_to
, 31};
18 trace
.prev
= tracehead
; tracehead
= &trace
;
20 variable1
= NEW_virtualtype___MMImplicitType___init( self
, variable0
/*t*/); /*new MMImplicitType*/
22 return_label1
: while(false);
23 tracehead
= trace
.prev
;
26 val_t
virtualtype___MMTypeProperty___stype(val_t self
) {
27 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMTypeProperty___stype
, 39};
30 trace
.prev
= tracehead
; tracehead
= &trace
;
31 variable0
= ((static_type___MMLocalProperty___signature_t
)CALL( self
,COLOR_static_type___MMLocalProperty___signature
))( self
) /*MMTypeProperty::signature*/;
32 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::==*/)))));
33 if (UNTAG_Bool(variable0
)) { /*if*/
34 variable0
= NIT_NULL
/*null*/;
37 variable1
= ATTR_virtualtype___MMTypeProperty____stype_cache( self
) /*MMTypeProperty::_stype_cache*/;
38 variable0
= variable1
;
39 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::==*/)))));
40 if (UNTAG_Bool(variable1
)) { /*if*/
41 variable1
= NEW_virtualtype___MMVirtualType___init( self
); /*new MMVirtualType*/
42 variable0
= variable1
/*r=*/;
43 ATTR_virtualtype___MMTypeProperty____stype_cache( self
) /*MMTypeProperty::_stype_cache*/ = variable0
/*r*/;
45 variable0
= variable0
/*r*/;
47 return_label2
: while(false);
48 tracehead
= trace
.prev
;
51 val_t
virtualtype___MMType___select_virtual_type(val_t self
, val_t param0
) {
52 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMType___select_virtual_type
, 55};
56 trace
.prev
= tracehead
; tracehead
= &trace
;
58 variable1
= ((static_type___MMType___local_class_t
)CALL( self
,COLOR_static_type___MMType___local_class
))( self
) /*MMType::local_class*/;
59 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::==*/)))))));
60 if (!UNTAG_Bool(variable1
)) { fprintf(stderr
, "Assert%s failed (%s: %d)\n", "", LOCATE_virtualtype___MMType___select_virtual_type
, 58); nit_exit(1);}
61 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::==*/)))))));
62 if (!UNTAG_Bool(variable1
)) { fprintf(stderr
, "Assert%s failed (%s: %d)\n", "", LOCATE_virtualtype___MMType___select_virtual_type
, 59); nit_exit(1);}
63 variable2
= ((static_type___MMType___local_class_t
)CALL( self
,COLOR_static_type___MMType___local_class
))( self
) /*MMType::local_class*/;
64 variable2
= ((virtualtype___MMLocalClass___virtual_type_t
)CALL(variable2
,COLOR_virtualtype___MMLocalClass___virtual_type
))(variable2
, variable0
/*name*/) /*MMLocalClass::virtual_type*/;
65 variable2
= ((static_type___MMType___select_property_t
)CALL( self
,COLOR_static_type___MMType___select_property
))( self
, variable2
) /*MMType::select_property*/;
66 variable1
= variable2
;
67 variable2
= TAG_Bool(( variable1
/*res*/==NIT_NULL
) || VAL_ISA( variable1
/*res*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
68 if (!UNTAG_Bool(variable2
)) { fprintf(stderr
, "Assert%s failed (%s: %d)\n", "", LOCATE_virtualtype___MMType___select_virtual_type
, 61); nit_exit(1);}
69 variable1
= variable1
/*res*/;
71 return_label3
: while(false);
72 tracehead
= trace
.prev
;
75 val_t
virtualtype___MMVirtualType___property(val_t self
) {
76 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMVirtualType___property
, 68};
77 trace
.prev
= tracehead
; tracehead
= &trace
;
78 tracehead
= trace
.prev
;
79 return ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/;
81 void virtualtype___MMVirtualType___init(val_t self
, val_t param0
, int* init_table
) {
82 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMVirtualType___init
, 71};
86 trace
.prev
= tracehead
; tracehead
= &trace
;
88 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMVirtualType
].i
]) return;
89 variable1
= ((abstractmetamodel___MMLocalProperty___name_t
)CALL( variable0
/*p*/,COLOR_abstractmetamodel___MMLocalProperty___name
))( variable0
/*p*/) /*MMTypeProperty::name*/;
90 variable2
= ((static_type___MMLocalProperty___signature_t
)CALL( variable0
/*p*/,COLOR_static_type___MMLocalProperty___signature
))( variable0
/*p*/) /*MMTypeProperty::signature*/;
91 variable2
= ((static_type___MMSignature___return_type_t
)CALL(variable2
,COLOR_static_type___MMSignature___return_type
))(variable2
) /*MMSignature::return_type*/;
92 ((type_formal___MMTypeFormal___init_t
)CALL( self
,COLOR_type_formal___MMTypeFormal___init
))( self
, variable1
, variable2
, init_table
/*YYY*/) /*MMTypeFormal::init*/;
93 ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/ = variable0
/*p*/;
94 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMVirtualType
].i
] = 1;
95 tracehead
= trace
.prev
;
98 val_t
virtualtype___MMVirtualType___for_module(val_t self
, val_t param0
) {
99 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMVirtualType___for_module
, 77};
103 trace
.prev
= tracehead
; tracehead
= &trace
;
105 variable2
= ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/;
106 variable2
= ((static_type___MMLocalProperty___signature_t
)CALL(variable2
,COLOR_static_type___MMLocalProperty___signature
))(variable2
) /*MMTypeProperty::signature*/;
107 variable2
= ((static_type___MMSignature___recv_t
)CALL(variable2
,COLOR_static_type___MMSignature___recv
))(variable2
) /*MMSignature::recv*/;
108 variable2
= ((static_type___MMType___for_module_t
)CALL(variable2
,COLOR_static_type___MMType___for_module
))(variable2
, variable0
/*mod*/) /*MMType::for_module*/;
109 variable1
= variable2
;
110 variable2
= ((virtualtype___MMVirtualType___adapt_to_t
)CALL( self
,COLOR_static_type___MMType___adapt_to
))( self
, variable1
/*recv*/) /*MMVirtualType::adapt_to*/;
111 variable1
= variable2
;
113 return_label5
: while(false);
114 tracehead
= trace
.prev
;
117 val_t
virtualtype___MMVirtualType___not_for_self(val_t self
) {
118 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMVirtualType___not_for_self
, 83};
120 trace
.prev
= tracehead
; tracehead
= &trace
;
121 variable0
= ((type_formal___MMTypeFormal___bound_t
)CALL( self
,COLOR_type_formal___MMTypeFormal___bound
))( self
) /*MMVirtualType::bound*/;
122 variable0
= ((static_type___MMType___not_for_self_t
)CALL(variable0
,COLOR_static_type___MMType___not_for_self
))(variable0
) /*MMType::not_for_self*/;
124 return_label6
: while(false);
125 tracehead
= trace
.prev
;
128 val_t
virtualtype___MMVirtualType___adapt_to(val_t self
, val_t param0
) {
129 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMVirtualType___adapt_to
, 88};
133 trace
.prev
= tracehead
; tracehead
= &trace
;
135 variable2
= ATTR_virtualtype___MMVirtualType____property( self
) /*MMVirtualType::_property*/;
136 variable2
= ((abstractmetamodel___MMLocalProperty___global_t
)CALL(variable2
,COLOR_abstractmetamodel___MMLocalProperty___global
))(variable2
) /*MMTypeProperty::global*/;
137 variable2
= ((static_type___MMType___select_property_t
)CALL( variable0
/*recv*/,COLOR_static_type___MMType___select_property
))( variable0
/*recv*/, variable2
) /*MMType::select_property*/;
138 variable1
= variable2
;
139 variable2
= TAG_Bool(( variable1
/*prop*/==NIT_NULL
) || VAL_ISA( variable1
/*prop*/, COLOR_MMTypeProperty
, ID_MMTypeProperty
)) /*cast MMTypeProperty*/;
140 if (!UNTAG_Bool(variable2
)) { fprintf(stderr
, "Assert%s failed (%s: %d)\n", "", LOCATE_virtualtype___MMVirtualType___adapt_to
, 92); nit_exit(1);}
141 variable2
= ((virtualtype___MMTypeProperty___stype_t
)CALL( variable1
/*prop*/,COLOR_virtualtype___MMTypeProperty___stype
))( variable1
/*prop*/) /*MMTypeProperty::stype*/;
142 variable1
= variable2
;
144 return_label7
: while(false);
145 tracehead
= trace
.prev
;
148 val_t
virtualtype___MMLocalClass___virtual_type(val_t self
, val_t param0
) {
149 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMLocalClass___virtual_type
, 98};
153 trace
.prev
= tracehead
; tracehead
= &trace
;
155 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*/;
156 variable1
= variable2
;
157 variable2
= ((virtualtype___MMGlobalProperty___is_virtual_type_t
)CALL( variable1
/*prop*/,COLOR_virtualtype___MMGlobalProperty___is_virtual_type
))( variable1
/*prop*/) /*MMGlobalProperty::is_virtual_type*/;
158 if (UNTAG_Bool(variable2
)) { /*if*/
159 variable1
= variable1
/*prop*/;
162 variable1
= NIT_NULL
/*null*/;
164 return_label8
: while(false);
165 tracehead
= trace
.prev
;
168 void virtualtype___MMImplicitType___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
169 struct trace_t trace
= {NULL
, LOCATE_virtualtype___MMImplicitType___init
, 111};
172 trace
.prev
= tracehead
; tracehead
= &trace
;
175 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMImplicitType
].i
]) return;
176 ((inheritance___MMImplicitProperty___init_t
)CALL( self
,COLOR_inheritance___MMImplicitProperty___init
))( self
, param0
, param1
, init_table
/*YYY*/) /*MMImplicitProperty::init*/;
177 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_MMImplicitType
].i
] = 1;
178 tracehead
= trace
.prev
;