1 #include "parser_util.sep.0.h"
2 /* method parser_util#ToolContext#parse_module for (self: ToolContext, String): AModule */
3 val
* parser_util__ToolContext__parse_module(val
* self
, val
* p0
) {
4 val
* var
/* : AModule */;
5 val
* var_string
/* var string: String */;
6 val
* var1
/* : SourceFile */;
8 val
* var2
/* : String */;
9 char* var3
/* : NativeString */;
10 long var4
/* : Int */;
11 val
* var5
/* : String */;
12 val
* var_source
/* var source: SourceFile */;
13 val
* var6
/* : Lexer */;
14 val
* var_lexer
/* var lexer: Lexer */;
15 val
* var7
/* : Parser */;
16 val
* var_parser
/* var parser: Parser */;
17 val
* var8
/* : Start */;
18 val
* var_tree
/* var tree: Start */;
19 val
* var9
/* : EOF */;
20 val
* var_eof
/* var eof: EOF */;
21 short int var10
/* : Bool */;
24 val
* var11
/* : null */;
25 static val
* varonce12
;
26 val
* var13
/* : String */;
27 char* var14
/* : NativeString */;
28 long var15
/* : Int */;
29 val
* var16
/* : String */;
30 val
* var17
/* : String */;
31 val
* var18
/* : Array[Object] */;
32 long var19
/* : Int */;
33 val
* var20
/* : NativeArray[Object] */;
34 val
* var21
/* : String */;
35 val
* var22
/* : nullable AModule */;
37 var1
= NEW_location__SourceFile(&type_location__SourceFile
);
43 var5
= string__NativeString__to_s_with_length(var3
, var4
);
47 ((void (*)(val
*, val
*, val
*))(var1
->class->vft
[COLOR_location__SourceFile__from_string
]))(var1
, var2
, var_string
) /* from_string on <var1:SourceFile>*/;
49 var6
= NEW_lexer__Lexer(&type_lexer__Lexer
);
50 ((void (*)(val
*, val
*))(var6
->class->vft
[COLOR_lexer__Lexer__init
]))(var6
, var_source
) /* init on <var6:Lexer>*/;
52 var7
= NEW_parser__Parser(&type_parser__Parser
);
53 ((void (*)(val
*, val
*))(var7
->class->vft
[COLOR_parser__Parser__init
]))(var7
, var_lexer
) /* init on <var7:Parser>*/;
55 var8
= ((val
* (*)(val
*))(var_parser
->class->vft
[COLOR_parser__Parser__parse
]))(var_parser
) /* parse on <var_parser:Parser>*/;
57 var9
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_eof
]))(var_tree
) /* n_eof on <var_tree:Start>*/;
59 /* <var_eof:EOF> isa AError */
60 cltype
= type_parser_nodes__AError
.color
;
61 idtype
= type_parser_nodes__AError
.id
;
62 if(cltype
>= var_eof
->type
->table_size
) {
65 var10
= var_eof
->type
->type_table
[cltype
] == idtype
;
72 var14
= "Fatal Error: ";
74 var16
= string__NativeString__to_s_with_length(var14
, var15
);
78 var17
= ((val
* (*)(val
*))(var_eof
->class->vft
[COLOR_lexer__AError__message
]))(var_eof
) /* message on <var_eof:EOF(AError)>*/;
79 var18
= NEW_array__Array(&type_array__Arraykernel__Object
);
80 { /* var18 = array_instance Array[Object] */
82 var20
= NEW_array__NativeArray(var19
, &type_array__NativeArraykernel__Object
);
83 ((struct instance_array__NativeArray
*)var20
)->values
[0] = (val
*) var13
;
84 ((struct instance_array__NativeArray
*)var20
)->values
[1] = (val
*) var17
;
85 ((void (*)(val
*, val
*, long))(var18
->class->vft
[COLOR_array__Array__with_native
]))(var18
, var20
, var19
) /* with_native on <var18:Array[Object]>*/;
87 var21
= ((val
* (*)(val
*))(var18
->class->vft
[COLOR_string__Object__to_s
]))(var18
) /* to_s on <var18:Array[Object]>*/;
88 ((void (*)(val
*, val
*, val
*))(self
->class->vft
[COLOR_toolcontext__ToolContext__fatal_error
]))(self
, var11
, var21
) /* fatal_error on <self:ToolContext>*/;
89 fprintf(stderr
, "Runtime error: %s", "Aborted");
90 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 34);
94 var22
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_base
]))(var_tree
) /* n_base on <var_tree:Start>*/;
96 fprintf(stderr
, "Runtime error: %s", "Cast failed");
97 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 36);
105 /* method parser_util#ToolContext#parse_module for (self: Object, String): AModule */
106 val
* VIRTUAL_parser_util__ToolContext__parse_module(val
* self
, val
* p0
) {
107 val
* var
/* : AModule */;
108 val
* var1
/* : AModule */;
109 var1
= parser_util__ToolContext__parse_module(self
, p0
);
114 /* method parser_util#ToolContext#parse_classdef for (self: ToolContext, String): AClassdef */
115 val
* parser_util__ToolContext__parse_classdef(val
* self
, val
* p0
) {
116 val
* var
/* : AClassdef */;
117 val
* var_string
/* var string: String */;
118 val
* var1
/* : AModule */;
119 val
* var_nmodule
/* var nmodule: AModule */;
120 val
* var2
/* : ANodes[AClassdef] */;
121 val
* var_nclassdefs
/* var nclassdefs: ANodes[AClassdef] */;
122 long var3
/* : Int */;
123 long var4
/* : Int */;
124 short int var5
/* : Bool */;
125 short int var7
/* : Bool */;
126 short int var8
/* : Bool */;
127 val
* var9
/* : null */;
129 val
* var10
/* : String */;
130 char* var11
/* : NativeString */;
131 long var12
/* : Int */;
132 val
* var13
/* : String */;
133 val
* var14
/* : nullable Object */;
135 var1
= ((val
* (*)(val
*, val
*))(self
->class->vft
[COLOR_parser_util__ToolContext__parse_module
]))(self
, var_string
) /* parse_module on <self:ToolContext>*/;
137 var2
= ((val
* (*)(val
*))(var_nmodule
->class->vft
[COLOR_parser_nodes__AModule__n_classdefs
]))(var_nmodule
) /* n_classdefs on <var_nmodule:AModule>*/;
138 var_nclassdefs
= var2
;
139 var3
= ((long (*)(val
*))(var_nclassdefs
->class->vft
[COLOR_abstract_collection__Collection__length
]))(var_nclassdefs
) /* length on <var_nclassdefs:ANodes[AClassdef]>*/;
141 { /* Inline kernel#Int#!= (var3,var4) */
153 var11
= "Fatal Error: not a classdef";
155 var13
= string__NativeString__to_s_with_length(var11
, var12
);
159 ((void (*)(val
*, val
*, val
*))(self
->class->vft
[COLOR_toolcontext__ToolContext__fatal_error
]))(self
, var9
, var10
) /* fatal_error on <self:ToolContext>*/;
160 fprintf(stderr
, "Runtime error: %s", "Aborted");
161 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 47);
165 var14
= ((val
* (*)(val
*))(var_nclassdefs
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var_nclassdefs
) /* first on <var_nclassdefs:ANodes[AClassdef]>*/;
171 /* method parser_util#ToolContext#parse_classdef for (self: Object, String): AClassdef */
172 val
* VIRTUAL_parser_util__ToolContext__parse_classdef(val
* self
, val
* p0
) {
173 val
* var
/* : AClassdef */;
174 val
* var1
/* : AClassdef */;
175 var1
= parser_util__ToolContext__parse_classdef(self
, p0
);
180 /* method parser_util#ToolContext#parse_propdef for (self: ToolContext, String): APropdef */
181 val
* parser_util__ToolContext__parse_propdef(val
* self
, val
* p0
) {
182 val
* var
/* : APropdef */;
183 val
* var_string
/* var string: String */;
184 val
* var1
/* : Array[Object] */;
185 long var2
/* : Int */;
186 val
* var_
/* var : Array[Object] */;
188 val
* var3
/* : String */;
189 char* var4
/* : NativeString */;
190 long var5
/* : Int */;
191 val
* var6
/* : String */;
192 static val
* varonce7
;
193 val
* var8
/* : String */;
194 char* var9
/* : NativeString */;
195 long var10
/* : Int */;
196 val
* var11
/* : String */;
197 val
* var12
/* : String */;
198 val
* var_mod_string
/* var mod_string: String */;
199 val
* var13
/* : AClassdef */;
200 val
* var_nclassdef
/* var nclassdef: AClassdef */;
201 val
* var14
/* : ANodes[APropdef] */;
202 val
* var_npropdefs
/* var npropdefs: ANodes[APropdef] */;
203 long var15
/* : Int */;
204 long var16
/* : Int */;
205 short int var17
/* : Bool */;
206 short int var19
/* : Bool */;
207 short int var20
/* : Bool */;
208 val
* var21
/* : null */;
209 static val
* varonce22
;
210 val
* var23
/* : String */;
211 char* var24
/* : NativeString */;
212 long var25
/* : Int */;
213 val
* var26
/* : String */;
214 val
* var27
/* : nullable Object */;
216 var1
= NEW_array__Array(&type_array__Arraykernel__Object
);
218 ((void (*)(val
*, long))(var1
->class->vft
[COLOR_array__Array__with_capacity
]))(var1
, var2
) /* with_capacity on <var1:Array[Object]>*/;
223 var4
= "class Dummy\n";
225 var6
= string__NativeString__to_s_with_length(var4
, var5
);
229 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var3
) /* add on <var_:Array[Object]>*/;
230 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var_string
) /* add on <var_:Array[Object]>*/;
236 var11
= string__NativeString__to_s_with_length(var9
, var10
);
240 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var8
) /* add on <var_:Array[Object]>*/;
241 var12
= ((val
* (*)(val
*))(var_
->class->vft
[COLOR_string__Object__to_s
]))(var_
) /* to_s on <var_:Array[Object]>*/;
242 var_mod_string
= var12
;
243 var13
= ((val
* (*)(val
*, val
*))(self
->class->vft
[COLOR_parser_util__ToolContext__parse_classdef
]))(self
, var_mod_string
) /* parse_classdef on <self:ToolContext>*/;
244 var_nclassdef
= var13
;
245 var14
= ((val
* (*)(val
*))(var_nclassdef
->class->vft
[COLOR_parser_nodes__AClassdef__n_propdefs
]))(var_nclassdef
) /* n_propdefs on <var_nclassdef:AClassdef>*/;
246 var_npropdefs
= var14
;
247 var15
= ((long (*)(val
*))(var_npropdefs
->class->vft
[COLOR_abstract_collection__Collection__length
]))(var_npropdefs
) /* length on <var_npropdefs:ANodes[APropdef]>*/;
249 { /* Inline kernel#Int#!= (var15,var16) */
250 var19
= var15
== var16
;
261 var24
= "Fatal Error: not a propdef";
263 var26
= string__NativeString__to_s_with_length(var24
, var25
);
267 ((void (*)(val
*, val
*, val
*))(self
->class->vft
[COLOR_toolcontext__ToolContext__fatal_error
]))(self
, var21
, var23
) /* fatal_error on <self:ToolContext>*/;
268 fprintf(stderr
, "Runtime error: %s", "Aborted");
269 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 61);
273 var27
= ((val
* (*)(val
*))(var_npropdefs
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var_npropdefs
) /* first on <var_npropdefs:ANodes[APropdef]>*/;
279 /* method parser_util#ToolContext#parse_propdef for (self: Object, String): APropdef */
280 val
* VIRTUAL_parser_util__ToolContext__parse_propdef(val
* self
, val
* p0
) {
281 val
* var
/* : APropdef */;
282 val
* var1
/* : APropdef */;
283 var1
= parser_util__ToolContext__parse_propdef(self
, p0
);
288 /* method parser_util#ToolContext#parse_stmts for (self: ToolContext, String): AExpr */
289 val
* parser_util__ToolContext__parse_stmts(val
* self
, val
* p0
) {
290 val
* var
/* : AExpr */;
291 val
* var_string
/* var string: String */;
292 val
* var1
/* : Array[Object] */;
293 long var2
/* : Int */;
294 val
* var_
/* var : Array[Object] */;
296 val
* var3
/* : String */;
297 char* var4
/* : NativeString */;
298 long var5
/* : Int */;
299 val
* var6
/* : String */;
300 static val
* varonce7
;
301 val
* var8
/* : String */;
302 char* var9
/* : NativeString */;
303 long var10
/* : Int */;
304 val
* var11
/* : String */;
305 val
* var12
/* : String */;
306 val
* var_mod_string
/* var mod_string: String */;
307 val
* var13
/* : AModule */;
308 val
* var_nmodule
/* var nmodule: AModule */;
309 val
* var14
/* : ANodes[AClassdef] */;
310 val
* var15
/* : nullable Object */;
311 val
* var16
/* : ANodes[APropdef] */;
312 val
* var17
/* : nullable Object */;
313 short int var18
/* : Bool */;
316 const char* var_class_name
;
317 val
* var19
/* : nullable AExpr */;
318 short int var20
/* : Bool */;
321 const char* var_class_name23
;
322 val
* var24
/* : ANodes[AExpr] */;
323 val
* var25
/* : nullable Object */;
324 short int var26
/* : Bool */;
327 const char* var_class_name29
;
328 val
* var30
/* : nullable AExpr */;
329 val
* var_nblock
/* var nblock: AExpr */;
331 var1
= NEW_array__Array(&type_array__Arraykernel__Object
);
333 ((void (*)(val
*, long))(var1
->class->vft
[COLOR_array__Array__with_capacity
]))(var1
, var2
) /* with_capacity on <var1:Array[Object]>*/;
340 var6
= string__NativeString__to_s_with_length(var4
, var5
);
344 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var3
) /* add on <var_:Array[Object]>*/;
345 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var_string
) /* add on <var_:Array[Object]>*/;
351 var11
= string__NativeString__to_s_with_length(var9
, var10
);
355 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var8
) /* add on <var_:Array[Object]>*/;
356 var12
= ((val
* (*)(val
*))(var_
->class->vft
[COLOR_string__Object__to_s
]))(var_
) /* to_s on <var_:Array[Object]>*/;
357 var_mod_string
= var12
;
358 var13
= ((val
* (*)(val
*, val
*))(self
->class->vft
[COLOR_parser_util__ToolContext__parse_module
]))(self
, var_mod_string
) /* parse_module on <self:ToolContext>*/;
360 var14
= ((val
* (*)(val
*))(var_nmodule
->class->vft
[COLOR_parser_nodes__AModule__n_classdefs
]))(var_nmodule
) /* n_classdefs on <var_nmodule:AModule>*/;
361 var15
= ((val
* (*)(val
*))(var14
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var14
) /* first on <var14:ANodes[AClassdef]>*/;
362 var16
= ((val
* (*)(val
*))(var15
->class->vft
[COLOR_parser_nodes__AClassdef__n_propdefs
]))(var15
) /* n_propdefs on <var15:nullable Object(AClassdef)>*/;
363 var17
= ((val
* (*)(val
*))(var16
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var16
) /* first on <var16:ANodes[APropdef]>*/;
364 /* <var17:nullable Object(APropdef)> isa AMainMethPropdef */
365 cltype
= type_parser_nodes__AMainMethPropdef
.color
;
366 idtype
= type_parser_nodes__AMainMethPropdef
.id
;
367 if(cltype
>= var17
->type
->table_size
) {
370 var18
= var17
->type
->type_table
[cltype
] == idtype
;
373 var_class_name
= var17
== NULL ?
"null" : var17
->type
->name
;
374 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AMainMethPropdef", var_class_name
);
375 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 72);
378 var19
= ((val
* (*)(val
*))(var17
->class->vft
[COLOR_parser_nodes__AConcreteMethPropdef__n_block
]))(var17
) /* n_block on <var17:APropdef(AMainMethPropdef)>*/;
379 /* <var19:nullable AExpr> isa ABlockExpr */
380 cltype21
= type_parser_nodes__ABlockExpr
.color
;
381 idtype22
= type_parser_nodes__ABlockExpr
.id
;
385 if(cltype21
>= var19
->type
->table_size
) {
388 var20
= var19
->type
->type_table
[cltype21
] == idtype22
;
392 var_class_name23
= var19
== NULL ?
"null" : var19
->type
->name
;
393 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ABlockExpr", var_class_name23
);
394 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 72);
397 var24
= ((val
* (*)(val
*))(var19
->class->vft
[COLOR_parser_nodes__ABlockExpr__n_expr
]))(var19
) /* n_expr on <var19:nullable AExpr(ABlockExpr)>*/;
398 var25
= ((val
* (*)(val
*))(var24
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var24
) /* first on <var24:ANodes[AExpr]>*/;
399 /* <var25:nullable Object(AExpr)> isa ADoExpr */
400 cltype27
= type_parser_nodes__ADoExpr
.color
;
401 idtype28
= type_parser_nodes__ADoExpr
.id
;
402 if(cltype27
>= var25
->type
->table_size
) {
405 var26
= var25
->type
->type_table
[cltype27
] == idtype28
;
408 var_class_name29
= var25
== NULL ?
"null" : var25
->type
->name
;
409 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ADoExpr", var_class_name29
);
410 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 72);
413 var30
= ((val
* (*)(val
*))(var25
->class->vft
[COLOR_parser_nodes__ADoExpr__n_block
]))(var25
) /* n_block on <var25:AExpr(ADoExpr)>*/;
415 fprintf(stderr
, "Runtime error: %s", "Cast failed");
416 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 72);
425 /* method parser_util#ToolContext#parse_stmts for (self: Object, String): AExpr */
426 val
* VIRTUAL_parser_util__ToolContext__parse_stmts(val
* self
, val
* p0
) {
427 val
* var
/* : AExpr */;
428 val
* var1
/* : AExpr */;
429 var1
= parser_util__ToolContext__parse_stmts(self
, p0
);
434 /* method parser_util#ToolContext#parse_expr for (self: ToolContext, String): AExpr */
435 val
* parser_util__ToolContext__parse_expr(val
* self
, val
* p0
) {
436 val
* var
/* : AExpr */;
437 val
* var_string
/* var string: String */;
438 val
* var1
/* : Array[Object] */;
439 long var2
/* : Int */;
440 val
* var_
/* var : Array[Object] */;
442 val
* var3
/* : String */;
443 char* var4
/* : NativeString */;
444 long var5
/* : Int */;
445 val
* var6
/* : String */;
446 static val
* varonce7
;
447 val
* var8
/* : String */;
448 char* var9
/* : NativeString */;
449 long var10
/* : Int */;
450 val
* var11
/* : String */;
451 val
* var12
/* : String */;
452 val
* var_mod_string
/* var mod_string: String */;
453 val
* var13
/* : AModule */;
454 val
* var_nmodule
/* var nmodule: AModule */;
455 val
* var14
/* : ANodes[AClassdef] */;
456 val
* var15
/* : nullable Object */;
457 val
* var16
/* : ANodes[APropdef] */;
458 val
* var17
/* : nullable Object */;
459 short int var18
/* : Bool */;
462 const char* var_class_name
;
463 val
* var19
/* : nullable AExpr */;
464 short int var20
/* : Bool */;
467 const char* var_class_name23
;
468 val
* var24
/* : ANodes[AExpr] */;
469 val
* var25
/* : nullable Object */;
470 short int var26
/* : Bool */;
473 const char* var_class_name29
;
474 val
* var30
/* : nullable AExpr */;
475 val
* var_nexpr
/* var nexpr: AExpr */;
477 var1
= NEW_array__Array(&type_array__Arraykernel__Object
);
479 ((void (*)(val
*, long))(var1
->class->vft
[COLOR_array__Array__with_capacity
]))(var1
, var2
) /* with_capacity on <var1:Array[Object]>*/;
484 var4
= "var dummy = \n";
486 var6
= string__NativeString__to_s_with_length(var4
, var5
);
490 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var3
) /* add on <var_:Array[Object]>*/;
491 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var_string
) /* add on <var_:Array[Object]>*/;
497 var11
= string__NativeString__to_s_with_length(var9
, var10
);
501 ((void (*)(val
*, val
*))(var_
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var_
, var8
) /* add on <var_:Array[Object]>*/;
502 var12
= ((val
* (*)(val
*))(var_
->class->vft
[COLOR_string__Object__to_s
]))(var_
) /* to_s on <var_:Array[Object]>*/;
503 var_mod_string
= var12
;
504 var13
= ((val
* (*)(val
*, val
*))(self
->class->vft
[COLOR_parser_util__ToolContext__parse_module
]))(self
, var_mod_string
) /* parse_module on <self:ToolContext>*/;
506 var14
= ((val
* (*)(val
*))(var_nmodule
->class->vft
[COLOR_parser_nodes__AModule__n_classdefs
]))(var_nmodule
) /* n_classdefs on <var_nmodule:AModule>*/;
507 var15
= ((val
* (*)(val
*))(var14
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var14
) /* first on <var14:ANodes[AClassdef]>*/;
508 var16
= ((val
* (*)(val
*))(var15
->class->vft
[COLOR_parser_nodes__AClassdef__n_propdefs
]))(var15
) /* n_propdefs on <var15:nullable Object(AClassdef)>*/;
509 var17
= ((val
* (*)(val
*))(var16
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var16
) /* first on <var16:ANodes[APropdef]>*/;
510 /* <var17:nullable Object(APropdef)> isa AMainMethPropdef */
511 cltype
= type_parser_nodes__AMainMethPropdef
.color
;
512 idtype
= type_parser_nodes__AMainMethPropdef
.id
;
513 if(cltype
>= var17
->type
->table_size
) {
516 var18
= var17
->type
->type_table
[cltype
] == idtype
;
519 var_class_name
= var17
== NULL ?
"null" : var17
->type
->name
;
520 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AMainMethPropdef", var_class_name
);
521 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 82);
524 var19
= ((val
* (*)(val
*))(var17
->class->vft
[COLOR_parser_nodes__AConcreteMethPropdef__n_block
]))(var17
) /* n_block on <var17:APropdef(AMainMethPropdef)>*/;
525 /* <var19:nullable AExpr> isa ABlockExpr */
526 cltype21
= type_parser_nodes__ABlockExpr
.color
;
527 idtype22
= type_parser_nodes__ABlockExpr
.id
;
531 if(cltype21
>= var19
->type
->table_size
) {
534 var20
= var19
->type
->type_table
[cltype21
] == idtype22
;
538 var_class_name23
= var19
== NULL ?
"null" : var19
->type
->name
;
539 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ABlockExpr", var_class_name23
);
540 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 82);
543 var24
= ((val
* (*)(val
*))(var19
->class->vft
[COLOR_parser_nodes__ABlockExpr__n_expr
]))(var19
) /* n_expr on <var19:nullable AExpr(ABlockExpr)>*/;
544 var25
= ((val
* (*)(val
*))(var24
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var24
) /* first on <var24:ANodes[AExpr]>*/;
545 /* <var25:nullable Object(AExpr)> isa AVardeclExpr */
546 cltype27
= type_parser_nodes__AVardeclExpr
.color
;
547 idtype28
= type_parser_nodes__AVardeclExpr
.id
;
548 if(cltype27
>= var25
->type
->table_size
) {
551 var26
= var25
->type
->type_table
[cltype27
] == idtype28
;
554 var_class_name29
= var25
== NULL ?
"null" : var25
->type
->name
;
555 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AVardeclExpr", var_class_name29
);
556 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 82);
559 var30
= ((val
* (*)(val
*))(var25
->class->vft
[COLOR_parser_nodes__AVardeclExpr__n_expr
]))(var25
) /* n_expr on <var25:AExpr(AVardeclExpr)>*/;
561 fprintf(stderr
, "Runtime error: %s", "Cast failed");
562 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 82);
571 /* method parser_util#ToolContext#parse_expr for (self: Object, String): AExpr */
572 val
* VIRTUAL_parser_util__ToolContext__parse_expr(val
* self
, val
* p0
) {
573 val
* var
/* : AExpr */;
574 val
* var1
/* : AExpr */;
575 var1
= parser_util__ToolContext__parse_expr(self
, p0
);
580 /* method parser_util#ToolContext#parse_something for (self: ToolContext, String): ANode */
581 val
* parser_util__ToolContext__parse_something(val
* self
, val
* p0
) {
582 val
* var
/* : ANode */;
583 val
* var_string
/* var string: String */;
584 val
* var1
/* : SourceFile */;
586 val
* var2
/* : String */;
587 char* var3
/* : NativeString */;
588 long var4
/* : Int */;
589 val
* var5
/* : String */;
590 val
* var_source
/* var source: SourceFile */;
591 val
* var6
/* : InjectedLexer */;
592 val
* var_lexer
/* var lexer: nullable Object */;
593 val
* var7
/* : List[Token] */;
594 val
* var8
/* : TKwvar */;
595 val
* var9
/* : List[Token] */;
596 val
* var10
/* : TId */;
597 val
* var11
/* : List[Token] */;
598 val
* var12
/* : TColumn */;
599 val
* var13
/* : List[Token] */;
600 val
* var14
/* : TClassid */;
601 val
* var15
/* : List[Token] */;
602 val
* var16
/* : TObra */;
603 val
* var17
/* : List[Token] */;
604 val
* var18
/* : TCbra */;
605 val
* var19
/* : Parser */;
606 val
* var20
/* : Start */;
607 val
* var_tree
/* var tree: nullable Object */;
608 val
* var21
/* : EOF */;
609 val
* var_eof
/* var eof: nullable Object */;
610 short int var22
/* : Bool */;
613 short int var23
/* : Bool */;
614 val
* var24
/* : nullable AModule */;
615 val
* var25
/* : ANodes[AClassdef] */;
616 val
* var26
/* : nullable Object */;
617 val
* var27
/* : ANodes[APropdef] */;
618 val
* var28
/* : nullable Object */;
619 short int var29
/* : Bool */;
622 const char* var_class_name
;
623 val
* var32
/* : nullable AExpr */;
624 short int var33
/* : Bool */;
627 const char* var_class_name36
;
628 val
* var37
/* : ANodes[AExpr] */;
629 val
* var38
/* : nullable Object */;
630 short int var39
/* : Bool */;
633 const char* var_class_name42
;
634 val
* var43
/* : nullable AType */;
635 val
* var44
/* : ANodes[AType] */;
636 val
* var45
/* : nullable Object */;
637 val
* var_ntype
/* var ntype: AType */;
638 val
* var_error
/* var error: nullable Object */;
639 val
* var46
/* : Lexer */;
640 val
* var47
/* : Token */;
641 val
* var_first
/* var first: Token */;
642 short int var48
/* : Bool */;
645 short int var51
/* : Bool */;
646 val
* var52
/* : Token */;
647 val
* var_second
/* var second: Token */;
648 short int var53
/* : Bool */;
649 short int var54
/* : Bool */;
652 short int var_
/* var : Bool */;
653 short int var57
/* : Bool */;
656 short int var60
/* : Bool */;
657 val
* var61
/* : InjectedLexer */;
658 val
* var62
/* : List[Token] */;
659 val
* var63
/* : TKwvar */;
660 val
* var64
/* : List[Token] */;
661 val
* var65
/* : TId */;
662 val
* var66
/* : List[Token] */;
663 val
* var67
/* : TAssign */;
664 val
* var68
/* : List[Token] */;
665 val
* var69
/* : TOpar */;
666 val
* var70
/* : List[Token] */;
667 val
* var71
/* : TCpar */;
668 val
* var72
/* : Parser */;
669 val
* var73
/* : Start */;
670 val
* var74
/* : EOF */;
671 short int var75
/* : Bool */;
674 short int var78
/* : Bool */;
675 val
* var79
/* : nullable AModule */;
676 val
* var80
/* : ANodes[AClassdef] */;
677 val
* var81
/* : nullable Object */;
678 val
* var82
/* : ANodes[APropdef] */;
679 val
* var83
/* : nullable Object */;
680 short int var84
/* : Bool */;
683 const char* var_class_name87
;
684 val
* var88
/* : nullable AExpr */;
685 short int var89
/* : Bool */;
688 const char* var_class_name92
;
689 val
* var93
/* : ANodes[AExpr] */;
690 val
* var94
/* : nullable Object */;
691 short int var95
/* : Bool */;
694 const char* var_class_name98
;
695 val
* var99
/* : nullable AExpr */;
696 short int var100
/* : Bool */;
699 const char* var_class_name103
;
700 val
* var104
/* : AExpr */;
701 val
* var_nexpr
/* var nexpr: AExpr */;
702 val
* var105
/* : Location */;
703 val
* var106
/* : Location */;
704 short int var107
/* : Bool */;
705 val
* var108
/* : InjectedLexer */;
706 val
* var109
/* : List[Token] */;
707 val
* var110
/* : TKwdo */;
708 val
* var111
/* : List[Token] */;
709 val
* var112
/* : TKwend */;
710 val
* var113
/* : Parser */;
711 val
* var114
/* : Start */;
712 val
* var115
/* : EOF */;
713 short int var116
/* : Bool */;
716 short int var119
/* : Bool */;
717 val
* var120
/* : nullable AModule */;
718 val
* var121
/* : ANodes[AClassdef] */;
719 val
* var122
/* : nullable Object */;
720 val
* var123
/* : ANodes[APropdef] */;
721 val
* var124
/* : nullable Object */;
722 short int var125
/* : Bool */;
725 const char* var_class_name128
;
726 val
* var129
/* : nullable AExpr */;
727 short int var130
/* : Bool */;
730 const char* var_class_name133
;
731 val
* var134
/* : ANodes[AExpr] */;
732 val
* var135
/* : nullable Object */;
733 short int var136
/* : Bool */;
736 const char* var_class_name139
;
737 val
* var140
/* : nullable AExpr */;
738 val
* var_nblock
/* var nblock: AExpr */;
739 val
* var141
/* : Location */;
740 val
* var142
/* : Location */;
741 short int var143
/* : Bool */;
742 val
* var144
/* : Lexer */;
743 val
* var145
/* : Parser */;
744 val
* var146
/* : Start */;
745 val
* var147
/* : EOF */;
746 short int var148
/* : Bool */;
749 short int var151
/* : Bool */;
750 val
* var152
/* : nullable AModule */;
751 val
* var153
/* : Location */;
752 val
* var154
/* : Location */;
753 short int var155
/* : Bool */;
755 var1
= NEW_location__SourceFile(&type_location__SourceFile
);
761 var5
= string__NativeString__to_s_with_length(var3
, var4
);
765 ((void (*)(val
*, val
*, val
*))(var1
->class->vft
[COLOR_location__SourceFile__from_string
]))(var1
, var2
, var_string
) /* from_string on <var1:SourceFile>*/;
767 var6
= NEW_parser_util__InjectedLexer(&type_parser_util__InjectedLexer
);
768 ((void (*)(val
*, val
*))(var6
->class->vft
[COLOR_lexer__Lexer__init
]))(var6
, var_source
) /* init on <var6:InjectedLexer>*/;
770 var7
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
771 var8
= NEW_parser_nodes__TKwvar(&type_parser_nodes__TKwvar
);
772 ((void (*)(val
*))(var8
->class->vft
[COLOR_parser_nodes__TKwvar__init
]))(var8
) /* init on <var8:TKwvar>*/;
773 ((void (*)(val
*, val
*))(var7
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var7
, var8
) /* add on <var7:List[Token]>*/;
774 var9
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
775 var10
= NEW_parser_nodes__TId(&type_parser_nodes__TId
);
776 ((void (*)(val
*))(var10
->class->vft
[COLOR_parser_nodes__TId__init
]))(var10
) /* init on <var10:TId>*/;
777 ((void (*)(val
*, val
*))(var9
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var9
, var10
) /* add on <var9:List[Token]>*/;
778 var11
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
779 var12
= NEW_parser_nodes__TColumn(&type_parser_nodes__TColumn
);
780 ((void (*)(val
*))(var12
->class->vft
[COLOR_parser_nodes__TColumn__init
]))(var12
) /* init on <var12:TColumn>*/;
781 ((void (*)(val
*, val
*))(var11
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var11
, var12
) /* add on <var11:List[Token]>*/;
782 var13
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
783 var14
= NEW_parser_nodes__TClassid(&type_parser_nodes__TClassid
);
784 ((void (*)(val
*))(var14
->class->vft
[COLOR_parser_nodes__TClassid__init
]))(var14
) /* init on <var14:TClassid>*/;
785 ((void (*)(val
*, val
*))(var13
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var13
, var14
) /* add on <var13:List[Token]>*/;
786 var15
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
787 var16
= NEW_parser_nodes__TObra(&type_parser_nodes__TObra
);
788 ((void (*)(val
*))(var16
->class->vft
[COLOR_parser_nodes__TObra__init
]))(var16
) /* init on <var16:TObra>*/;
789 ((void (*)(val
*, val
*))(var15
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var15
, var16
) /* add on <var15:List[Token]>*/;
790 var17
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_after
]))(var_lexer
) /* injected_after on <var_lexer:nullable Object(InjectedLexer)>*/;
791 var18
= NEW_parser_nodes__TCbra(&type_parser_nodes__TCbra
);
792 ((void (*)(val
*))(var18
->class->vft
[COLOR_parser_nodes__TCbra__init
]))(var18
) /* init on <var18:TCbra>*/;
793 ((void (*)(val
*, val
*))(var17
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var17
, var18
) /* add on <var17:List[Token]>*/;
794 var19
= NEW_parser__Parser(&type_parser__Parser
);
795 ((void (*)(val
*, val
*))(var19
->class->vft
[COLOR_parser__Parser__init
]))(var19
, var_lexer
) /* init on <var19:Parser>*/;
796 var20
= ((val
* (*)(val
*))(var19
->class->vft
[COLOR_parser__Parser__parse
]))(var19
) /* parse on <var19:Parser>*/;
798 var21
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_eof
]))(var_tree
) /* n_eof on <var_tree:nullable Object(Start)>*/;
800 /* <var_eof:nullable Object(EOF)> isa AError */
801 cltype
= type_parser_nodes__AError
.color
;
802 idtype
= type_parser_nodes__AError
.id
;
803 if(cltype
>= var_eof
->type
->table_size
) {
806 var22
= var_eof
->type
->type_table
[cltype
] == idtype
;
810 var24
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_base
]))(var_tree
) /* n_base on <var_tree:nullable Object(Start)>*/;
812 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
813 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 114);
816 var25
= ((val
* (*)(val
*))(var24
->class->vft
[COLOR_parser_nodes__AModule__n_classdefs
]))(var24
) /* n_classdefs on <var24:nullable AModule>*/;
818 var26
= ((val
* (*)(val
*))(var25
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var25
) /* first on <var25:ANodes[AClassdef]>*/;
819 var27
= ((val
* (*)(val
*))(var26
->class->vft
[COLOR_parser_nodes__AClassdef__n_propdefs
]))(var26
) /* n_propdefs on <var26:nullable Object(AClassdef)>*/;
820 var28
= ((val
* (*)(val
*))(var27
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var27
) /* first on <var27:ANodes[APropdef]>*/;
821 /* <var28:nullable Object(APropdef)> isa AMainMethPropdef */
822 cltype30
= type_parser_nodes__AMainMethPropdef
.color
;
823 idtype31
= type_parser_nodes__AMainMethPropdef
.id
;
824 if(cltype30
>= var28
->type
->table_size
) {
827 var29
= var28
->type
->type_table
[cltype30
] == idtype31
;
830 var_class_name
= var28
== NULL ?
"null" : var28
->type
->name
;
831 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AMainMethPropdef", var_class_name
);
832 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 114);
835 var32
= ((val
* (*)(val
*))(var28
->class->vft
[COLOR_parser_nodes__AConcreteMethPropdef__n_block
]))(var28
) /* n_block on <var28:APropdef(AMainMethPropdef)>*/;
836 /* <var32:nullable AExpr> isa ABlockExpr */
837 cltype34
= type_parser_nodes__ABlockExpr
.color
;
838 idtype35
= type_parser_nodes__ABlockExpr
.id
;
842 if(cltype34
>= var32
->type
->table_size
) {
845 var33
= var32
->type
->type_table
[cltype34
] == idtype35
;
849 var_class_name36
= var32
== NULL ?
"null" : var32
->type
->name
;
850 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ABlockExpr", var_class_name36
);
851 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 114);
854 var37
= ((val
* (*)(val
*))(var32
->class->vft
[COLOR_parser_nodes__ABlockExpr__n_expr
]))(var32
) /* n_expr on <var32:nullable AExpr(ABlockExpr)>*/;
855 var38
= ((val
* (*)(val
*))(var37
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var37
) /* first on <var37:ANodes[AExpr]>*/;
856 /* <var38:nullable Object(AExpr)> isa AVardeclExpr */
857 cltype40
= type_parser_nodes__AVardeclExpr
.color
;
858 idtype41
= type_parser_nodes__AVardeclExpr
.id
;
859 if(cltype40
>= var38
->type
->table_size
) {
862 var39
= var38
->type
->type_table
[cltype40
] == idtype41
;
865 var_class_name42
= var38
== NULL ?
"null" : var38
->type
->name
;
866 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AVardeclExpr", var_class_name42
);
867 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 114);
870 var43
= ((val
* (*)(val
*))(var38
->class->vft
[COLOR_parser_nodes__AVardeclExpr__n_type
]))(var38
) /* n_type on <var38:AExpr(AVardeclExpr)>*/;
872 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
873 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 114);
876 var44
= ((val
* (*)(val
*))(var43
->class->vft
[COLOR_parser_nodes__AType__n_types
]))(var43
) /* n_types on <var43:nullable AType>*/;
878 var45
= ((val
* (*)(val
*))(var44
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var44
) /* first on <var44:ANodes[AType]>*/;
885 var46
= NEW_lexer__Lexer(&type_lexer__Lexer
);
886 ((void (*)(val
*, val
*))(var46
->class->vft
[COLOR_lexer__Lexer__init
]))(var46
, var_source
) /* init on <var46:Lexer>*/;
888 var47
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_lexer__Lexer__next
]))(var_lexer
) /* next on <var_lexer:nullable Object(Lexer)>*/;
890 /* <var_first:Token> isa EOF */
891 cltype49
= type_parser_nodes__EOF
.color
;
892 idtype50
= type_parser_nodes__EOF
.id
;
893 if(cltype49
>= var_first
->type
->table_size
) {
896 var48
= var_first
->type
->type_table
[cltype49
] == idtype50
;
900 var52
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_lexer__Lexer__next
]))(var_lexer
) /* next on <var_lexer:nullable Object(Lexer)>*/;
902 /* <var_second:Token> isa EOF */
903 cltype55
= type_parser_nodes__EOF
.color
;
904 idtype56
= type_parser_nodes__EOF
.id
;
905 if(cltype55
>= var_second
->type
->table_size
) {
908 var54
= var_second
->type
->type_table
[cltype55
] == idtype56
;
912 /* <var_second:Token(EOF)> isa AError */
913 cltype58
= type_parser_nodes__AError
.color
;
914 idtype59
= type_parser_nodes__AError
.id
;
915 if(cltype58
>= var_second
->type
->table_size
) {
918 var57
= var_second
->type
->type_table
[cltype58
] == idtype59
;
932 var61
= NEW_parser_util__InjectedLexer(&type_parser_util__InjectedLexer
);
933 ((void (*)(val
*, val
*))(var61
->class->vft
[COLOR_lexer__Lexer__init
]))(var61
, var_source
) /* init on <var61:InjectedLexer>*/;
935 var62
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
936 var63
= NEW_parser_nodes__TKwvar(&type_parser_nodes__TKwvar
);
937 ((void (*)(val
*))(var63
->class->vft
[COLOR_parser_nodes__TKwvar__init
]))(var63
) /* init on <var63:TKwvar>*/;
938 ((void (*)(val
*, val
*))(var62
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var62
, var63
) /* add on <var62:List[Token]>*/;
939 var64
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
940 var65
= NEW_parser_nodes__TId(&type_parser_nodes__TId
);
941 ((void (*)(val
*))(var65
->class->vft
[COLOR_parser_nodes__TId__init
]))(var65
) /* init on <var65:TId>*/;
942 ((void (*)(val
*, val
*))(var64
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var64
, var65
) /* add on <var64:List[Token]>*/;
943 var66
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
944 var67
= NEW_parser_nodes__TAssign(&type_parser_nodes__TAssign
);
945 ((void (*)(val
*))(var67
->class->vft
[COLOR_parser_nodes__TAssign__init
]))(var67
) /* init on <var67:TAssign>*/;
946 ((void (*)(val
*, val
*))(var66
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var66
, var67
) /* add on <var66:List[Token]>*/;
947 var68
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
948 var69
= NEW_parser_nodes__TOpar(&type_parser_nodes__TOpar
);
949 ((void (*)(val
*))(var69
->class->vft
[COLOR_parser_nodes__TOpar__init
]))(var69
) /* init on <var69:TOpar>*/;
950 ((void (*)(val
*, val
*))(var68
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var68
, var69
) /* add on <var68:List[Token]>*/;
951 var70
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_after
]))(var_lexer
) /* injected_after on <var_lexer:nullable Object(InjectedLexer)>*/;
952 var71
= NEW_parser_nodes__TCpar(&type_parser_nodes__TCpar
);
953 ((void (*)(val
*))(var71
->class->vft
[COLOR_parser_nodes__TCpar__init
]))(var71
) /* init on <var71:TCpar>*/;
954 ((void (*)(val
*, val
*))(var70
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var70
, var71
) /* add on <var70:List[Token]>*/;
955 var72
= NEW_parser__Parser(&type_parser__Parser
);
956 ((void (*)(val
*, val
*))(var72
->class->vft
[COLOR_parser__Parser__init
]))(var72
, var_lexer
) /* init on <var72:Parser>*/;
957 var73
= ((val
* (*)(val
*))(var72
->class->vft
[COLOR_parser__Parser__parse
]))(var72
) /* parse on <var72:Parser>*/;
959 var74
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_eof
]))(var_tree
) /* n_eof on <var_tree:nullable Object(Start)>*/;
961 /* <var_eof:nullable Object(EOF)> isa AError */
962 cltype76
= type_parser_nodes__AError
.color
;
963 idtype77
= type_parser_nodes__AError
.id
;
964 if(cltype76
>= var_eof
->type
->table_size
) {
967 var75
= var_eof
->type
->type_table
[cltype76
] == idtype77
;
971 var79
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_base
]))(var_tree
) /* n_base on <var_tree:nullable Object(Start)>*/;
973 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
974 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 137);
977 var80
= ((val
* (*)(val
*))(var79
->class->vft
[COLOR_parser_nodes__AModule__n_classdefs
]))(var79
) /* n_classdefs on <var79:nullable AModule>*/;
979 var81
= ((val
* (*)(val
*))(var80
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var80
) /* first on <var80:ANodes[AClassdef]>*/;
980 var82
= ((val
* (*)(val
*))(var81
->class->vft
[COLOR_parser_nodes__AClassdef__n_propdefs
]))(var81
) /* n_propdefs on <var81:nullable Object(AClassdef)>*/;
981 var83
= ((val
* (*)(val
*))(var82
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var82
) /* first on <var82:ANodes[APropdef]>*/;
982 /* <var83:nullable Object(APropdef)> isa AMainMethPropdef */
983 cltype85
= type_parser_nodes__AMainMethPropdef
.color
;
984 idtype86
= type_parser_nodes__AMainMethPropdef
.id
;
985 if(cltype85
>= var83
->type
->table_size
) {
988 var84
= var83
->type
->type_table
[cltype85
] == idtype86
;
991 var_class_name87
= var83
== NULL ?
"null" : var83
->type
->name
;
992 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AMainMethPropdef", var_class_name87
);
993 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 137);
996 var88
= ((val
* (*)(val
*))(var83
->class->vft
[COLOR_parser_nodes__AConcreteMethPropdef__n_block
]))(var83
) /* n_block on <var83:APropdef(AMainMethPropdef)>*/;
997 /* <var88:nullable AExpr> isa ABlockExpr */
998 cltype90
= type_parser_nodes__ABlockExpr
.color
;
999 idtype91
= type_parser_nodes__ABlockExpr
.id
;
1003 if(cltype90
>= var88
->type
->table_size
) {
1006 var89
= var88
->type
->type_table
[cltype90
] == idtype91
;
1010 var_class_name92
= var88
== NULL ?
"null" : var88
->type
->name
;
1011 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ABlockExpr", var_class_name92
);
1012 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 137);
1015 var93
= ((val
* (*)(val
*))(var88
->class->vft
[COLOR_parser_nodes__ABlockExpr__n_expr
]))(var88
) /* n_expr on <var88:nullable AExpr(ABlockExpr)>*/;
1016 var94
= ((val
* (*)(val
*))(var93
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var93
) /* first on <var93:ANodes[AExpr]>*/;
1017 /* <var94:nullable Object(AExpr)> isa AVardeclExpr */
1018 cltype96
= type_parser_nodes__AVardeclExpr
.color
;
1019 idtype97
= type_parser_nodes__AVardeclExpr
.id
;
1020 if(cltype96
>= var94
->type
->table_size
) {
1023 var95
= var94
->type
->type_table
[cltype96
] == idtype97
;
1026 var_class_name98
= var94
== NULL ?
"null" : var94
->type
->name
;
1027 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AVardeclExpr", var_class_name98
);
1028 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 137);
1031 var99
= ((val
* (*)(val
*))(var94
->class->vft
[COLOR_parser_nodes__AVardeclExpr__n_expr
]))(var94
) /* n_expr on <var94:AExpr(AVardeclExpr)>*/;
1032 /* <var99:nullable AExpr> isa AParExpr */
1033 cltype101
= type_parser_nodes__AParExpr
.color
;
1034 idtype102
= type_parser_nodes__AParExpr
.id
;
1038 if(cltype101
>= var99
->type
->table_size
) {
1041 var100
= var99
->type
->type_table
[cltype101
] == idtype102
;
1045 var_class_name103
= var99
== NULL ?
"null" : var99
->type
->name
;
1046 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AParExpr", var_class_name103
);
1047 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 137);
1050 var104
= ((val
* (*)(val
*))(var99
->class->vft
[COLOR_parser_nodes__AProxyExpr__n_expr
]))(var99
) /* n_expr on <var99:nullable AExpr(AParExpr)>*/;
1056 var105
= ((val
* (*)(val
*))(var_eof
->class->vft
[COLOR_parser_nodes__ANode__location
]))(var_eof
) /* location on <var_eof:nullable Object(AError)>*/;
1057 var106
= ((val
* (*)(val
*))(var_error
->class->vft
[COLOR_parser_nodes__ANode__location
]))(var_error
) /* location on <var_error:nullable Object(AError)>*/;
1058 var107
= ((short int (*)(val
*, val
*))(var105
->class->vft
[COLOR_kernel__Comparable___62d
]))(var105
, var106
) /* > on <var105:Location>*/;
1060 var_error
= var_eof
;
1063 var108
= NEW_parser_util__InjectedLexer(&type_parser_util__InjectedLexer
);
1064 ((void (*)(val
*, val
*))(var108
->class->vft
[COLOR_lexer__Lexer__init
]))(var108
, var_source
) /* init on <var108:InjectedLexer>*/;
1066 var109
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(var_lexer
) /* injected_before on <var_lexer:nullable Object(InjectedLexer)>*/;
1067 var110
= NEW_parser_nodes__TKwdo(&type_parser_nodes__TKwdo
);
1068 ((void (*)(val
*))(var110
->class->vft
[COLOR_parser_nodes__TKwdo__init
]))(var110
) /* init on <var110:TKwdo>*/;
1069 ((void (*)(val
*, val
*))(var109
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var109
, var110
) /* add on <var109:List[Token]>*/;
1070 var111
= ((val
* (*)(val
*))(var_lexer
->class->vft
[COLOR_parser_util__InjectedLexer__injected_after
]))(var_lexer
) /* injected_after on <var_lexer:nullable Object(InjectedLexer)>*/;
1071 var112
= NEW_parser_nodes__TKwend(&type_parser_nodes__TKwend
);
1072 ((void (*)(val
*))(var112
->class->vft
[COLOR_parser_nodes__TKwend__init
]))(var112
) /* init on <var112:TKwend>*/;
1073 ((void (*)(val
*, val
*))(var111
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var111
, var112
) /* add on <var111:List[Token]>*/;
1074 var113
= NEW_parser__Parser(&type_parser__Parser
);
1075 ((void (*)(val
*, val
*))(var113
->class->vft
[COLOR_parser__Parser__init
]))(var113
, var_lexer
) /* init on <var113:Parser>*/;
1076 var114
= ((val
* (*)(val
*))(var113
->class->vft
[COLOR_parser__Parser__parse
]))(var113
) /* parse on <var113:Parser>*/;
1078 var115
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_eof
]))(var_tree
) /* n_eof on <var_tree:nullable Object(Start)>*/;
1080 /* <var_eof:nullable Object(EOF)> isa AError */
1081 cltype117
= type_parser_nodes__AError
.color
;
1082 idtype118
= type_parser_nodes__AError
.id
;
1083 if(cltype117
>= var_eof
->type
->table_size
) {
1086 var116
= var_eof
->type
->type_table
[cltype117
] == idtype118
;
1090 var120
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_base
]))(var_tree
) /* n_base on <var_tree:nullable Object(Start)>*/;
1091 if (var120
== NULL
) {
1092 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
1093 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 148);
1096 var121
= ((val
* (*)(val
*))(var120
->class->vft
[COLOR_parser_nodes__AModule__n_classdefs
]))(var120
) /* n_classdefs on <var120:nullable AModule>*/;
1098 var122
= ((val
* (*)(val
*))(var121
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var121
) /* first on <var121:ANodes[AClassdef]>*/;
1099 var123
= ((val
* (*)(val
*))(var122
->class->vft
[COLOR_parser_nodes__AClassdef__n_propdefs
]))(var122
) /* n_propdefs on <var122:nullable Object(AClassdef)>*/;
1100 var124
= ((val
* (*)(val
*))(var123
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var123
) /* first on <var123:ANodes[APropdef]>*/;
1101 /* <var124:nullable Object(APropdef)> isa AMainMethPropdef */
1102 cltype126
= type_parser_nodes__AMainMethPropdef
.color
;
1103 idtype127
= type_parser_nodes__AMainMethPropdef
.id
;
1104 if(cltype126
>= var124
->type
->table_size
) {
1107 var125
= var124
->type
->type_table
[cltype126
] == idtype127
;
1110 var_class_name128
= var124
== NULL ?
"null" : var124
->type
->name
;
1111 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AMainMethPropdef", var_class_name128
);
1112 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 148);
1115 var129
= ((val
* (*)(val
*))(var124
->class->vft
[COLOR_parser_nodes__AConcreteMethPropdef__n_block
]))(var124
) /* n_block on <var124:APropdef(AMainMethPropdef)>*/;
1116 /* <var129:nullable AExpr> isa ABlockExpr */
1117 cltype131
= type_parser_nodes__ABlockExpr
.color
;
1118 idtype132
= type_parser_nodes__ABlockExpr
.id
;
1119 if(var129
== NULL
) {
1122 if(cltype131
>= var129
->type
->table_size
) {
1125 var130
= var129
->type
->type_table
[cltype131
] == idtype132
;
1129 var_class_name133
= var129
== NULL ?
"null" : var129
->type
->name
;
1130 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ABlockExpr", var_class_name133
);
1131 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 148);
1134 var134
= ((val
* (*)(val
*))(var129
->class->vft
[COLOR_parser_nodes__ABlockExpr__n_expr
]))(var129
) /* n_expr on <var129:nullable AExpr(ABlockExpr)>*/;
1135 var135
= ((val
* (*)(val
*))(var134
->class->vft
[COLOR_abstract_collection__Collection__first
]))(var134
) /* first on <var134:ANodes[AExpr]>*/;
1136 /* <var135:nullable Object(AExpr)> isa ADoExpr */
1137 cltype137
= type_parser_nodes__ADoExpr
.color
;
1138 idtype138
= type_parser_nodes__ADoExpr
.id
;
1139 if(cltype137
>= var135
->type
->table_size
) {
1142 var136
= var135
->type
->type_table
[cltype137
] == idtype138
;
1145 var_class_name139
= var135
== NULL ?
"null" : var135
->type
->name
;
1146 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "ADoExpr", var_class_name139
);
1147 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 148);
1150 var140
= ((val
* (*)(val
*))(var135
->class->vft
[COLOR_parser_nodes__ADoExpr__n_block
]))(var135
) /* n_block on <var135:AExpr(ADoExpr)>*/;
1151 if (var140
== NULL
) {
1152 fprintf(stderr
, "Runtime error: %s", "Cast failed");
1153 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 148);
1156 var_nblock
= var140
;
1161 var141
= ((val
* (*)(val
*))(var_eof
->class->vft
[COLOR_parser_nodes__ANode__location
]))(var_eof
) /* location on <var_eof:nullable Object(AError)>*/;
1162 var142
= ((val
* (*)(val
*))(var_error
->class->vft
[COLOR_parser_nodes__ANode__location
]))(var_error
) /* location on <var_error:nullable Object(AError)>*/;
1163 var143
= ((short int (*)(val
*, val
*))(var141
->class->vft
[COLOR_kernel__Comparable___62d
]))(var141
, var142
) /* > on <var141:Location>*/;
1165 var_error
= var_eof
;
1168 var144
= NEW_lexer__Lexer(&type_lexer__Lexer
);
1169 ((void (*)(val
*, val
*))(var144
->class->vft
[COLOR_lexer__Lexer__init
]))(var144
, var_source
) /* init on <var144:Lexer>*/;
1171 var145
= NEW_parser__Parser(&type_parser__Parser
);
1172 ((void (*)(val
*, val
*))(var145
->class->vft
[COLOR_parser__Parser__init
]))(var145
, var_lexer
) /* init on <var145:Parser>*/;
1173 var146
= ((val
* (*)(val
*))(var145
->class->vft
[COLOR_parser__Parser__parse
]))(var145
) /* parse on <var145:Parser>*/;
1175 var147
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_eof
]))(var_tree
) /* n_eof on <var_tree:nullable Object(Start)>*/;
1177 /* <var_eof:nullable Object(EOF)> isa AError */
1178 cltype149
= type_parser_nodes__AError
.color
;
1179 idtype150
= type_parser_nodes__AError
.id
;
1180 if(cltype149
>= var_eof
->type
->table_size
) {
1183 var148
= var_eof
->type
->type_table
[cltype149
] == idtype150
;
1187 var152
= ((val
* (*)(val
*))(var_tree
->class->vft
[COLOR_parser_nodes__Start__n_base
]))(var_tree
) /* n_base on <var_tree:nullable Object(Start)>*/;
1188 if (var152
== NULL
) {
1189 fprintf(stderr
, "Runtime error: %s", "Cast failed");
1190 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 157);
1197 var153
= ((val
* (*)(val
*))(var_eof
->class->vft
[COLOR_parser_nodes__ANode__location
]))(var_eof
) /* location on <var_eof:nullable Object(AError)>*/;
1198 var154
= ((val
* (*)(val
*))(var_error
->class->vft
[COLOR_parser_nodes__ANode__location
]))(var_error
) /* location on <var_error:nullable Object(AError)>*/;
1199 var155
= ((short int (*)(val
*, val
*))(var153
->class->vft
[COLOR_kernel__Comparable___62d
]))(var153
, var154
) /* > on <var153:Location>*/;
1201 var_error
= var_eof
;
1209 /* method parser_util#ToolContext#parse_something for (self: Object, String): ANode */
1210 val
* VIRTUAL_parser_util__ToolContext__parse_something(val
* self
, val
* p0
) {
1211 val
* var
/* : ANode */;
1212 val
* var1
/* : ANode */;
1213 var1
= parser_util__ToolContext__parse_something(self
, p0
);
1218 /* method parser_util#InjectedLexer#injected_before for (self: InjectedLexer): List[Token] */
1219 val
* parser_util__InjectedLexer__injected_before(val
* self
) {
1220 val
* var
/* : List[Token] */;
1221 val
* var1
/* : List[Token] */;
1222 var1
= self
->attrs
[COLOR_parser_util__InjectedLexer___64dinjected_before
].val
; /* @injected_before on <self:InjectedLexer> */
1224 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @injected_before");
1225 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 168);
1232 /* method parser_util#InjectedLexer#injected_before for (self: Object): List[Token] */
1233 val
* VIRTUAL_parser_util__InjectedLexer__injected_before(val
* self
) {
1234 val
* var
/* : List[Token] */;
1235 val
* var1
/* : List[Token] */;
1236 var1
= parser_util__InjectedLexer__injected_before(self
);
1241 /* method parser_util#InjectedLexer#injected_before= for (self: InjectedLexer, List[Token]) */
1242 void parser_util__InjectedLexer__injected_before_61d(val
* self
, val
* p0
) {
1243 self
->attrs
[COLOR_parser_util__InjectedLexer___64dinjected_before
].val
= p0
; /* @injected_before on <self:InjectedLexer> */
1246 /* method parser_util#InjectedLexer#injected_before= for (self: Object, List[Token]) */
1247 void VIRTUAL_parser_util__InjectedLexer__injected_before_61d(val
* self
, val
* p0
) {
1248 parser_util__InjectedLexer__injected_before_61d(self
, p0
);
1251 /* method parser_util#InjectedLexer#injected_after for (self: InjectedLexer): List[Token] */
1252 val
* parser_util__InjectedLexer__injected_after(val
* self
) {
1253 val
* var
/* : List[Token] */;
1254 val
* var1
/* : List[Token] */;
1255 var1
= self
->attrs
[COLOR_parser_util__InjectedLexer___64dinjected_after
].val
; /* @injected_after on <self:InjectedLexer> */
1257 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @injected_after");
1258 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 169);
1265 /* method parser_util#InjectedLexer#injected_after for (self: Object): List[Token] */
1266 val
* VIRTUAL_parser_util__InjectedLexer__injected_after(val
* self
) {
1267 val
* var
/* : List[Token] */;
1268 val
* var1
/* : List[Token] */;
1269 var1
= parser_util__InjectedLexer__injected_after(self
);
1274 /* method parser_util#InjectedLexer#injected_after= for (self: InjectedLexer, List[Token]) */
1275 void parser_util__InjectedLexer__injected_after_61d(val
* self
, val
* p0
) {
1276 self
->attrs
[COLOR_parser_util__InjectedLexer___64dinjected_after
].val
= p0
; /* @injected_after on <self:InjectedLexer> */
1279 /* method parser_util#InjectedLexer#injected_after= for (self: Object, List[Token]) */
1280 void VIRTUAL_parser_util__InjectedLexer__injected_after_61d(val
* self
, val
* p0
) {
1281 parser_util__InjectedLexer__injected_after_61d(self
, p0
);
1284 /* method parser_util#InjectedLexer#is_finished for (self: InjectedLexer): Bool */
1285 short int parser_util__InjectedLexer__is_finished(val
* self
) {
1286 short int var
/* : Bool */;
1287 short int var1
/* : Bool */;
1288 var1
= self
->attrs
[COLOR_parser_util__InjectedLexer___64dis_finished
].s
; /* @is_finished on <self:InjectedLexer> */
1293 /* method parser_util#InjectedLexer#is_finished for (self: Object): Bool */
1294 short int VIRTUAL_parser_util__InjectedLexer__is_finished(val
* self
) {
1295 short int var
/* : Bool */;
1296 short int var1
/* : Bool */;
1297 var1
= parser_util__InjectedLexer__is_finished(self
);
1302 /* method parser_util#InjectedLexer#is_finished= for (self: InjectedLexer, Bool) */
1303 void parser_util__InjectedLexer__is_finished_61d(val
* self
, short int p0
) {
1304 self
->attrs
[COLOR_parser_util__InjectedLexer___64dis_finished
].s
= p0
; /* @is_finished on <self:InjectedLexer> */
1307 /* method parser_util#InjectedLexer#is_finished= for (self: Object, Bool) */
1308 void VIRTUAL_parser_util__InjectedLexer__is_finished_61d(val
* self
, short int p0
) {
1309 parser_util__InjectedLexer__is_finished_61d(self
, p0
);
1312 /* method parser_util#InjectedLexer#get_token for (self: InjectedLexer): nullable Token */
1313 val
* parser_util__InjectedLexer__get_token(val
* self
) {
1314 val
* var
/* : nullable Token */;
1315 val
* var1
/* : List[Token] */;
1316 short int var2
/* : Bool */;
1317 short int var3
/* : Bool */;
1318 val
* var4
/* : List[Token] */;
1319 val
* var5
/* : nullable Object */;
1320 val
* var_tok
/* var tok: Token */;
1321 val
* var6
/* : nullable Location */;
1322 val
* var7
/* : null */;
1323 short int var8
/* : Bool */;
1324 val
* var9
/* : Location */;
1325 val
* var10
/* : SourceFile */;
1326 long var11
/* : Int */;
1327 long var12
/* : Int */;
1328 long var13
/* : Int */;
1329 long var14
/* : Int */;
1330 short int var15
/* : Bool */;
1331 short int var16
/* : Bool */;
1332 val
* var17
/* : nullable Token */;
1333 val
* var_next
/* var next: nullable Token */;
1334 short int var18
/* : Bool */;
1337 short int var19
/* : Bool */;
1338 val
* var20
/* : List[Token] */;
1339 short int var21
/* : Bool */;
1340 val
* var22
/* : List[Token] */;
1341 val
* var23
/* : nullable Object */;
1342 val
* var_tok24
/* var tok: Token */;
1343 val
* var25
/* : nullable Location */;
1344 val
* var26
/* : null */;
1345 short int var27
/* : Bool */;
1346 val
* var28
/* : Location */;
1347 val
* var29
/* : SourceFile */;
1348 long var30
/* : Int */;
1349 long var31
/* : Int */;
1350 long var32
/* : Int */;
1351 long var33
/* : Int */;
1352 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(self
) /* injected_before on <self:InjectedLexer>*/;
1353 var2
= ((short int (*)(val
*))(var1
->class->vft
[COLOR_abstract_collection__Collection__is_empty
]))(var1
) /* is_empty on <var1:List[Token]>*/;
1356 var4
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__InjectedLexer__injected_before
]))(self
) /* injected_before on <self:InjectedLexer>*/;
1357 var5
= ((val
* (*)(val
*))(var4
->class->vft
[COLOR_abstract_collection__Sequence__shift
]))(var4
) /* shift on <var4:List[Token]>*/;
1359 var6
= var_tok
->attrs
[COLOR_parser_nodes__ANode___location
].val
; /* _location on <var_tok:Token> */
1362 var8
= 1; /* is null */
1364 var8
= 0; /* arg is null but recv is not */
1367 var9
= NEW_location__Location(&type_location__Location
);
1368 var10
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_lexer__Lexer__file
]))(self
) /* file on <self:InjectedLexer>*/;
1373 ((void (*)(val
*, val
*, long, long, long, long))(var9
->class->vft
[COLOR_location__Location__init
]))(var9
, var10
, var11
, var12
, var13
, var14
) /* init on <var9:Location>*/;
1374 var_tok
->attrs
[COLOR_parser_nodes__ANode___location
].val
= var9
; /* _location on <var_tok:Token> */
1381 var15
= ((short int (*)(val
*))(self
->class->vft
[COLOR_parser_util__InjectedLexer__is_finished
]))(self
) /* is_finished on <self:InjectedLexer>*/;
1384 var17
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__InjectedLexer__get_token
]))(self
) /* get_token on <self:InjectedLexer>*/;
1386 /* <var_next:nullable Token> isa EOF */
1387 cltype
= type_parser_nodes__EOF
.color
;
1388 idtype
= type_parser_nodes__EOF
.id
;
1389 if(var_next
== NULL
) {
1392 if(cltype
>= var_next
->type
->table_size
) {
1395 var18
= var_next
->type
->type_table
[cltype
] == idtype
;
1404 var20
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__InjectedLexer__injected_after
]))(self
) /* injected_after on <self:InjectedLexer>*/;
1405 ((void (*)(val
*, val
*))(var20
->class->vft
[COLOR_abstract_collection__Sequence__push
]))(var20
, var_next
) /* push on <var20:List[Token]>*/;
1407 ((void (*)(val
*, short int))(self
->class->vft
[COLOR_parser_util__InjectedLexer__is_finished_61d
]))(self
, var21
) /* is_finished= on <self:InjectedLexer>*/;
1410 var22
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__InjectedLexer__injected_after
]))(self
) /* injected_after on <self:InjectedLexer>*/;
1411 var23
= ((val
* (*)(val
*))(var22
->class->vft
[COLOR_abstract_collection__Sequence__shift
]))(var22
) /* shift on <var22:List[Token]>*/;
1413 var25
= var_tok24
->attrs
[COLOR_parser_nodes__ANode___location
].val
; /* _location on <var_tok24:Token> */
1415 if (var25
== NULL
) {
1416 var27
= 1; /* is null */
1418 var27
= 0; /* arg is null but recv is not */
1421 var28
= NEW_location__Location(&type_location__Location
);
1422 var29
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_lexer__Lexer__file
]))(self
) /* file on <self:InjectedLexer>*/;
1427 ((void (*)(val
*, val
*, long, long, long, long))(var28
->class->vft
[COLOR_location__Location__init
]))(var28
, var29
, var30
, var31
, var32
, var33
) /* init on <var28:Location>*/;
1428 var_tok24
->attrs
[COLOR_parser_nodes__ANode___location
].val
= var28
; /* _location on <var_tok24:Token> */
1436 /* method parser_util#InjectedLexer#get_token for (self: Object): nullable Token */
1437 val
* VIRTUAL_parser_util__InjectedLexer__get_token(val
* self
) {
1438 val
* var
/* : nullable Token */;
1439 val
* var1
/* : nullable Token */;
1440 var1
= parser_util__InjectedLexer__get_token(self
);
1445 /* method parser_util#ANode#collect_tokens_by_text for (self: ANode, String): Array[Token] */
1446 val
* parser_util__ANode__collect_tokens_by_text(val
* self
, val
* p0
) {
1447 val
* var
/* : Array[Token] */;
1448 val
* var_text
/* var text: String */;
1449 val
* var1
/* : CollectTokensByTextVisitor */;
1450 val
* var_v
/* var v: CollectTokensByTextVisitor */;
1451 val
* var2
/* : Array[Token] */;
1453 var1
= NEW_parser_util__CollectTokensByTextVisitor(&type_parser_util__CollectTokensByTextVisitor
);
1454 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_parser_util__CollectTokensByTextVisitor__init
]))(var1
, var_text
) /* init on <var1:CollectTokensByTextVisitor>*/;
1456 ((void (*)(val
*, val
*))(var_v
->class->vft
[COLOR_parser_nodes__Visitor__enter_visit
]))(var_v
, self
) /* enter_visit on <var_v:CollectTokensByTextVisitor>*/;
1457 var2
= ((val
* (*)(val
*))(var_v
->class->vft
[COLOR_parser_util__CollectTokensByTextVisitor__result
]))(var_v
) /* result on <var_v:CollectTokensByTextVisitor>*/;
1463 /* method parser_util#ANode#collect_tokens_by_text for (self: Object, String): Array[Token] */
1464 val
* VIRTUAL_parser_util__ANode__collect_tokens_by_text(val
* self
, val
* p0
) {
1465 val
* var
/* : Array[Token] */;
1466 val
* var1
/* : Array[Token] */;
1467 var1
= parser_util__ANode__collect_tokens_by_text(self
, p0
);
1472 /* method parser_util#ANode#collect_annotations_by_name for (self: ANode, String): Array[AAnnotation] */
1473 val
* parser_util__ANode__collect_annotations_by_name(val
* self
, val
* p0
) {
1474 val
* var
/* : Array[AAnnotation] */;
1475 val
* var_name
/* var name: String */;
1476 val
* var1
/* : CollectAnnotationsByNameVisitor */;
1477 val
* var_v
/* var v: CollectAnnotationsByNameVisitor */;
1478 val
* var2
/* : Array[AAnnotation] */;
1480 var1
= NEW_parser_util__CollectAnnotationsByNameVisitor(&type_parser_util__CollectAnnotationsByNameVisitor
);
1481 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_parser_util__CollectAnnotationsByNameVisitor__init
]))(var1
, var_name
) /* init on <var1:CollectAnnotationsByNameVisitor>*/;
1483 ((void (*)(val
*, val
*))(var_v
->class->vft
[COLOR_parser_nodes__Visitor__enter_visit
]))(var_v
, self
) /* enter_visit on <var_v:CollectAnnotationsByNameVisitor>*/;
1484 var2
= ((val
* (*)(val
*))(var_v
->class->vft
[COLOR_parser_util__CollectAnnotationsByNameVisitor__result
]))(var_v
) /* result on <var_v:CollectAnnotationsByNameVisitor>*/;
1490 /* method parser_util#ANode#collect_annotations_by_name for (self: Object, String): Array[AAnnotation] */
1491 val
* VIRTUAL_parser_util__ANode__collect_annotations_by_name(val
* self
, val
* p0
) {
1492 val
* var
/* : Array[AAnnotation] */;
1493 val
* var1
/* : Array[AAnnotation] */;
1494 var1
= parser_util__ANode__collect_annotations_by_name(self
, p0
);
1499 /* method parser_util#CollectTokensByTextVisitor#text for (self: CollectTokensByTextVisitor): String */
1500 val
* parser_util__CollectTokensByTextVisitor__text(val
* self
) {
1501 val
* var
/* : String */;
1502 val
* var1
/* : String */;
1503 var1
= self
->attrs
[COLOR_parser_util__CollectTokensByTextVisitor___64dtext
].val
; /* @text on <self:CollectTokensByTextVisitor> */
1505 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @text");
1506 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 213);
1513 /* method parser_util#CollectTokensByTextVisitor#text for (self: Object): String */
1514 val
* VIRTUAL_parser_util__CollectTokensByTextVisitor__text(val
* self
) {
1515 val
* var
/* : String */;
1516 val
* var1
/* : String */;
1517 var1
= parser_util__CollectTokensByTextVisitor__text(self
);
1522 /* method parser_util#CollectTokensByTextVisitor#text= for (self: CollectTokensByTextVisitor, String) */
1523 void parser_util__CollectTokensByTextVisitor__text_61d(val
* self
, val
* p0
) {
1524 self
->attrs
[COLOR_parser_util__CollectTokensByTextVisitor___64dtext
].val
= p0
; /* @text on <self:CollectTokensByTextVisitor> */
1527 /* method parser_util#CollectTokensByTextVisitor#text= for (self: Object, String) */
1528 void VIRTUAL_parser_util__CollectTokensByTextVisitor__text_61d(val
* self
, val
* p0
) {
1529 parser_util__CollectTokensByTextVisitor__text_61d(self
, p0
);
1532 /* method parser_util#CollectTokensByTextVisitor#init for (self: CollectTokensByTextVisitor, String) */
1533 void parser_util__CollectTokensByTextVisitor__init(val
* self
, val
* p0
) {
1534 val
* var_text
/* var text: String */;
1536 ((void (*)(val
*))(self
->class->vft
[COLOR_parser_nodes__Visitor__init
]))(self
) /* init on <self:CollectTokensByTextVisitor>*/;
1537 ((void (*)(val
*, val
*))(self
->class->vft
[COLOR_parser_util__CollectTokensByTextVisitor__text_61d
]))(self
, var_text
) /* text= on <self:CollectTokensByTextVisitor>*/;
1540 /* method parser_util#CollectTokensByTextVisitor#init for (self: Object, String) */
1541 void VIRTUAL_parser_util__CollectTokensByTextVisitor__init(val
* self
, val
* p0
) {
1542 parser_util__CollectTokensByTextVisitor__init(self
, p0
);
1545 /* method parser_util#CollectTokensByTextVisitor#result for (self: CollectTokensByTextVisitor): Array[Token] */
1546 val
* parser_util__CollectTokensByTextVisitor__result(val
* self
) {
1547 val
* var
/* : Array[Token] */;
1548 val
* var1
/* : Array[Token] */;
1549 var1
= self
->attrs
[COLOR_parser_util__CollectTokensByTextVisitor___64dresult
].val
; /* @result on <self:CollectTokensByTextVisitor> */
1551 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @result");
1552 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 215);
1559 /* method parser_util#CollectTokensByTextVisitor#result for (self: Object): Array[Token] */
1560 val
* VIRTUAL_parser_util__CollectTokensByTextVisitor__result(val
* self
) {
1561 val
* var
/* : Array[Token] */;
1562 val
* var1
/* : Array[Token] */;
1563 var1
= parser_util__CollectTokensByTextVisitor__result(self
);
1568 /* method parser_util#CollectTokensByTextVisitor#result= for (self: CollectTokensByTextVisitor, Array[Token]) */
1569 void parser_util__CollectTokensByTextVisitor__result_61d(val
* self
, val
* p0
) {
1570 self
->attrs
[COLOR_parser_util__CollectTokensByTextVisitor___64dresult
].val
= p0
; /* @result on <self:CollectTokensByTextVisitor> */
1573 /* method parser_util#CollectTokensByTextVisitor#result= for (self: Object, Array[Token]) */
1574 void VIRTUAL_parser_util__CollectTokensByTextVisitor__result_61d(val
* self
, val
* p0
) {
1575 parser_util__CollectTokensByTextVisitor__result_61d(self
, p0
);
1578 /* method parser_util#CollectTokensByTextVisitor#visit for (self: CollectTokensByTextVisitor, ANode) */
1579 void parser_util__CollectTokensByTextVisitor__visit(val
* self
, val
* p0
) {
1580 val
* var_node
/* var node: ANode */;
1581 short int var
/* : Bool */;
1582 short int var1
/* : Bool */;
1585 short int var_
/* var : Bool */;
1586 val
* var2
/* : String */;
1587 val
* var3
/* : String */;
1588 short int var4
/* : Bool */;
1589 val
* var5
/* : Array[Token] */;
1591 ((void (*)(val
*, val
*))(var_node
->class->vft
[COLOR_parser_nodes__ANode__visit_all
]))(var_node
, self
) /* visit_all on <var_node:ANode>*/;
1592 /* <var_node:ANode> isa Token */
1593 cltype
= type_parser_nodes__Token
.color
;
1594 idtype
= type_parser_nodes__Token
.id
;
1595 if(cltype
>= var_node
->type
->table_size
) {
1598 var1
= var_node
->type
->type_table
[cltype
] == idtype
;
1602 var2
= ((val
* (*)(val
*))(var_node
->class->vft
[COLOR_parser_nodes__Token__text
]))(var_node
) /* text on <var_node:ANode(Token)>*/;
1603 var3
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__CollectTokensByTextVisitor__text
]))(self
) /* text on <self:CollectTokensByTextVisitor>*/;
1604 var4
= ((short int (*)(val
*, val
*))(var2
->class->vft
[COLOR_kernel__Object___61d_61d
]))(var2
, var3
) /* == on <var2:String>*/;
1610 var5
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__CollectTokensByTextVisitor__result
]))(self
) /* result on <self:CollectTokensByTextVisitor>*/;
1611 ((void (*)(val
*, val
*))(var5
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var5
, var_node
) /* add on <var5:Array[Token]>*/;
1616 /* method parser_util#CollectTokensByTextVisitor#visit for (self: Object, ANode) */
1617 void VIRTUAL_parser_util__CollectTokensByTextVisitor__visit(val
* self
, val
* p0
) {
1618 parser_util__CollectTokensByTextVisitor__visit(self
, p0
);
1621 /* method parser_util#CollectAnnotationsByNameVisitor#name for (self: CollectAnnotationsByNameVisitor): String */
1622 val
* parser_util__CollectAnnotationsByNameVisitor__name(val
* self
) {
1623 val
* var
/* : String */;
1624 val
* var1
/* : String */;
1625 var1
= self
->attrs
[COLOR_parser_util__CollectAnnotationsByNameVisitor___64dname
].val
; /* @name on <self:CollectAnnotationsByNameVisitor> */
1627 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @name");
1628 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 225);
1635 /* method parser_util#CollectAnnotationsByNameVisitor#name for (self: Object): String */
1636 val
* VIRTUAL_parser_util__CollectAnnotationsByNameVisitor__name(val
* self
) {
1637 val
* var
/* : String */;
1638 val
* var1
/* : String */;
1639 var1
= parser_util__CollectAnnotationsByNameVisitor__name(self
);
1644 /* method parser_util#CollectAnnotationsByNameVisitor#name= for (self: CollectAnnotationsByNameVisitor, String) */
1645 void parser_util__CollectAnnotationsByNameVisitor__name_61d(val
* self
, val
* p0
) {
1646 self
->attrs
[COLOR_parser_util__CollectAnnotationsByNameVisitor___64dname
].val
= p0
; /* @name on <self:CollectAnnotationsByNameVisitor> */
1649 /* method parser_util#CollectAnnotationsByNameVisitor#name= for (self: Object, String) */
1650 void VIRTUAL_parser_util__CollectAnnotationsByNameVisitor__name_61d(val
* self
, val
* p0
) {
1651 parser_util__CollectAnnotationsByNameVisitor__name_61d(self
, p0
);
1654 /* method parser_util#CollectAnnotationsByNameVisitor#init for (self: CollectAnnotationsByNameVisitor, String) */
1655 void parser_util__CollectAnnotationsByNameVisitor__init(val
* self
, val
* p0
) {
1656 val
* var_name
/* var name: String */;
1658 ((void (*)(val
*))(self
->class->vft
[COLOR_parser_nodes__Visitor__init
]))(self
) /* init on <self:CollectAnnotationsByNameVisitor>*/;
1659 ((void (*)(val
*, val
*))(self
->class->vft
[COLOR_parser_util__CollectAnnotationsByNameVisitor__name_61d
]))(self
, var_name
) /* name= on <self:CollectAnnotationsByNameVisitor>*/;
1662 /* method parser_util#CollectAnnotationsByNameVisitor#init for (self: Object, String) */
1663 void VIRTUAL_parser_util__CollectAnnotationsByNameVisitor__init(val
* self
, val
* p0
) {
1664 parser_util__CollectAnnotationsByNameVisitor__init(self
, p0
);
1667 /* method parser_util#CollectAnnotationsByNameVisitor#result for (self: CollectAnnotationsByNameVisitor): Array[AAnnotation] */
1668 val
* parser_util__CollectAnnotationsByNameVisitor__result(val
* self
) {
1669 val
* var
/* : Array[AAnnotation] */;
1670 val
* var1
/* : Array[AAnnotation] */;
1671 var1
= self
->attrs
[COLOR_parser_util__CollectAnnotationsByNameVisitor___64dresult
].val
; /* @result on <self:CollectAnnotationsByNameVisitor> */
1673 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @result");
1674 fprintf(stderr
, " (%s:%d)\n", "src/parser_util.nit", 227);
1681 /* method parser_util#CollectAnnotationsByNameVisitor#result for (self: Object): Array[AAnnotation] */
1682 val
* VIRTUAL_parser_util__CollectAnnotationsByNameVisitor__result(val
* self
) {
1683 val
* var
/* : Array[AAnnotation] */;
1684 val
* var1
/* : Array[AAnnotation] */;
1685 var1
= parser_util__CollectAnnotationsByNameVisitor__result(self
);
1690 /* method parser_util#CollectAnnotationsByNameVisitor#result= for (self: CollectAnnotationsByNameVisitor, Array[AAnnotation]) */
1691 void parser_util__CollectAnnotationsByNameVisitor__result_61d(val
* self
, val
* p0
) {
1692 self
->attrs
[COLOR_parser_util__CollectAnnotationsByNameVisitor___64dresult
].val
= p0
; /* @result on <self:CollectAnnotationsByNameVisitor> */
1695 /* method parser_util#CollectAnnotationsByNameVisitor#result= for (self: Object, Array[AAnnotation]) */
1696 void VIRTUAL_parser_util__CollectAnnotationsByNameVisitor__result_61d(val
* self
, val
* p0
) {
1697 parser_util__CollectAnnotationsByNameVisitor__result_61d(self
, p0
);
1700 /* method parser_util#CollectAnnotationsByNameVisitor#visit for (self: CollectAnnotationsByNameVisitor, ANode) */
1701 void parser_util__CollectAnnotationsByNameVisitor__visit(val
* self
, val
* p0
) {
1702 val
* var_node
/* var node: ANode */;
1703 short int var
/* : Bool */;
1704 short int var1
/* : Bool */;
1707 short int var_
/* var : Bool */;
1708 val
* var2
/* : AAtid */;
1709 val
* var3
/* : Token */;
1710 val
* var4
/* : String */;
1711 val
* var5
/* : String */;
1712 short int var6
/* : Bool */;
1713 val
* var7
/* : Array[AAnnotation] */;
1715 ((void (*)(val
*, val
*))(var_node
->class->vft
[COLOR_parser_nodes__ANode__visit_all
]))(var_node
, self
) /* visit_all on <var_node:ANode>*/;
1716 /* <var_node:ANode> isa AAnnotation */
1717 cltype
= type_parser_nodes__AAnnotation
.color
;
1718 idtype
= type_parser_nodes__AAnnotation
.id
;
1719 if(cltype
>= var_node
->type
->table_size
) {
1722 var1
= var_node
->type
->type_table
[cltype
] == idtype
;
1726 var2
= ((val
* (*)(val
*))(var_node
->class->vft
[COLOR_parser_nodes__AAnnotation__n_atid
]))(var_node
) /* n_atid on <var_node:ANode(AAnnotation)>*/;
1727 var3
= ((val
* (*)(val
*))(var2
->class->vft
[COLOR_parser_nodes__AAtid__n_id
]))(var2
) /* n_id on <var2:AAtid>*/;
1728 var4
= ((val
* (*)(val
*))(var3
->class->vft
[COLOR_parser_nodes__Token__text
]))(var3
) /* text on <var3:Token>*/;
1729 var5
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__CollectAnnotationsByNameVisitor__name
]))(self
) /* name on <self:CollectAnnotationsByNameVisitor>*/;
1730 var6
= ((short int (*)(val
*, val
*))(var4
->class->vft
[COLOR_kernel__Object___61d_61d
]))(var4
, var5
) /* == on <var4:String>*/;
1736 var7
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_parser_util__CollectAnnotationsByNameVisitor__result
]))(self
) /* result on <self:CollectAnnotationsByNameVisitor>*/;
1737 ((void (*)(val
*, val
*))(var7
->class->vft
[COLOR_abstract_collection__SimpleCollection__add
]))(var7
, var_node
) /* add on <var7:Array[AAnnotation]>*/;
1742 /* method parser_util#CollectAnnotationsByNameVisitor#visit for (self: Object, ANode) */
1743 void VIRTUAL_parser_util__CollectAnnotationsByNameVisitor__visit(val
* self
, val
* p0
) {
1744 parser_util__CollectAnnotationsByNameVisitor__visit(self
, p0
);