c_src: gives c_src its own clibdir
[nit.git] / c_src / escape._sep.c
1 /* This C file is generated by NIT to compile module escape. */
2 #include "escape._sep.h"
3 void escape___EscapableContext___push(val_t self, val_t param0) {
4 struct trace_t trace = {NULL, NULL, 27, LOCATE_escape___EscapableContext___push};
5 val_t variable[4];
6 struct WBT_ **closurevariable = NULL;
7 trace.prev = tracehead; tracehead = &trace;
8 trace.file = LOCATE_escape;
9 /* Register variable[0]: Local variable */
10 variable[0] = self;
11 /* Register variable[1]: Local variable */
12 variable[1] = param0;
13 /* Register variable[2]: Method return value and escape marker */
14 /* Register variable[3]: Result */
15 variable[3] = ATTR_escape___EscapableContext____stack(variable[0]) /*EscapableContext::_stack*/;
16 CALL_abstract_collection___IndexedCollection___push(variable[3])(variable[3], variable[1] /*block*/) /*AbstractArray::push*/;
17 return_label0: while(false);
18 tracehead = trace.prev;
19 return;
20 }
21 val_t escape___EscapableContext___is_empty(val_t self) {
22 struct trace_t trace = {NULL, NULL, 33, LOCATE_escape___EscapableContext___is_empty};
23 val_t variable[3];
24 struct WBT_ **closurevariable = NULL;
25 trace.prev = tracehead; tracehead = &trace;
26 trace.file = LOCATE_escape;
27 /* Register variable[0]: Local variable */
28 variable[0] = self;
29 /* Register variable[1]: Method return value and escape marker */
30 /* Register variable[2]: Result */
31 variable[2] = ATTR_escape___EscapableContext____stack(variable[0]) /*EscapableContext::_stack*/;
32 /* Register variable[2]: Result */
33 variable[2] = CALL_abstract_collection___Collection___is_empty(variable[2])(variable[2]) /*AbstractArrayRead::is_empty*/;
34 variable[1] = variable[2];
35 goto return_label1;
36 return_label1: while(false);
37 tracehead = trace.prev;
38 return variable[1];
39 }
40 val_t escape___EscapableContext___head(val_t self) {
41 struct trace_t trace = {NULL, NULL, 36, LOCATE_escape___EscapableContext___head};
42 val_t variable[3];
43 struct WBT_ **closurevariable = NULL;
44 trace.prev = tracehead; tracehead = &trace;
45 trace.file = LOCATE_escape;
46 /* Register variable[0]: Local variable */
47 variable[0] = self;
48 /* Register variable[1]: Method return value and escape marker */
49 /* Register variable[2]: Result */
50 variable[2] = ATTR_escape___EscapableContext____stack(variable[0]) /*EscapableContext::_stack*/;
51 /* Register variable[2]: Result */
52 variable[2] = CALL_abstract_collection___IndexedCollectionRead___last(variable[2])(variable[2]) /*IndexedCollectionRead::last*/;
53 variable[1] = variable[2];
54 goto return_label2;
55 return_label2: while(false);
56 tracehead = trace.prev;
57 return variable[1];
58 }
59 void escape___EscapableContext___pop(val_t self) {
60 struct trace_t trace = {NULL, NULL, 42, LOCATE_escape___EscapableContext___pop};
61 val_t variable[4];
62 struct WBT_ **closurevariable = NULL;
63 trace.prev = tracehead; tracehead = &trace;
64 trace.file = LOCATE_escape;
65 /* Register variable[0]: Local variable */
66 variable[0] = self;
67 /* Register variable[1]: Method return value and escape marker */
68 /* Register variable[2]: Local variable */
69 /* Register variable[3]: Result */
70 variable[3] = ATTR_escape___EscapableContext____stack(variable[0]) /*EscapableContext::_stack*/;
71 /* Register variable[3]: Result */
72 variable[3] = CALL_abstract_collection___IndexedCollection___pop(variable[3])(variable[3]) /*AbstractArray::pop*/;
73 variable[2] = variable[3];
74 return_label3: while(false);
75 tracehead = trace.prev;
76 return;
77 }
78 val_t escape___EscapableContext___visitor(val_t self) {
79 struct trace_t trace = {NULL, NULL, 48, LOCATE_escape___EscapableContext___visitor};
80 val_t *variable = NULL;
81 struct WBT_ **closurevariable = NULL;
82 trace.prev = tracehead; tracehead = &trace;
83 trace.file = LOCATE_escape;
84 tracehead = trace.prev;
85 return ATTR_escape___EscapableContext____visitor( self) /*EscapableContext::_visitor*/;
86 }
87 void escape___EscapableContext___init(val_t self, val_t param0, int* init_table) {
88 struct trace_t trace = {NULL, NULL, 49, LOCATE_escape___EscapableContext___init};
89 val_t variable[3];
90 struct WBT_ **closurevariable = NULL;
91 trace.prev = tracehead; tracehead = &trace;
92 trace.file = LOCATE_escape;
93 /* Register variable[0]: Local variable */
94 variable[0] = self;
95 /* Register variable[1]: Local variable */
96 variable[1] = param0;
97 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_EscapableContext].i]) return;
98 /* Register variable[2]: Method return value and escape marker */
99 ATTR_escape___EscapableContext____visitor(variable[0]) /*EscapableContext::_visitor*/ = variable[1] /*v*/;
100 return_label4: while(false);
101 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_EscapableContext].i] = 1;
102 tracehead = trace.prev;
103 return;
104 }
105 val_t escape___EscapableBlock___node(val_t self) {
106 struct trace_t trace = {NULL, NULL, 60, LOCATE_escape___EscapableBlock___node};
107 val_t *variable = NULL;
108 struct WBT_ **closurevariable = NULL;
109 trace.prev = tracehead; tracehead = &trace;
110 trace.file = LOCATE_escape;
111 tracehead = trace.prev;
112 return ATTR_escape___EscapableBlock____node( self) /*EscapableBlock::_node*/;
113 }
114 val_t escape___EscapableBlock___is_break_block(val_t self) {
115 struct trace_t trace = {NULL, NULL, 63, LOCATE_escape___EscapableBlock___is_break_block};
116 val_t variable[2];
117 struct WBT_ **closurevariable = NULL;
118 trace.prev = tracehead; tracehead = &trace;
119 trace.file = LOCATE_escape;
120 /* Register variable[0]: Local variable */
121 variable[0] = self;
122 /* Register variable[1]: Method return value and escape marker */
123 variable[1] = TAG_Bool(false);
124 goto return_label5;
125 return_label5: while(false);
126 tracehead = trace.prev;
127 return variable[1];
128 }
129 val_t escape___EscapableBlock___break_list(val_t self) {
130 struct trace_t trace = {NULL, NULL, 66, LOCATE_escape___EscapableBlock___break_list};
131 val_t variable[2];
132 struct WBT_ **closurevariable = NULL;
133 trace.prev = tracehead; tracehead = &trace;
134 trace.file = LOCATE_escape;
135 /* Register variable[0]: Local variable */
136 variable[0] = self;
137 /* Register variable[1]: Method return value and escape marker */
138 variable[1] = NIT_NULL /*null*/;
139 goto return_label6;
140 return_label6: while(false);
141 tracehead = trace.prev;
142 return variable[1];
143 }
144 val_t escape___EscapableBlock___continue_stype(val_t self) {
145 struct trace_t trace = {NULL, NULL, 71, LOCATE_escape___EscapableBlock___continue_stype};
146 val_t variable[2];
147 struct WBT_ **closurevariable = NULL;
148 trace.prev = tracehead; tracehead = &trace;
149 trace.file = LOCATE_escape;
150 /* Register variable[0]: Local variable */
151 variable[0] = self;
152 /* Register variable[1]: Method return value and escape marker */
153 variable[1] = NIT_NULL /*null*/;
154 goto return_label7;
155 return_label7: while(false);
156 tracehead = trace.prev;
157 return variable[1];
158 }
159 void escape___EscapableBlock___init(val_t self, val_t param0, int* init_table) {
160 struct trace_t trace = {NULL, NULL, 74, LOCATE_escape___EscapableBlock___init};
161 val_t variable[3];
162 struct WBT_ **closurevariable = NULL;
163 trace.prev = tracehead; tracehead = &trace;
164 trace.file = LOCATE_escape;
165 /* Register variable[0]: Local variable */
166 variable[0] = self;
167 /* Register variable[1]: Local variable */
168 variable[1] = param0;
169 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_EscapableBlock].i]) return;
170 /* Register variable[2]: Method return value and escape marker */
171 ATTR_escape___EscapableBlock____node(variable[0]) /*EscapableBlock::_node*/ = variable[1] /*node*/;
172 return_label8: while(false);
173 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_EscapableBlock].i] = 1;
174 tracehead = trace.prev;
175 return;
176 }
177 val_t escape___EscapableClosure___is_break_block(val_t self) {
178 struct trace_t trace = {NULL, NULL, 86, LOCATE_escape___EscapableClosure___is_break_block};
179 val_t variable[3];
180 struct WBT_ **closurevariable = NULL;
181 trace.prev = tracehead; tracehead = &trace;
182 trace.file = LOCATE_escape;
183 /* Register variable[0]: Local variable */
184 variable[0] = self;
185 /* Register variable[1]: Method return value and escape marker */
186 /* Register variable[2]: Result */
187 variable[2] = ATTR_escape___EscapableClosure____closure(variable[0]) /*EscapableClosure::_closure*/;
188 /* Register variable[2]: Result */
189 variable[2] = CALL_static_type___MMClosure___is_break(variable[2])(variable[2]) /*MMClosure::is_break*/;
190 variable[1] = variable[2];
191 goto return_label9;
192 return_label9: while(false);
193 tracehead = trace.prev;
194 return variable[1];
195 }
196 val_t escape___EscapableClosure___break_list(val_t self) {
197 struct trace_t trace = {NULL, NULL, 88, LOCATE_escape___EscapableClosure___break_list};
198 val_t *variable = NULL;
199 struct WBT_ **closurevariable = NULL;
200 trace.prev = tracehead; tracehead = &trace;
201 trace.file = LOCATE_escape;
202 tracehead = trace.prev;
203 return ATTR_escape___EscapableClosure____break_list( self) /*EscapableClosure::_break_list*/;
204 }
205 val_t escape___EscapableClosure___continue_stype(val_t self) {
206 struct trace_t trace = {NULL, NULL, 90, LOCATE_escape___EscapableClosure___continue_stype};
207 val_t variable[3];
208 struct WBT_ **closurevariable = NULL;
209 trace.prev = tracehead; tracehead = &trace;
210 trace.file = LOCATE_escape;
211 /* Register variable[0]: Local variable */
212 variable[0] = self;
213 /* Register variable[1]: Method return value and escape marker */
214 /* Register variable[2]: Result */
215 variable[2] = ATTR_escape___EscapableClosure____closure(variable[0]) /*EscapableClosure::_closure*/;
216 /* Register variable[2]: Result */
217 variable[2] = CALL_static_type___MMClosure___signature(variable[2])(variable[2]) /*MMClosure::signature*/;
218 /* Register variable[2]: Result */
219 variable[2] = CALL_static_type___MMSignature___return_type(variable[2])(variable[2]) /*MMSignature::return_type*/;
220 variable[1] = variable[2];
221 goto return_label10;
222 return_label10: while(false);
223 tracehead = trace.prev;
224 return variable[1];
225 }
226 val_t escape___EscapableClosure___closure(val_t self) {
227 struct trace_t trace = {NULL, NULL, 83, LOCATE_escape___EscapableClosure___closure};
228 val_t *variable = NULL;
229 struct WBT_ **closurevariable = NULL;
230 trace.prev = tracehead; tracehead = &trace;
231 trace.file = LOCATE_escape;
232 tracehead = trace.prev;
233 return ATTR_escape___EscapableClosure____closure( self) /*EscapableClosure::_closure*/;
234 }
235 void escape___EscapableClosure___init(val_t self, val_t param0, val_t param1, val_t param2, int* init_table) {
236 struct trace_t trace = {NULL, NULL, 92, LOCATE_escape___EscapableClosure___init};
237 val_t variable[5];
238 struct WBT_ **closurevariable = NULL;
239 trace.prev = tracehead; tracehead = &trace;
240 trace.file = LOCATE_escape;
241 /* Register variable[0]: Local variable */
242 variable[0] = self;
243 /* Register variable[1]: Local variable */
244 variable[1] = param0;
245 /* Register variable[2]: Local variable */
246 variable[2] = param1;
247 /* Register variable[3]: Local variable */
248 variable[3] = param2;
249 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_EscapableClosure].i]) return;
250 /* Register variable[4]: Method return value and escape marker */
251 CALL_escape___EscapableBlock___init(variable[0])(variable[0], variable[1] /*node*/, init_table /*YYY*/) /*EscapableBlock::init*/;
252 ATTR_escape___EscapableClosure____closure(variable[0]) /*EscapableClosure::_closure*/ = variable[2] /*closure*/;
253 ATTR_escape___EscapableClosure____break_list(variable[0]) /*EscapableClosure::_break_list*/ = variable[3] /*break_list*/;
254 return_label11: while(false);
255 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_EscapableClosure].i] = 1;
256 tracehead = trace.prev;
257 return;
258 }
259 val_t escape___AEscapeExpr___escapable_block(val_t self) {
260 struct trace_t trace = {NULL, NULL, 104, LOCATE_escape___AEscapeExpr___escapable_block};
261 val_t *variable = NULL;
262 struct WBT_ **closurevariable = NULL;
263 trace.prev = tracehead; tracehead = &trace;
264 trace.file = LOCATE_escape;
265 tracehead = trace.prev;
266 return ATTR_escape___AEscapeExpr____escapable_block( self) /*AEscapeExpr::_escapable_block*/;
267 }
268 val_t escape___AEscapeExpr___kwname(val_t self) {
269 struct trace_t trace = {NULL, NULL, 107, LOCATE_escape___AEscapeExpr___kwname};
270 val_t *variable = NULL;
271 struct WBT_ **closurevariable = NULL;
272 trace.prev = tracehead; tracehead = &trace;
273 trace.file = LOCATE_escape;
274 fprintf(stderr, "Deferred method called");
275 fprintf(stderr, " (%s:%d)\n", LOCATE_escape, 107);
276 nit_exit(1);
277 tracehead = trace.prev;
278 return NIT_NULL;
279 }
280 val_t escape___AEscapeExpr___compute_escapable_block(val_t self, val_t param0) {
281 struct trace_t trace = {NULL, NULL, 110, LOCATE_escape___AEscapeExpr___compute_escapable_block};
282 static val_t once_value_13 = NIT_NULL; /* Once value for string variable[6]*/
283 static val_t once_value_14 = NIT_NULL; /* Once value for string variable[6]*/
284 val_t variable[7];
285 struct WBT_ **closurevariable = NULL;
286 trace.prev = tracehead; tracehead = &trace;
287 trace.file = LOCATE_escape;
288 /* Register variable[0]: Local variable */
289 variable[0] = self;
290 /* Register variable[1]: Local variable */
291 variable[1] = param0;
292 /* Register variable[2]: Method return value and escape marker */
293 /* Register variable[3]: Local variable */
294 /*variable[3] is variable block*/
295 /* Register variable[4]: Result */
296 variable[4] = CALL_escape___EscapableContext___is_empty( variable[1] /*lctx*/)( variable[1] /*lctx*/) /*EscapableContext::is_empty*/;
297 if (UNTAG_Bool(variable[4])) { /*if*/
298 /* Register variable[4]: Result */
299 variable[4] = CALL_escape___EscapableContext___visitor( variable[1] /*lctx*/)( variable[1] /*lctx*/) /*EscapableContext::visitor*/;
300 variable[5] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
301 /* Register variable[6]: Once String constant */
302 if (once_value_13 != NIT_NULL) variable[6] = once_value_13;
303 else {
304 variable[6] = NEW_String_string___String___with_native(BOX_NativeString("Syntax Error: '"), TAG_Int(15)) /*new String*/;
305 once_value_13 = variable[6];
306 }
307 /* Register variable[6]: Result */
308 /* Ensure var variable[6]: super-string element*/
309 CALL_abstract_collection___SimpleCollection___add(variable[5])(variable[5], variable[6]) /*AbstractArray::add*/;
310 /* Register variable[6]: Result */
311 variable[6] = CALL_escape___AEscapeExpr___kwname(variable[0])(variable[0]) /*AEscapeExpr::kwname*/;
312 /* Ensure var variable[6]: super-string element*/
313 CALL_abstract_collection___SimpleCollection___add(variable[5])(variable[5], variable[6]) /*AbstractArray::add*/;
314 /* Register variable[6]: Once String constant */
315 if (once_value_14 != NIT_NULL) variable[6] = once_value_14;
316 else {
317 variable[6] = NEW_String_string___String___with_native(BOX_NativeString("' statment outside block."), TAG_Int(25)) /*new String*/;
318 once_value_14 = variable[6];
319 }
320 /* Register variable[6]: Result */
321 /* Ensure var variable[6]: super-string element*/
322 CALL_abstract_collection___SimpleCollection___add(variable[5])(variable[5], variable[6]) /*AbstractArray::add*/;
323 /* Register variable[5]: Result */
324 variable[5] = CALL_string___Object___to_s(variable[5])(variable[5]) /*Object::to_s*/;
325 CALL_syntax_base___AbsSyntaxVisitor___error(variable[4])(variable[4], variable[0], variable[5]) /*AbsSyntaxVisitor::error*/;
326 variable[2] = NIT_NULL /*null*/;
327 goto return_label12;
328 }
329 /* Register variable[4]: Result */
330 variable[4] = CALL_escape___EscapableContext___head( variable[1] /*lctx*/)( variable[1] /*lctx*/) /*EscapableContext::head*/;
331 variable[3] = variable[4] /*block=*/;
332 ATTR_escape___AEscapeExpr____escapable_block(variable[0]) /*AEscapeExpr::_escapable_block*/ = variable[3] /*block*/;
333 variable[2] = variable[3] /*block*/;
334 goto return_label12;
335 return_label12: while(false);
336 tracehead = trace.prev;
337 return variable[2];
338 }
339 val_t escape___AContinueExpr___kwname(val_t self) {
340 struct trace_t trace = {NULL, NULL, 126, LOCATE_escape___AContinueExpr___kwname};
341 static val_t once_value_16 = NIT_NULL; /* Once value for string variable[2]*/
342 val_t variable[3];
343 struct WBT_ **closurevariable = NULL;
344 trace.prev = tracehead; tracehead = &trace;
345 trace.file = LOCATE_escape;
346 /* Register variable[0]: Local variable */
347 variable[0] = self;
348 /* Register variable[1]: Method return value and escape marker */
349 /* Register variable[2]: Once String constant */
350 if (once_value_16 != NIT_NULL) variable[2] = once_value_16;
351 else {
352 variable[2] = NEW_String_string___String___with_native(BOX_NativeString("continue"), TAG_Int(8)) /*new String*/;
353 once_value_16 = variable[2];
354 }
355 /* Register variable[2]: Result */
356 variable[1] = variable[2];
357 goto return_label15;
358 return_label15: while(false);
359 tracehead = trace.prev;
360 return variable[1];
361 }
362 val_t escape___ABreakExpr___kwname(val_t self) {
363 struct trace_t trace = {NULL, NULL, 131, LOCATE_escape___ABreakExpr___kwname};
364 static val_t once_value_18 = NIT_NULL; /* Once value for string variable[2]*/
365 val_t variable[3];
366 struct WBT_ **closurevariable = NULL;
367 trace.prev = tracehead; tracehead = &trace;
368 trace.file = LOCATE_escape;
369 /* Register variable[0]: Local variable */
370 variable[0] = self;
371 /* Register variable[1]: Method return value and escape marker */
372 /* Register variable[2]: Once String constant */
373 if (once_value_18 != NIT_NULL) variable[2] = once_value_18;
374 else {
375 variable[2] = NEW_String_string___String___with_native(BOX_NativeString("break"), TAG_Int(5)) /*new String*/;
376 once_value_18 = variable[2];
377 }
378 /* Register variable[2]: Result */
379 variable[1] = variable[2];
380 goto return_label17;
381 return_label17: while(false);
382 tracehead = trace.prev;
383 return variable[1];
384 }