parser: remove last clorure-related classes
[nit.git] / c_src / simple_misc_analysis.sep.1.c
1 #include "simple_misc_analysis.sep.0.h"
2 /* method simple_misc_analysis#ToolContext#simple_misc_analysis_phase for (self: ToolContext): Phase */
3 val* simple_misc_analysis__ToolContext__simple_misc_analysis_phase(val* self) {
4 val* var /* : Phase */;
5 val* var1 /* : Phase */;
6 var1 = self->attrs[COLOR_simple_misc_analysis__ToolContext___64dsimple_misc_analysis_phase].val; /* @simple_misc_analysis_phase on <self:ToolContext> */
7 if (var1 == NULL) {
8 fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Uninitialized attribute @simple_misc_analysis_phase", "src/simple_misc_analysis.nit", 29);
9 exit(1);
10 }
11 var = var1;
12 RET_LABEL:;
13 return var;
14 }
15 /* method simple_misc_analysis#ToolContext#simple_misc_analysis_phase for (self: Object): Phase */
16 val* VIRTUAL_simple_misc_analysis__ToolContext__simple_misc_analysis_phase(val* self) {
17 val* var /* : Phase */;
18 val* var1 /* : Phase */;
19 var1 = simple_misc_analysis__ToolContext__simple_misc_analysis_phase(self);
20 var = var1;
21 RET_LABEL:;
22 return var;
23 }
24 /* method simple_misc_analysis#ToolContext#simple_misc_analysis_phase= for (self: ToolContext, Phase) */
25 void simple_misc_analysis__ToolContext__simple_misc_analysis_phase_61d(val* self, val* p0) {
26 self->attrs[COLOR_simple_misc_analysis__ToolContext___64dsimple_misc_analysis_phase].val = p0; /* @simple_misc_analysis_phase on <self:ToolContext> */
27 RET_LABEL:;
28 }
29 /* method simple_misc_analysis#ToolContext#simple_misc_analysis_phase= for (self: Object, Phase) */
30 void VIRTUAL_simple_misc_analysis__ToolContext__simple_misc_analysis_phase_61d(val* self, val* p0) {
31 simple_misc_analysis__ToolContext__simple_misc_analysis_phase_61d(self, p0);
32 RET_LABEL:;
33 }
34 /* method simple_misc_analysis#SimpleMiscAnalysisPhase#process_nmodule for (self: SimpleMiscAnalysisPhase, AModule) */
35 void simple_misc_analysis__SimpleMiscAnalysisPhase__process_nmodule(val* self, val* p0) {
36 val* var_nmodule /* var nmodule: AModule */;
37 val* var /* : ToolContext */;
38 var_nmodule = p0;
39 var = ((val* (*)(val*))(self->class->vft[COLOR_phase__Phase__toolcontext]))(self) /* toolcontext on <self:SimpleMiscAnalysisPhase>*/;
40 ((void (*)(val*, val*))(var_nmodule->class->vft[COLOR_simple_misc_analysis__AModule__do_simple_misc_analysis]))(var_nmodule, var) /* do_simple_misc_analysis on <var_nmodule:AModule>*/;
41 RET_LABEL:;
42 }
43 /* method simple_misc_analysis#SimpleMiscAnalysisPhase#process_nmodule for (self: Object, AModule) */
44 void VIRTUAL_simple_misc_analysis__SimpleMiscAnalysisPhase__process_nmodule(val* self, val* p0) {
45 simple_misc_analysis__SimpleMiscAnalysisPhase__process_nmodule(self, p0);
46 RET_LABEL:;
47 }
48 /* method simple_misc_analysis#AModule#do_simple_misc_analysis for (self: AModule, ToolContext) */
49 void simple_misc_analysis__AModule__do_simple_misc_analysis(val* self, val* p0) {
50 val* var_toolcontext /* var toolcontext: ToolContext */;
51 val* var /* : SimpleMiscVisitor */;
52 val* var_v /* var v: SimpleMiscVisitor */;
53 var_toolcontext = p0;
54 var = NEW_simple_misc_analysis__SimpleMiscVisitor(&type_simple_misc_analysis__SimpleMiscVisitor);
55 ((void (*)(val*, val*))(var->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__init]))(var, var_toolcontext) /* init on <var:SimpleMiscVisitor>*/;
56 CHECK_NEW_simple_misc_analysis__SimpleMiscVisitor(var);
57 var_v = var;
58 ((void (*)(val*, val*))(var_v->class->vft[COLOR_parser_nodes__Visitor__enter_visit]))(var_v, self) /* enter_visit on <var_v:SimpleMiscVisitor>*/;
59 RET_LABEL:;
60 }
61 /* method simple_misc_analysis#AModule#do_simple_misc_analysis for (self: Object, ToolContext) */
62 void VIRTUAL_simple_misc_analysis__AModule__do_simple_misc_analysis(val* self, val* p0) {
63 simple_misc_analysis__AModule__do_simple_misc_analysis(self, p0);
64 RET_LABEL:;
65 }
66 /* method simple_misc_analysis#SimpleMiscVisitor#visit for (self: SimpleMiscVisitor, ANode) */
67 void simple_misc_analysis__SimpleMiscVisitor__visit(val* self, val* p0) {
68 val* var_n /* var n: ANode */;
69 var_n = p0;
70 ((void (*)(val*, val*))(var_n->class->vft[COLOR_simple_misc_analysis__ANode__accept_simple_misc]))(var_n, self) /* accept_simple_misc on <var_n:ANode>*/;
71 RET_LABEL:;
72 }
73 /* method simple_misc_analysis#SimpleMiscVisitor#visit for (self: Object, ANode) */
74 void VIRTUAL_simple_misc_analysis__SimpleMiscVisitor__visit(val* self, val* p0) {
75 simple_misc_analysis__SimpleMiscVisitor__visit(self, p0);
76 RET_LABEL:;
77 }
78 /* method simple_misc_analysis#SimpleMiscVisitor#once_count for (self: SimpleMiscVisitor): Int */
79 long simple_misc_analysis__SimpleMiscVisitor__once_count(val* self) {
80 long var /* : Int */;
81 long var1 /* : Int */;
82 var1 = self->attrs[COLOR_simple_misc_analysis__SimpleMiscVisitor___64donce_count].l; /* @once_count on <self:SimpleMiscVisitor> */
83 var = var1;
84 RET_LABEL:;
85 return var;
86 }
87 /* method simple_misc_analysis#SimpleMiscVisitor#once_count for (self: Object): Int */
88 long VIRTUAL_simple_misc_analysis__SimpleMiscVisitor__once_count(val* self) {
89 long var /* : Int */;
90 long var1 /* : Int */;
91 var1 = simple_misc_analysis__SimpleMiscVisitor__once_count(self);
92 var = var1;
93 RET_LABEL:;
94 return var;
95 }
96 /* method simple_misc_analysis#SimpleMiscVisitor#once_count= for (self: SimpleMiscVisitor, Int) */
97 void simple_misc_analysis__SimpleMiscVisitor__once_count_61d(val* self, long p0) {
98 self->attrs[COLOR_simple_misc_analysis__SimpleMiscVisitor___64donce_count].l = p0; /* @once_count on <self:SimpleMiscVisitor> */
99 RET_LABEL:;
100 }
101 /* method simple_misc_analysis#SimpleMiscVisitor#once_count= for (self: Object, Int) */
102 void VIRTUAL_simple_misc_analysis__SimpleMiscVisitor__once_count_61d(val* self, long p0) {
103 simple_misc_analysis__SimpleMiscVisitor__once_count_61d(self, p0);
104 RET_LABEL:;
105 }
106 /* method simple_misc_analysis#SimpleMiscVisitor#toolcontext for (self: SimpleMiscVisitor): ToolContext */
107 val* simple_misc_analysis__SimpleMiscVisitor__toolcontext(val* self) {
108 val* var /* : ToolContext */;
109 val* var1 /* : ToolContext */;
110 var1 = self->attrs[COLOR_simple_misc_analysis__SimpleMiscVisitor___64dtoolcontext].val; /* @toolcontext on <self:SimpleMiscVisitor> */
111 if (var1 == NULL) {
112 fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Uninitialized attribute @toolcontext", "src/simple_misc_analysis.nit", 57);
113 exit(1);
114 }
115 var = var1;
116 RET_LABEL:;
117 return var;
118 }
119 /* method simple_misc_analysis#SimpleMiscVisitor#toolcontext for (self: Object): ToolContext */
120 val* VIRTUAL_simple_misc_analysis__SimpleMiscVisitor__toolcontext(val* self) {
121 val* var /* : ToolContext */;
122 val* var1 /* : ToolContext */;
123 var1 = simple_misc_analysis__SimpleMiscVisitor__toolcontext(self);
124 var = var1;
125 RET_LABEL:;
126 return var;
127 }
128 /* method simple_misc_analysis#SimpleMiscVisitor#toolcontext= for (self: SimpleMiscVisitor, ToolContext) */
129 void simple_misc_analysis__SimpleMiscVisitor__toolcontext_61d(val* self, val* p0) {
130 self->attrs[COLOR_simple_misc_analysis__SimpleMiscVisitor___64dtoolcontext].val = p0; /* @toolcontext on <self:SimpleMiscVisitor> */
131 RET_LABEL:;
132 }
133 /* method simple_misc_analysis#SimpleMiscVisitor#toolcontext= for (self: Object, ToolContext) */
134 void VIRTUAL_simple_misc_analysis__SimpleMiscVisitor__toolcontext_61d(val* self, val* p0) {
135 simple_misc_analysis__SimpleMiscVisitor__toolcontext_61d(self, p0);
136 RET_LABEL:;
137 }
138 /* method simple_misc_analysis#SimpleMiscVisitor#warning for (self: SimpleMiscVisitor, ANode, String) */
139 void simple_misc_analysis__SimpleMiscVisitor__warning(val* self, val* p0, val* p1) {
140 val* var_node /* var node: ANode */;
141 val* var_msg /* var msg: String */;
142 val* var /* : ToolContext */;
143 val* var1 /* : Location */;
144 var_node = p0;
145 var_msg = p1;
146 var = ((val* (*)(val*))(self->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__toolcontext]))(self) /* toolcontext on <self:SimpleMiscVisitor>*/;
147 var1 = ((val* (*)(val*))(var_node->class->vft[COLOR_parser_nodes__ANode__hot_location]))(var_node) /* hot_location on <var_node:ANode>*/;
148 ((void (*)(val*, val*, val*))(var->class->vft[COLOR_toolcontext__ToolContext__warning]))(var, var1, var_msg) /* warning on <var:ToolContext>*/;
149 RET_LABEL:;
150 }
151 /* method simple_misc_analysis#SimpleMiscVisitor#warning for (self: Object, ANode, String) */
152 void VIRTUAL_simple_misc_analysis__SimpleMiscVisitor__warning(val* self, val* p0, val* p1) {
153 simple_misc_analysis__SimpleMiscVisitor__warning(self, p0, p1);
154 RET_LABEL:;
155 }
156 /* method simple_misc_analysis#SimpleMiscVisitor#init for (self: SimpleMiscVisitor, ToolContext) */
157 void simple_misc_analysis__SimpleMiscVisitor__init(val* self, val* p0) {
158 val* var_toolcontext /* var toolcontext: ToolContext */;
159 var_toolcontext = p0;
160 ((void (*)(val*))(self->class->vft[COLOR_parser_nodes__Visitor__init]))(self) /* init on <self:SimpleMiscVisitor>*/;
161 ((void (*)(val*, val*))(self->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__toolcontext_61d]))(self, var_toolcontext) /* toolcontext= on <self:SimpleMiscVisitor>*/;
162 RET_LABEL:;
163 }
164 /* method simple_misc_analysis#SimpleMiscVisitor#init for (self: Object, ToolContext) */
165 void VIRTUAL_simple_misc_analysis__SimpleMiscVisitor__init(val* self, val* p0) {
166 simple_misc_analysis__SimpleMiscVisitor__init(self, p0);
167 RET_LABEL:;
168 }
169 /* method simple_misc_analysis#ANode#accept_simple_misc for (self: ANode, SimpleMiscVisitor) */
170 void simple_misc_analysis__ANode__accept_simple_misc(val* self, val* p0) {
171 val* var_v /* var v: SimpleMiscVisitor */;
172 var_v = p0;
173 ((void (*)(val*, val*))(self->class->vft[COLOR_parser_nodes__ANode__visit_all]))(self, var_v) /* visit_all on <self:ANode>*/;
174 ((void (*)(val*, val*))(self->class->vft[COLOR_simple_misc_analysis__ANode__after_simple_misc]))(self, var_v) /* after_simple_misc on <self:ANode>*/;
175 RET_LABEL:;
176 }
177 /* method simple_misc_analysis#ANode#accept_simple_misc for (self: Object, SimpleMiscVisitor) */
178 void VIRTUAL_simple_misc_analysis__ANode__accept_simple_misc(val* self, val* p0) {
179 simple_misc_analysis__ANode__accept_simple_misc(self, p0);
180 RET_LABEL:;
181 }
182 /* method simple_misc_analysis#ANode#after_simple_misc for (self: ANode, SimpleMiscVisitor) */
183 void simple_misc_analysis__ANode__after_simple_misc(val* self, val* p0) {
184 val* var_v /* var v: SimpleMiscVisitor */;
185 var_v = p0;
186 RET_LABEL:;
187 }
188 /* method simple_misc_analysis#ANode#after_simple_misc for (self: Object, SimpleMiscVisitor) */
189 void VIRTUAL_simple_misc_analysis__ANode__after_simple_misc(val* self, val* p0) {
190 simple_misc_analysis__ANode__after_simple_misc(self, p0);
191 RET_LABEL:;
192 }
193 /* method simple_misc_analysis#ASignature#after_simple_misc for (self: ASignature, SimpleMiscVisitor) */
194 void simple_misc_analysis__ASignature__after_simple_misc(val* self, val* p0) {
195 val* var_v /* var v: SimpleMiscVisitor */;
196 short int var /* : Bool */;
197 val* var1 /* : nullable TOpar */;
198 val* var2 /* : null */;
199 short int var3 /* : Bool */;
200 short int var_ /* var : Bool */;
201 val* var4 /* : ANodes[AParam] */;
202 short int var5 /* : Bool */;
203 static val* varonce;
204 val* var6 /* : String */;
205 char* var7 /* : NativeString */;
206 long var8 /* : Int */;
207 val* var9 /* : String */;
208 var_v = p0;
209 var1 = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__ASignature__n_opar]))(self) /* n_opar on <self:ASignature>*/;
210 var2 = NULL;
211 if (var1 == NULL) {
212 var3 = 0; /* is null */
213 } else {
214 var3 = 1; /* arg is null and recv is not */
215 }
216 var_ = var3;
217 if (var3){
218 var4 = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__ASignature__n_params]))(self) /* n_params on <self:ASignature>*/;
219 var5 = ((short int (*)(val*))(var4->class->vft[COLOR_abstract_collection__Collection__is_empty]))(var4) /* is_empty on <var4:ANodes[AParam]>*/;
220 var = var5;
221 } else {
222 var = var_;
223 }
224 if (var){
225 if (varonce) {
226 var6 = varonce;
227 } else {
228 var7 = "Warning: superfluous parentheses.";
229 var8 = 33;
230 var9 = string__NativeString__to_s_with_length(var7, var8);
231 var6 = var9;
232 varonce = var6;
233 }
234 ((void (*)(val*, val*, val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__warning]))(var_v, self, var6) /* warning on <var_v:SimpleMiscVisitor>*/;
235 } else {
236 }
237 RET_LABEL:;
238 }
239 /* method simple_misc_analysis#ASignature#after_simple_misc for (self: Object, SimpleMiscVisitor) */
240 void VIRTUAL_simple_misc_analysis__ASignature__after_simple_misc(val* self, val* p0) {
241 simple_misc_analysis__ASignature__after_simple_misc(self, p0);
242 RET_LABEL:;
243 }
244 /* method simple_misc_analysis#AExpr#warn_parentheses for (self: AExpr, SimpleMiscVisitor) */
245 void simple_misc_analysis__AExpr__warn_parentheses(val* self, val* p0) {
246 val* var_v /* var v: SimpleMiscVisitor */;
247 var_v = p0;
248 RET_LABEL:;
249 }
250 /* method simple_misc_analysis#AExpr#warn_parentheses for (self: Object, SimpleMiscVisitor) */
251 void VIRTUAL_simple_misc_analysis__AExpr__warn_parentheses(val* self, val* p0) {
252 simple_misc_analysis__AExpr__warn_parentheses(self, p0);
253 RET_LABEL:;
254 }
255 /* method simple_misc_analysis#AParExpr#warn_parentheses for (self: AParExpr, SimpleMiscVisitor) */
256 void simple_misc_analysis__AParExpr__warn_parentheses(val* self, val* p0) {
257 val* var_v /* var v: SimpleMiscVisitor */;
258 static val* varonce;
259 val* var /* : String */;
260 char* var1 /* : NativeString */;
261 long var2 /* : Int */;
262 val* var3 /* : String */;
263 var_v = p0;
264 if (varonce) {
265 var = varonce;
266 } else {
267 var1 = "Warning: superfluous parentheses.";
268 var2 = 33;
269 var3 = string__NativeString__to_s_with_length(var1, var2);
270 var = var3;
271 varonce = var;
272 }
273 ((void (*)(val*, val*, val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__warning]))(var_v, self, var) /* warning on <var_v:SimpleMiscVisitor>*/;
274 RET_LABEL:;
275 }
276 /* method simple_misc_analysis#AParExpr#warn_parentheses for (self: Object, SimpleMiscVisitor) */
277 void VIRTUAL_simple_misc_analysis__AParExpr__warn_parentheses(val* self, val* p0) {
278 simple_misc_analysis__AParExpr__warn_parentheses(self, p0);
279 RET_LABEL:;
280 }
281 /* method simple_misc_analysis#AParExprs#after_simple_misc for (self: AParExprs, SimpleMiscVisitor) */
282 void simple_misc_analysis__AParExprs__after_simple_misc(val* self, val* p0) {
283 val* var_v /* var v: SimpleMiscVisitor */;
284 val* var /* : ANodes[AExpr] */;
285 short int var1 /* : Bool */;
286 static val* varonce;
287 val* var2 /* : String */;
288 char* var3 /* : NativeString */;
289 long var4 /* : Int */;
290 val* var5 /* : String */;
291 var_v = p0;
292 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AExprs__n_exprs]))(self) /* n_exprs on <self:AParExprs>*/;
293 var1 = ((short int (*)(val*))(var->class->vft[COLOR_abstract_collection__Collection__is_empty]))(var) /* is_empty on <var:ANodes[AExpr]>*/;
294 if (var1){
295 if (varonce) {
296 var2 = varonce;
297 } else {
298 var3 = "Warning: superfluous parentheses.";
299 var4 = 33;
300 var5 = string__NativeString__to_s_with_length(var3, var4);
301 var2 = var5;
302 varonce = var2;
303 }
304 ((void (*)(val*, val*, val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__warning]))(var_v, self, var2) /* warning on <var_v:SimpleMiscVisitor>*/;
305 } else {
306 }
307 RET_LABEL:;
308 }
309 /* method simple_misc_analysis#AParExprs#after_simple_misc for (self: Object, SimpleMiscVisitor) */
310 void VIRTUAL_simple_misc_analysis__AParExprs__after_simple_misc(val* self, val* p0) {
311 simple_misc_analysis__AParExprs__after_simple_misc(self, p0);
312 RET_LABEL:;
313 }
314 /* method simple_misc_analysis#AReturnExpr#after_simple_misc for (self: AReturnExpr, SimpleMiscVisitor) */
315 void simple_misc_analysis__AReturnExpr__after_simple_misc(val* self, val* p0) {
316 val* var_v /* var v: SimpleMiscVisitor */;
317 val* var /* : nullable AExpr */;
318 val* var_e /* var e: nullable AExpr */;
319 val* var1 /* : null */;
320 short int var2 /* : Bool */;
321 var_v = p0;
322 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AReturnExpr__n_expr]))(self) /* n_expr on <self:AReturnExpr>*/;
323 var_e = var;
324 var1 = NULL;
325 if (var_e == NULL) {
326 var2 = 0; /* is null */
327 } else {
328 var2 = 1; /* arg is null and recv is not */
329 }
330 if (var2){
331 ((void (*)(val*, val*))(var_e->class->vft[COLOR_simple_misc_analysis__AExpr__warn_parentheses]))(var_e, var_v) /* warn_parentheses on <var_e:nullable AExpr(AExpr)>*/;
332 } else {
333 }
334 RET_LABEL:;
335 }
336 /* method simple_misc_analysis#AReturnExpr#after_simple_misc for (self: Object, SimpleMiscVisitor) */
337 void VIRTUAL_simple_misc_analysis__AReturnExpr__after_simple_misc(val* self, val* p0) {
338 simple_misc_analysis__AReturnExpr__after_simple_misc(self, p0);
339 RET_LABEL:;
340 }
341 /* method simple_misc_analysis#AContinueExpr#after_simple_misc for (self: AContinueExpr, SimpleMiscVisitor) */
342 void simple_misc_analysis__AContinueExpr__after_simple_misc(val* self, val* p0) {
343 val* var_v /* var v: SimpleMiscVisitor */;
344 val* var /* : nullable AExpr */;
345 val* var_e /* var e: nullable AExpr */;
346 val* var1 /* : null */;
347 short int var2 /* : Bool */;
348 var_v = p0;
349 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AContinueExpr__n_expr]))(self) /* n_expr on <self:AContinueExpr>*/;
350 var_e = var;
351 var1 = NULL;
352 if (var_e == NULL) {
353 var2 = 0; /* is null */
354 } else {
355 var2 = 1; /* arg is null and recv is not */
356 }
357 if (var2){
358 ((void (*)(val*, val*))(var_e->class->vft[COLOR_simple_misc_analysis__AExpr__warn_parentheses]))(var_e, var_v) /* warn_parentheses on <var_e:nullable AExpr(AExpr)>*/;
359 } else {
360 }
361 RET_LABEL:;
362 }
363 /* method simple_misc_analysis#AContinueExpr#after_simple_misc for (self: Object, SimpleMiscVisitor) */
364 void VIRTUAL_simple_misc_analysis__AContinueExpr__after_simple_misc(val* self, val* p0) {
365 simple_misc_analysis__AContinueExpr__after_simple_misc(self, p0);
366 RET_LABEL:;
367 }
368 /* method simple_misc_analysis#ABreakExpr#after_simple_misc for (self: ABreakExpr, SimpleMiscVisitor) */
369 void simple_misc_analysis__ABreakExpr__after_simple_misc(val* self, val* p0) {
370 val* var_v /* var v: SimpleMiscVisitor */;
371 val* var /* : nullable AExpr */;
372 val* var_e /* var e: nullable AExpr */;
373 val* var1 /* : null */;
374 short int var2 /* : Bool */;
375 var_v = p0;
376 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__ABreakExpr__n_expr]))(self) /* n_expr on <self:ABreakExpr>*/;
377 var_e = var;
378 var1 = NULL;
379 if (var_e == NULL) {
380 var2 = 0; /* is null */
381 } else {
382 var2 = 1; /* arg is null and recv is not */
383 }
384 if (var2){
385 ((void (*)(val*, val*))(var_e->class->vft[COLOR_simple_misc_analysis__AExpr__warn_parentheses]))(var_e, var_v) /* warn_parentheses on <var_e:nullable AExpr(AExpr)>*/;
386 } else {
387 }
388 RET_LABEL:;
389 }
390 /* method simple_misc_analysis#ABreakExpr#after_simple_misc for (self: Object, SimpleMiscVisitor) */
391 void VIRTUAL_simple_misc_analysis__ABreakExpr__after_simple_misc(val* self, val* p0) {
392 simple_misc_analysis__ABreakExpr__after_simple_misc(self, p0);
393 RET_LABEL:;
394 }
395 /* method simple_misc_analysis#AWhileExpr#after_simple_misc for (self: AWhileExpr, SimpleMiscVisitor) */
396 void simple_misc_analysis__AWhileExpr__after_simple_misc(val* self, val* p0) {
397 val* var_v /* var v: SimpleMiscVisitor */;
398 val* var /* : AExpr */;
399 short int var1 /* : Bool */;
400 int cltype;
401 int idtype;
402 static val* varonce;
403 val* var2 /* : String */;
404 char* var3 /* : NativeString */;
405 long var4 /* : Int */;
406 val* var5 /* : String */;
407 val* var6 /* : AExpr */;
408 var_v = p0;
409 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AWhileExpr__n_expr]))(self) /* n_expr on <self:AWhileExpr>*/;
410 /* <var:AExpr> isa ATrueExpr */
411 cltype = type_parser_nodes__ATrueExpr.color;
412 idtype = type_parser_nodes__ATrueExpr.id;
413 if(cltype >= var->type->table_size) {
414 var1 = 0;
415 } else {
416 var1 = var->type->type_table[cltype] == idtype;
417 }
418 if (var1){
419 if (varonce) {
420 var2 = varonce;
421 } else {
422 var3 = "Warning: use \'loop\' instead of \'while true do\'.";
423 var4 = 47;
424 var5 = string__NativeString__to_s_with_length(var3, var4);
425 var2 = var5;
426 varonce = var2;
427 }
428 ((void (*)(val*, val*, val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__warning]))(var_v, self, var2) /* warning on <var_v:SimpleMiscVisitor>*/;
429 } else {
430 var6 = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AWhileExpr__n_expr]))(self) /* n_expr on <self:AWhileExpr>*/;
431 ((void (*)(val*, val*))(var6->class->vft[COLOR_simple_misc_analysis__AExpr__warn_parentheses]))(var6, var_v) /* warn_parentheses on <var6:AExpr>*/;
432 }
433 RET_LABEL:;
434 }
435 /* method simple_misc_analysis#AWhileExpr#after_simple_misc for (self: Object, SimpleMiscVisitor) */
436 void VIRTUAL_simple_misc_analysis__AWhileExpr__after_simple_misc(val* self, val* p0) {
437 simple_misc_analysis__AWhileExpr__after_simple_misc(self, p0);
438 RET_LABEL:;
439 }
440 /* method simple_misc_analysis#AForExpr#after_simple_misc for (self: AForExpr, SimpleMiscVisitor) */
441 void simple_misc_analysis__AForExpr__after_simple_misc(val* self, val* p0) {
442 val* var_v /* var v: SimpleMiscVisitor */;
443 val* var /* : AExpr */;
444 var_v = p0;
445 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AForExpr__n_expr]))(self) /* n_expr on <self:AForExpr>*/;
446 ((void (*)(val*, val*))(var->class->vft[COLOR_simple_misc_analysis__AExpr__warn_parentheses]))(var, var_v) /* warn_parentheses on <var:AExpr>*/;
447 RET_LABEL:;
448 }
449 /* method simple_misc_analysis#AForExpr#after_simple_misc for (self: Object, SimpleMiscVisitor) */
450 void VIRTUAL_simple_misc_analysis__AForExpr__after_simple_misc(val* self, val* p0) {
451 simple_misc_analysis__AForExpr__after_simple_misc(self, p0);
452 RET_LABEL:;
453 }
454 /* method simple_misc_analysis#AIfExpr#after_simple_misc for (self: AIfExpr, SimpleMiscVisitor) */
455 void simple_misc_analysis__AIfExpr__after_simple_misc(val* self, val* p0) {
456 val* var_v /* var v: SimpleMiscVisitor */;
457 val* var /* : AExpr */;
458 var_v = p0;
459 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AIfExpr__n_expr]))(self) /* n_expr on <self:AIfExpr>*/;
460 ((void (*)(val*, val*))(var->class->vft[COLOR_simple_misc_analysis__AExpr__warn_parentheses]))(var, var_v) /* warn_parentheses on <var:AExpr>*/;
461 RET_LABEL:;
462 }
463 /* method simple_misc_analysis#AIfExpr#after_simple_misc for (self: Object, SimpleMiscVisitor) */
464 void VIRTUAL_simple_misc_analysis__AIfExpr__after_simple_misc(val* self, val* p0) {
465 simple_misc_analysis__AIfExpr__after_simple_misc(self, p0);
466 RET_LABEL:;
467 }
468 /* method simple_misc_analysis#AIfexprExpr#after_simple_misc for (self: AIfexprExpr, SimpleMiscVisitor) */
469 void simple_misc_analysis__AIfexprExpr__after_simple_misc(val* self, val* p0) {
470 val* var_v /* var v: SimpleMiscVisitor */;
471 val* var /* : AExpr */;
472 var_v = p0;
473 var = ((val* (*)(val*))(self->class->vft[COLOR_parser_nodes__AIfexprExpr__n_expr]))(self) /* n_expr on <self:AIfexprExpr>*/;
474 ((void (*)(val*, val*))(var->class->vft[COLOR_simple_misc_analysis__AExpr__warn_parentheses]))(var, var_v) /* warn_parentheses on <var:AExpr>*/;
475 RET_LABEL:;
476 }
477 /* method simple_misc_analysis#AIfexprExpr#after_simple_misc for (self: Object, SimpleMiscVisitor) */
478 void VIRTUAL_simple_misc_analysis__AIfexprExpr__after_simple_misc(val* self, val* p0) {
479 simple_misc_analysis__AIfexprExpr__after_simple_misc(self, p0);
480 RET_LABEL:;
481 }
482 /* method simple_misc_analysis#AOnceExpr#accept_simple_misc for (self: AOnceExpr, SimpleMiscVisitor) */
483 void simple_misc_analysis__AOnceExpr__accept_simple_misc(val* self, val* p0) {
484 val* var_v /* var v: SimpleMiscVisitor */;
485 long var /* : Int */;
486 long var1 /* : Int */;
487 short int var2 /* : Bool */;
488 short int var4 /* : Bool */;
489 int cltype;
490 int idtype;
491 short int var5 /* : Bool */;
492 static val* varonce;
493 val* var6 /* : String */;
494 char* var7 /* : NativeString */;
495 long var8 /* : Int */;
496 val* var9 /* : String */;
497 long var10 /* : Int */;
498 long var11 /* : Int */;
499 long var12 /* : Int */;
500 long var14 /* : Int */;
501 long var15 /* : Int */;
502 long var16 /* : Int */;
503 long var17 /* : Int */;
504 long var19 /* : Int */;
505 var_v = p0;
506 var = ((long (*)(val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__once_count]))(var_v) /* once_count on <var_v:SimpleMiscVisitor>*/;
507 var1 = 0;
508 { /* Inline kernel#Int#> (var,var1) */
509 /* Covariant cast for argument 0 (i) <var1:Int> isa OTHER */
510 /* <var1:Int> isa OTHER */
511 var4 = 1; /* easy <var1:Int> isa OTHER*/
512 if (!var4) {
513 fprintf(stderr, "Runtime error: %s (%s:%d)\n", "Cast failed", "lib/standard/kernel.nit", 259);
514 exit(1);
515 }
516 var5 = var > var1;
517 var2 = var5;
518 goto RET_LABEL3;
519 RET_LABEL3:(void)0;
520 }
521 if (var2){
522 if (varonce) {
523 var6 = varonce;
524 } else {
525 var7 = "Useless once in a once expression.";
526 var8 = 34;
527 var9 = string__NativeString__to_s_with_length(var7, var8);
528 var6 = var9;
529 varonce = var6;
530 }
531 ((void (*)(val*, val*, val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__warning]))(var_v, self, var6) /* warning on <var_v:SimpleMiscVisitor>*/;
532 } else {
533 }
534 var10 = ((long (*)(val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__once_count]))(var_v) /* once_count on <var_v:SimpleMiscVisitor>*/;
535 var11 = 1;
536 { /* Inline kernel#Int#+ (var10,var11) */
537 var14 = var10 + var11;
538 var12 = var14;
539 goto RET_LABEL13;
540 RET_LABEL13:(void)0;
541 }
542 ((void (*)(val*, long))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__once_count_61d]))(var_v, var12) /* once_count= on <var_v:SimpleMiscVisitor>*/;
543 ((void (*)(val*, val*))(self->class->vft[COLOR_simple_misc_analysis__AOnceExpr__accept_simple_misc]))(self, p0) /* accept_simple_misc on <self:AOnceExpr>*/;
544 var15 = ((long (*)(val*))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__once_count]))(var_v) /* once_count on <var_v:SimpleMiscVisitor>*/;
545 var16 = 1;
546 { /* Inline kernel#Int#- (var15,var16) */
547 var19 = var15 - var16;
548 var17 = var19;
549 goto RET_LABEL18;
550 RET_LABEL18:(void)0;
551 }
552 ((void (*)(val*, long))(var_v->class->vft[COLOR_simple_misc_analysis__SimpleMiscVisitor__once_count_61d]))(var_v, var17) /* once_count= on <var_v:SimpleMiscVisitor>*/;
553 RET_LABEL:;
554 }
555 /* method simple_misc_analysis#AOnceExpr#accept_simple_misc for (self: Object, SimpleMiscVisitor) */
556 void VIRTUAL_simple_misc_analysis__AOnceExpr__accept_simple_misc(val* self, val* p0) {
557 simple_misc_analysis__AOnceExpr__accept_simple_misc(self, p0);
558 RET_LABEL:;
559 }