1 #include "nit__light_c.sep.0.h"
2 /* method light_c#CLanguage#identify_language for (self: CLanguage, AExternCodeBlock): Bool */
3 short int nit___nit__CLanguage___nit__light_ffi_base__FFILanguage__identify_language(val
* self
, val
* p0
) {
4 short int var
/* : Bool */;
5 val
* var_n
/* var n: AExternCodeBlock */;
6 short int var1
/* : Bool */;
9 var1
= nit__light_c___AExternCodeBlock___is_c(var_n
);
16 /* method light_c#CLanguage#compile_module_block for (self: CLanguage, AExternCodeBlock, CCompilationUnit, MModule) */
17 void nit___nit__CLanguage___nit__light_ffi_base__FFILanguage__compile_module_block(val
* self
, val
* p0
, val
* p1
, val
* p2
) {
18 val
* var_block
/* var block: AExternCodeBlock */;
19 val
* var_ecc
/* var ecc: CCompilationUnit */;
20 val
* var_mmodule
/* var mmodule: MModule */;
21 short int var
/* : Bool */;
22 val
* var1
/* : Template */;
23 val
* var3
/* : Template */;
24 val
* var4
/* : Location */;
25 val
* var6
/* : Location */;
26 val
* var7
/* : String */;
27 val
* var8
/* : Template */;
28 val
* var10
/* : Template */;
30 val
* var11
/* : String */;
31 char* var12
/* : NativeString */;
32 val
* var13
/* : FlatString */;
33 val
* var14
/* : Template */;
34 val
* var16
/* : Template */;
35 val
* var17
/* : String */;
36 short int var18
/* : Bool */;
37 val
* var19
/* : Template */;
38 val
* var21
/* : Template */;
39 val
* var22
/* : Location */;
40 val
* var24
/* : Location */;
41 val
* var25
/* : String */;
42 val
* var26
/* : Template */;
43 val
* var28
/* : Template */;
44 static val
* varonce29
;
45 val
* var30
/* : String */;
46 char* var31
/* : NativeString */;
47 val
* var32
/* : FlatString */;
48 val
* var33
/* : Template */;
49 val
* var35
/* : Template */;
50 val
* var36
/* : String */;
55 var
= nit__light_c___AExternCodeBlock___is_c_header(var_block
);
59 { /* Inline c_tools#CCompilationUnit#header_custom (var_ecc) on <var_ecc:CCompilationUnit> */
60 var3
= var_ecc
->attrs
[COLOR_nit__c_tools__CCompilationUnit___header_custom
].val
; /* _header_custom on <var_ecc:CCompilationUnit> */
61 if (unlikely(var3
== NULL
)) {
62 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _header_custom");
63 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 28);
71 { /* Inline parser_nodes#ANode#location (var_block) on <var_block:AExternCodeBlock> */
72 var6
= var_block
->attrs
[COLOR_nit__parser_nodes__ANode___location
].val
; /* _location on <var_block:AExternCodeBlock> */
73 if (unlikely(var6
== NULL
)) {
74 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _location");
75 PRINT_ERROR(" (%s:%d)\n", FILE_nit__parser_nodes
, 24);
83 var7
= nit__light_c___Location___as_line_pragma(var4
);
86 template___template__Template___add(var1
, var7
); /* Direct call template#Template#add on <var1:Template>*/
89 { /* Inline c_tools#CCompilationUnit#header_custom (var_ecc) on <var_ecc:CCompilationUnit> */
90 var10
= var_ecc
->attrs
[COLOR_nit__c_tools__CCompilationUnit___header_custom
].val
; /* _header_custom on <var_ecc:CCompilationUnit> */
91 if (unlikely(var10
== NULL
)) {
92 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _header_custom");
93 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 28);
100 if (likely(varonce
!=NULL
)) {
104 var13
= standard___standard__NativeString___to_s_with_length(var12
, 1l);
109 template___template__Template___add(var8
, var11
); /* Direct call template#Template#add on <var8:Template>*/
112 { /* Inline c_tools#CCompilationUnit#header_custom (var_ecc) on <var_ecc:CCompilationUnit> */
113 var16
= var_ecc
->attrs
[COLOR_nit__c_tools__CCompilationUnit___header_custom
].val
; /* _header_custom on <var_ecc:CCompilationUnit> */
114 if (unlikely(var16
== NULL
)) {
115 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _header_custom");
116 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 28);
124 var17
= nit__light_ffi_base___AExternCodeBlock___code(var_block
);
127 template___template__Template___add(var14
, var17
); /* Direct call template#Template#add on <var14:Template>*/
131 var18
= nit__light_c___AExternCodeBlock___is_c_body(var_block
);
135 { /* Inline c_tools#CCompilationUnit#body_impl (var_ecc) on <var_ecc:CCompilationUnit> */
136 var21
= var_ecc
->attrs
[COLOR_nit__c_tools__CCompilationUnit___body_impl
].val
; /* _body_impl on <var_ecc:CCompilationUnit> */
137 if (unlikely(var21
== NULL
)) {
138 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _body_impl");
139 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 44);
147 { /* Inline parser_nodes#ANode#location (var_block) on <var_block:AExternCodeBlock> */
148 var24
= var_block
->attrs
[COLOR_nit__parser_nodes__ANode___location
].val
; /* _location on <var_block:AExternCodeBlock> */
149 if (unlikely(var24
== NULL
)) {
150 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _location");
151 PRINT_ERROR(" (%s:%d)\n", FILE_nit__parser_nodes
, 24);
159 var25
= nit__light_c___Location___as_line_pragma(var22
);
162 template___template__Template___add(var19
, var25
); /* Direct call template#Template#add on <var19:Template>*/
165 { /* Inline c_tools#CCompilationUnit#body_impl (var_ecc) on <var_ecc:CCompilationUnit> */
166 var28
= var_ecc
->attrs
[COLOR_nit__c_tools__CCompilationUnit___body_impl
].val
; /* _body_impl on <var_ecc:CCompilationUnit> */
167 if (unlikely(var28
== NULL
)) {
168 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _body_impl");
169 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 44);
176 if (likely(varonce29
!=NULL
)) {
180 var32
= standard___standard__NativeString___to_s_with_length(var31
, 1l);
185 template___template__Template___add(var26
, var30
); /* Direct call template#Template#add on <var26:Template>*/
188 { /* Inline c_tools#CCompilationUnit#body_impl (var_ecc) on <var_ecc:CCompilationUnit> */
189 var35
= var_ecc
->attrs
[COLOR_nit__c_tools__CCompilationUnit___body_impl
].val
; /* _body_impl on <var_ecc:CCompilationUnit> */
190 if (unlikely(var35
== NULL
)) {
191 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _body_impl");
192 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 44);
200 var36
= nit__light_ffi_base___AExternCodeBlock___code(var_block
);
203 template___template__Template___add(var33
, var36
); /* Direct call template#Template#add on <var33:Template>*/
210 /* method light_c#CLanguage#compile_extern_method for (self: CLanguage, AExternCodeBlock, AMethPropdef, CCompilationUnit, MModule) */
211 void nit___nit__CLanguage___nit__light_ffi_base__FFILanguage__compile_extern_method(val
* self
, val
* p0
, val
* p1
, val
* p2
, val
* p3
) {
212 val
* var_block
/* var block: AExternCodeBlock */;
213 val
* var_m
/* var m: AMethPropdef */;
214 val
* var_ecc
/* var ecc: CCompilationUnit */;
215 val
* var_mmodule
/* var mmodule: MModule */;
216 val
* var
/* : ExternCFunction */;
217 val
* var_fc
/* var fc: ExternCFunction */;
218 val
* var1
/* : Template */;
219 val
* var3
/* : Template */;
220 val
* var4
/* : Location */;
221 val
* var6
/* : Location */;
222 val
* var7
/* : String */;
223 val
* var8
/* : Template */;
224 val
* var10
/* : Template */;
225 val
* var11
/* : String */;
230 var
= NEW_nit__ExternCFunction(&type_nit__ExternCFunction
);
232 nit___nit__ExternCFunction___init(var
, var_m
, var_mmodule
); /* Direct call light_c#ExternCFunction#init on <var:ExternCFunction>*/
236 { /* Inline c_tools#CFunction#decls (var_fc) on <var_fc:ExternCFunction> */
237 var3
= var_fc
->attrs
[COLOR_nit__c_tools__CFunction___decls
].val
; /* _decls on <var_fc:ExternCFunction> */
238 if (unlikely(var3
== NULL
)) {
239 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _decls");
240 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 88);
248 { /* Inline parser_nodes#ANode#location (var_block) on <var_block:AExternCodeBlock> */
249 var6
= var_block
->attrs
[COLOR_nit__parser_nodes__ANode___location
].val
; /* _location on <var_block:AExternCodeBlock> */
250 if (unlikely(var6
== NULL
)) {
251 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _location");
252 PRINT_ERROR(" (%s:%d)\n", FILE_nit__parser_nodes
, 24);
260 var7
= nit__light_c___Location___as_line_pragma(var4
);
263 template___template__Template___add(var1
, var7
); /* Direct call template#Template#add on <var1:Template>*/
266 { /* Inline c_tools#CFunction#exprs (var_fc) on <var_fc:ExternCFunction> */
267 var10
= var_fc
->attrs
[COLOR_nit__c_tools__CFunction___exprs
].val
; /* _exprs on <var_fc:ExternCFunction> */
268 if (unlikely(var10
== NULL
)) {
269 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _exprs");
270 PRINT_ERROR(" (%s:%d)\n", FILE_nit__c_tools
, 89);
278 var11
= nit__light_ffi_base___AExternCodeBlock___code(var_block
);
281 template___template__Template___add(var8
, var11
); /* Direct call template#Template#add on <var8:Template>*/
284 nit___nit__CCompilationUnit___add_exported_function(var_ecc
, var_fc
); /* Direct call c_tools#CCompilationUnit#add_exported_function on <var_ecc:CCompilationUnit>*/
288 /* method light_c#CLanguage#compile_extern_class for (self: CLanguage, AExternCodeBlock, AClassdef, CCompilationUnit, MModule) */
289 void nit___nit__CLanguage___nit__light_ffi_base__FFILanguage__compile_extern_class(val
* self
, val
* p0
, val
* p1
, val
* p2
, val
* p3
) {
290 val
* var_block
/* var block: AExternCodeBlock */;
291 val
* var_m
/* var m: AClassdef */;
292 val
* var_ecc
/* var ecc: CCompilationUnit */;
293 val
* var_mmodule
/* var mmodule: MModule */;
300 /* method light_c#CLanguage#get_ftype for (self: CLanguage, AExternCodeBlock, AClassdef): ForeignType */
301 val
* nit___nit__CLanguage___nit__light_ffi_base__FFILanguage__get_ftype(val
* self
, val
* p0
, val
* p1
) {
302 val
* var
/* : ForeignType */;
303 val
* var_block
/* var block: AExternCodeBlock */;
304 val
* var_m
/* var m: AClassdef */;
305 val
* var1
/* : ForeignCType */;
306 val
* var2
/* : String */;
309 var1
= NEW_nit__ForeignCType(&type_nit__ForeignCType
);
311 var2
= nit__light_ffi_base___AExternCodeBlock___code(var_block
);
314 ((void(*)(val
* self
, val
* p0
))(var1
->class->vft
[COLOR_nit__light_c__ForeignCType__ctype_61d
]))(var1
, var2
); /* ctype= on <var1:ForeignCType>*/
317 ((void(*)(val
* self
))(var1
->class->vft
[COLOR_standard__kernel__Object__init
]))(var1
); /* init on <var1:ForeignCType>*/
324 /* method light_c#AExternCodeBlock#is_c for (self: AExternCodeBlock): Bool */
325 short int nit__light_c___AExternCodeBlock___is_c(val
* self
) {
326 short int var
/* : Bool */;
327 short int var1
/* : Bool */;
328 short int var2
/* : Bool */;
329 val
* var3
/* : nullable String */;
330 short int var4
/* : Bool */;
331 short int var5
/* : Bool */;
332 short int var_
/* var : Bool */;
333 val
* var6
/* : nullable String */;
335 val
* var7
/* : String */;
336 char* var8
/* : NativeString */;
337 val
* var9
/* : FlatString */;
338 short int var10
/* : Bool */;
339 short int var11
/* : Bool */;
340 short int var_12
/* var : Bool */;
341 val
* var13
/* : nullable String */;
342 static val
* varonce14
;
343 val
* var15
/* : String */;
344 char* var16
/* : NativeString */;
345 val
* var17
/* : FlatString */;
346 short int var18
/* : Bool */;
348 var3
= nit__light_ffi_base___AExternCodeBlock___language_name(self
);
351 var4
= 1; /* is null */
353 var4
= 0; /* arg is null but recv is not */
356 var5
= ((short int(*)(val
* self
, val
* p0
))(var3
->class->vft
[COLOR_standard__kernel__Object___61d_61d
]))(var3
, ((val
*)NULL
)); /* == on <var3:nullable String>*/
364 var6
= nit__light_ffi_base___AExternCodeBlock___language_name_lowered(self
);
366 if (likely(varonce
!=NULL
)) {
370 var9
= standard___standard__NativeString___to_s_with_length(var8
, 1l);
375 var10
= 0; /* <var7:String> cannot be null */
377 var11
= ((short int(*)(val
* self
, val
* p0
))(var6
->class->vft
[COLOR_standard__kernel__Object___61d_61d
]))(var6
, var7
); /* == on <var6:nullable String>*/
387 var13
= nit__light_ffi_base___AExternCodeBlock___language_name_lowered(self
);
389 if (likely(varonce14
!=NULL
)) {
393 var17
= standard___standard__NativeString___to_s_with_length(var16
, 2l);
398 PRINT_ERROR("Runtime error: %s", "Receiver is null");
399 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 61);
402 var18
= standard___standard__Text___has_prefix(var13
, var15
);
411 /* method light_c#AExternCodeBlock#is_c_body for (self: AExternCodeBlock): Bool */
412 short int nit__light_c___AExternCodeBlock___is_c_body(val
* self
) {
413 short int var
/* : Bool */;
414 short int var1
/* : Bool */;
415 short int var2
/* : Bool */;
416 val
* var3
/* : nullable String */;
417 short int var4
/* : Bool */;
418 short int var5
/* : Bool */;
419 short int var_
/* var : Bool */;
420 val
* var6
/* : nullable String */;
422 val
* var7
/* : String */;
423 char* var8
/* : NativeString */;
424 val
* var9
/* : FlatString */;
425 short int var10
/* : Bool */;
426 short int var11
/* : Bool */;
427 short int var_12
/* var : Bool */;
428 val
* var13
/* : nullable String */;
429 static val
* varonce14
;
430 val
* var15
/* : String */;
431 char* var16
/* : NativeString */;
432 val
* var17
/* : FlatString */;
433 short int var18
/* : Bool */;
434 short int var19
/* : Bool */;
436 var3
= nit__light_ffi_base___AExternCodeBlock___language_name(self
);
439 var4
= 1; /* is null */
441 var4
= 0; /* arg is null but recv is not */
444 var5
= ((short int(*)(val
* self
, val
* p0
))(var3
->class->vft
[COLOR_standard__kernel__Object___61d_61d
]))(var3
, ((val
*)NULL
)); /* == on <var3:nullable String>*/
452 var6
= nit__light_ffi_base___AExternCodeBlock___language_name_lowered(self
);
454 if (likely(varonce
!=NULL
)) {
458 var9
= standard___standard__NativeString___to_s_with_length(var8
, 1l);
463 var10
= 0; /* <var7:String> cannot be null */
465 var11
= ((short int(*)(val
* self
, val
* p0
))(var6
->class->vft
[COLOR_standard__kernel__Object___61d_61d
]))(var6
, var7
); /* == on <var6:nullable String>*/
475 var13
= nit__light_ffi_base___AExternCodeBlock___language_name_lowered(self
);
477 if (likely(varonce14
!=NULL
)) {
481 var17
= standard___standard__NativeString___to_s_with_length(var16
, 6l);
486 var18
= 0; /* <var15:String> cannot be null */
488 var19
= ((short int(*)(val
* self
, val
* p0
))(var13
->class->vft
[COLOR_standard__kernel__Object___61d_61d
]))(var13
, var15
); /* == on <var13:nullable String>*/
498 /* method light_c#AExternCodeBlock#is_c_header for (self: AExternCodeBlock): Bool */
499 short int nit__light_c___AExternCodeBlock___is_c_header(val
* self
) {
500 short int var
/* : Bool */;
501 val
* var1
/* : nullable String */;
503 val
* var2
/* : String */;
504 char* var3
/* : NativeString */;
505 val
* var4
/* : FlatString */;
506 short int var5
/* : Bool */;
507 short int var6
/* : Bool */;
509 var1
= nit__light_ffi_base___AExternCodeBlock___language_name_lowered(self
);
511 if (likely(varonce
!=NULL
)) {
515 var4
= standard___standard__NativeString___to_s_with_length(var3
, 8l);
520 var5
= 0; /* <var2:String> cannot be null */
522 var6
= ((short int(*)(val
* self
, val
* p0
))(var1
->class->vft
[COLOR_standard__kernel__Object___61d_61d
]))(var1
, var2
); /* == on <var1:nullable String>*/
530 /* method light_c#Location#as_line_pragma for (self: Location): String */
531 val
* nit__light_c___Location___as_line_pragma(val
* self
) {
532 val
* var
/* : String */;
533 val
* var1
/* : NativeArray[String] */;
535 static val
* varonce2
;
536 val
* var3
/* : String */;
537 char* var4
/* : NativeString */;
538 val
* var5
/* : FlatString */;
539 static val
* varonce6
;
540 val
* var7
/* : String */;
541 char* var8
/* : NativeString */;
542 val
* var9
/* : FlatString */;
543 static val
* varonce10
;
544 val
* var11
/* : String */;
545 char* var12
/* : NativeString */;
546 val
* var13
/* : FlatString */;
547 long var14
/* : Int */;
548 long var16
/* : Int */;
549 long var17
/* : Int */;
550 short int var19
/* : Bool */;
553 const char* var_class_name
;
554 long var20
/* : Int */;
555 val
* var21
/* : String */;
556 val
* var22
/* : nullable SourceFile */;
557 val
* var24
/* : nullable SourceFile */;
558 val
* var25
/* : String */;
559 val
* var27
/* : String */;
560 val
* var28
/* : String */;
561 if (unlikely(varonce
==NULL
)) {
562 var1
= NEW_standard__NativeArray(5l, &type_standard__NativeArray__standard__String
);
563 if (likely(varonce2
!=NULL
)) {
567 var5
= standard___standard__NativeString___to_s_with_length(var4
, 6l);
571 ((struct instance_standard__NativeArray
*)var1
)->values
[0]=var3
;
572 if (likely(varonce6
!=NULL
)) {
576 var9
= standard___standard__NativeString___to_s_with_length(var8
, 2l);
580 ((struct instance_standard__NativeArray
*)var1
)->values
[2]=var7
;
581 if (likely(varonce10
!=NULL
)) {
585 var13
= standard___standard__NativeString___to_s_with_length(var12
, 2l);
589 ((struct instance_standard__NativeArray
*)var1
)->values
[4]=var11
;
595 { /* Inline location#Location#line_start (self) on <self:Location> */
596 var16
= self
->attrs
[COLOR_nit__location__Location___line_start
].l
; /* _line_start on <self:Location> */
602 { /* Inline kernel#Int#- (var14,1l) on <var14:Int> */
603 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
604 /* <1l:Int> isa OTHER */
605 var19
= 1; /* easy <1l:Int> isa OTHER*/
606 if (unlikely(!var19
)) {
607 var_class_name
= type_standard__Int
.name
;
608 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name
);
609 PRINT_ERROR(" (%s:%d)\n", FILE_standard__kernel
, 540);
618 var21
= standard__string___Int___Object__to_s(var17
);
619 ((struct instance_standard__NativeArray
*)var1
)->values
[1]=var21
;
621 { /* Inline location#Location#file (self) on <self:Location> */
622 var24
= self
->attrs
[COLOR_nit__location__Location___file
].val
; /* _file on <self:Location> */
628 PRINT_ERROR("Runtime error: %s", "Receiver is null");
629 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 70);
632 { /* Inline location#SourceFile#filename (var22) on <var22:nullable SourceFile> */
633 if (unlikely(var22
== NULL
)) {
634 PRINT_ERROR("Runtime error: %s", "Receiver is null");
635 PRINT_ERROR(" (%s:%d)\n", FILE_nit__location
, 22);
638 var27
= var22
->attrs
[COLOR_nit__location__SourceFile___filename
].val
; /* _filename on <var22:nullable SourceFile> */
639 if (unlikely(var27
== NULL
)) {
640 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _filename");
641 PRINT_ERROR(" (%s:%d)\n", FILE_nit__location
, 22);
648 ((struct instance_standard__NativeArray
*)var1
)->values
[3]=var25
;
650 var28
= ((val
*(*)(val
* self
))(var1
->class->vft
[COLOR_standard__string__NativeArray__native_to_s
]))(var1
); /* native_to_s on <var1:NativeArray[String]>*/
658 /* method light_c#MModule#cflags for (self: MModule): MultiHashMap[String, String] */
659 val
* nit__light_c___MModule___cflags(val
* self
) {
660 val
* var
/* : MultiHashMap[String, String] */;
661 val
* var1
/* : MultiHashMap[String, String] */;
662 var1
= self
->attrs
[COLOR_nit__light_c__MModule___cflags
].val
; /* _cflags on <self:MModule> */
663 if (unlikely(var1
== NULL
)) {
664 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _cflags");
665 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 77);
672 /* method light_c#MModule#ldflags for (self: MModule): MultiHashMap[String, String] */
673 val
* nit__light_c___MModule___ldflags(val
* self
) {
674 val
* var
/* : MultiHashMap[String, String] */;
675 val
* var1
/* : MultiHashMap[String, String] */;
676 var1
= self
->attrs
[COLOR_nit__light_c__MModule___ldflags
].val
; /* _ldflags on <self:MModule> */
677 if (unlikely(var1
== NULL
)) {
678 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _ldflags");
679 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 80);
686 /* method light_c#MModule#pkgconfigs for (self: MModule): Array[String] */
687 val
* nit__light_c___MModule___pkgconfigs(val
* self
) {
688 val
* var
/* : Array[String] */;
689 val
* var1
/* : Array[String] */;
690 var1
= self
->attrs
[COLOR_nit__light_c__MModule___pkgconfigs
].val
; /* _pkgconfigs on <self:MModule> */
691 if (unlikely(var1
== NULL
)) {
692 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _pkgconfigs");
693 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 83);
700 /* method light_c#ForeignCType#ctype for (self: ForeignCType): String */
701 val
* nit___nit__ForeignCType___nit__light_ffi_base__ForeignType__ctype(val
* self
) {
702 val
* var
/* : String */;
703 val
* var1
/* : String */;
704 var1
= self
->attrs
[COLOR_nit__light_c__ForeignCType___ctype
].val
; /* _ctype on <self:ForeignCType> */
705 if (unlikely(var1
== NULL
)) {
706 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _ctype");
707 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 91);
714 /* method light_c#ForeignCType#ctype= for (self: ForeignCType, String) */
715 void nit___nit__ForeignCType___ctype_61d(val
* self
, val
* p0
) {
716 self
->attrs
[COLOR_nit__light_c__ForeignCType___ctype
].val
= p0
; /* _ctype on <self:ForeignCType> */
719 /* method light_c#ForeignCType#init for (self: ForeignCType) */
720 void nit___nit__ForeignCType___standard__kernel__Object__init(val
* self
) {
722 ((void(*)(val
* self
))(self
->class->vft
[COLOR_nit___nit__ForeignCType___standard__kernel__Object__init
]))(self
); /* init on <self:ForeignCType>*/
726 /* method light_c#Object#from_c_call_context for (self: Object): FromCCallContext */
727 val
* nit__light_c___standard__Object___from_c_call_context(val
* self
) {
728 val
* var
/* : FromCCallContext */;
730 static int varonce_guard
;
731 val
* var1
/* : FromCCallContext */;
732 val
* var2
/* : FromCCallContext */;
733 if (likely(varonce_guard
)) {
736 var2
= NEW_nit__FromCCallContext(&type_nit__FromCCallContext
);
738 { /* Inline kernel#Object#init (var2) on <var2:FromCCallContext> */
751 /* method light_c#FromCCallContext#name_mtype for (self: FromCCallContext, MType): String */
752 val
* nit___nit__FromCCallContext___nit__nitni_utilities__CallContext__name_mtype(val
* self
, val
* p0
) {
753 val
* var
/* : String */;
754 val
* var_mtype
/* var mtype: MType */;
755 val
* var1
/* : String */;
758 var1
= ((val
*(*)(val
* self
))(var_mtype
->class->vft
[COLOR_nit__nitni_base__MType__cname
]))(var_mtype
); /* cname on <var_mtype:MType>*/
765 /* method light_c#ExternCFunction#method= for (self: ExternCFunction, AMethPropdef) */
766 void nit___nit__ExternCFunction___method_61d(val
* self
, val
* p0
) {
767 self
->attrs
[COLOR_nit__light_c__ExternCFunction___method
].val
= p0
; /* _method on <self:ExternCFunction> */
770 /* method light_c#ExternCFunction#init for (self: ExternCFunction, AMethPropdef, MModule) */
771 void nit___nit__ExternCFunction___init(val
* self
, val
* p0
, val
* p1
) {
772 val
* var_method
/* var method: AMethPropdef */;
773 val
* var_mmodule
/* var mmodule: MModule */;
774 val
* var
/* : nullable MPropDef */;
775 val
* var3
/* : nullable MPropDef */;
776 val
* var4
/* : MClassDef */;
777 val
* var6
/* : MClassDef */;
778 val
* var7
/* : MClassType */;
779 val
* var9
/* : MClassType */;
780 val
* var_recv_mtype
/* var recv_mtype: MClassType */;
781 val
* var10
/* : nullable MPropDef */;
782 val
* var12
/* : nullable MPropDef */;
783 val
* var13
/* : MProperty */;
784 val
* var15
/* : MProperty */;
786 val
* var16
/* : String */;
787 char* var17
/* : NativeString */;
788 val
* var18
/* : FlatString */;
789 val
* var19
/* : SignatureLength */;
790 val
* var20
/* : FromCCallContext */;
791 val
* var21
/* : String */;
792 val
* var_csignature
/* var csignature: String */;
796 { /* Inline light_c#ExternCFunction#method= (self,var_method) on <self:ExternCFunction> */
797 self
->attrs
[COLOR_nit__light_c__ExternCFunction___method
].val
= var_method
; /* _method on <self:ExternCFunction> */
802 { /* Inline modelize_property#APropdef#mpropdef (var_method) on <var_method:AMethPropdef> */
803 var3
= var_method
->attrs
[COLOR_nit__modelize_property__APropdef___mpropdef
].val
; /* _mpropdef on <var_method:AMethPropdef> */
809 PRINT_ERROR("Runtime error: %s", "Receiver is null");
810 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 133);
813 { /* Inline model#MPropDef#mclassdef (var) on <var:nullable MPropDef(nullable MMethodDef)> */
814 if (unlikely(var
== NULL
)) {
815 PRINT_ERROR("Runtime error: %s", "Receiver is null");
816 PRINT_ERROR(" (%s:%d)\n", FILE_nit__model
, 2209);
819 var6
= var
->attrs
[COLOR_nit__model__MPropDef___mclassdef
].val
; /* _mclassdef on <var:nullable MPropDef(nullable MMethodDef)> */
820 if (unlikely(var6
== NULL
)) {
821 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _mclassdef");
822 PRINT_ERROR(" (%s:%d)\n", FILE_nit__model
, 2209);
830 { /* Inline model#MClassDef#bound_mtype (var4) on <var4:MClassDef> */
831 var9
= var4
->attrs
[COLOR_nit__model__MClassDef___bound_mtype
].val
; /* _bound_mtype on <var4:MClassDef> */
832 if (unlikely(var9
== NULL
)) {
833 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _bound_mtype");
834 PRINT_ERROR(" (%s:%d)\n", FILE_nit__model
, 556);
841 var_recv_mtype
= var7
;
843 { /* Inline modelize_property#APropdef#mpropdef (var_method) on <var_method:AMethPropdef> */
844 var12
= var_method
->attrs
[COLOR_nit__modelize_property__APropdef___mpropdef
].val
; /* _mpropdef on <var_method:AMethPropdef> */
850 PRINT_ERROR("Runtime error: %s", "Receiver is null");
851 PRINT_ERROR(" (%s:%d)\n", FILE_nit__light_c
, 134);
854 { /* Inline model#MPropDef#mproperty (var10) on <var10:nullable MPropDef(nullable MMethodDef)> */
855 if (unlikely(var10
== NULL
)) {
856 PRINT_ERROR("Runtime error: %s", "Receiver is null");
857 PRINT_ERROR(" (%s:%d)\n", FILE_nit__model
, 2212);
860 var15
= var10
->attrs
[COLOR_nit__model__MPropDef___mproperty
].val
; /* _mproperty on <var10:nullable MPropDef(nullable MMethodDef)> */
861 if (unlikely(var15
== NULL
)) {
862 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _mproperty");
863 PRINT_ERROR(" (%s:%d)\n", FILE_nit__model
, 2212);
870 if (likely(varonce
!=NULL
)) {
874 var18
= standard___standard__NativeString___to_s_with_length(var17
, 7l);
879 var19
= nit__nitni_utilities___standard__Object___long_signature(self
);
882 var20
= nit__light_c___standard__Object___from_c_call_context(self
);
885 var21
= nit__nitni_utilities___MMethod___build_csignature(var13
, var_recv_mtype
, var_mmodule
, var16
, var19
, var20
);
887 var_csignature
= var21
;
889 ((void(*)(val
* self
, val
* p0
))(self
->class->vft
[COLOR_nit__c_tools__CFunction__signature_61d
]))(self
, var_csignature
); /* signature= on <self:ExternCFunction>*/
892 ((void(*)(val
* self
))(self
->class->vft
[COLOR_standard__kernel__Object__init
]))(self
); /* init on <self:ExternCFunction>*/