1 /* This C file is generated by NIT to compile module utils. */
2 #include "utils._sep.h"
3 val_t
utils___Object___cmangle(val_t self
, val_t param0
) {
4 struct trace_t trace
= {NULL
, NULL
, 21, LOCATE_utils___Object___cmangle
};
5 static val_t once_value_1
; static int once_bool_1
; /* Once value for variable[4]*/
7 struct WBT_
**closurevariable
= NULL
;
8 trace
.prev
= tracehead
; tracehead
= &trace
;
9 trace
.file
= LOCATE_utils
;
10 /* Register variable[0]: Local variable */
12 /* Register variable[1]: Local variable */
13 /* check if p<Array[Symbol] with p:Symbol */
14 if (( param0
!=NIT_NULL
) && !VAL_ISA( param0
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled"); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_utils___Object___cmangle
, LOCATE_utils
, 22); nit_exit(1); } /*cast Array[Symbol]*/;
16 /* Register variable[2]: Method return value and escape marker */
17 /* Register variable[3]: Local variable */
18 /* Register variable[4]: Once expression result */
19 if (once_bool_1
) variable
[4] = once_value_1
;
21 /* Register variable[4]: Result */
22 variable
[4] = CALL_utils___Object___cmangle_table(variable
[0])(variable
[0]) /*Object::cmangle_table*/;
23 once_value_1
= variable
[4];
26 /* Register variable[4]: Result */
27 variable
[3] = variable
[4];
28 /* Register variable[4]: Local variable */
29 /* Register variable[5]: Result */
30 variable
[5] = NEW_Buffer_string___Buffer___init() /*new Buffer*/;
31 variable
[4] = variable
[5];
32 /* Register variable[5]: For iterator */
33 variable
[5] = CALL_abstract_collection___Collection___iterator( variable
[1] /*symbols*/)( variable
[1] /*symbols*/) /*AbstractArrayRead::iterator*/;
34 while (true) { /*for*/
35 /* Register variable[6]: For 'is_ok' result */
36 variable
[6] = CALL_abstract_collection___Iterator___is_ok(variable
[5])(variable
[5]) /*ArrayIterator::is_ok*/;
37 if (!UNTAG_Bool(variable
[6])) break; /*for*/
38 variable
[6] = CALL_abstract_collection___Iterator___item(variable
[5])(variable
[5]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
39 /* Register variable[7]: Local variable */
40 variable
[7] = variable
[6];
41 /* Register variable[8]: Result */
42 variable
[8] = CALL_abstract_collection___Collection___is_empty( variable
[4] /*res*/)( variable
[4] /*res*/) /*AbstractArrayRead::is_empty*/;
43 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[8])))) { /*if*/
44 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
45 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
46 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
48 /* Register variable[8]: Local variable */
49 variable
[8] = TAG_Bool(false);
50 /* Register variable[9]: Local variable */
51 variable
[9] = TAG_Bool(true);
52 /* Register variable[10]: Local variable */
53 /* Register variable[11]: Result */
54 variable
[11] = CALL_string___Object___to_s( variable
[7] /*sym*/)( variable
[7] /*sym*/) /*Symbol::to_s*/;
55 variable
[10] = variable
[11];
56 /* Register variable[11]: For iterator */
57 variable
[11] = CALL_abstract_collection___Collection___iterator( variable
[10] /*s*/)( variable
[10] /*s*/) /*AbstractArrayRead::iterator*/;
58 while (true) { /*for*/
59 /* Register variable[12]: For 'is_ok' result */
60 variable
[12] = CALL_abstract_collection___Iterator___is_ok(variable
[11])(variable
[11]) /*ArrayIterator::is_ok*/;
61 if (!UNTAG_Bool(variable
[12])) break; /*for*/
62 variable
[12] = CALL_abstract_collection___Iterator___item(variable
[11])(variable
[11]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
63 /* Register variable[13]: Local variable */
64 variable
[13] = variable
[12];
65 /* Register variable[14]: Result */
66 variable
[14] = TAG_Bool(UNTAG_Char( variable
[13] /*c*/)>=UNTAG_Char( TAG_Char('a')));
67 /* Ensure var variable[14]: Left 'and' operand*/
68 if (UNTAG_Bool(variable
[14])) { /* and */
69 /* Register variable[14]: Result */
70 variable
[14] = TAG_Bool(UNTAG_Char( variable
[13] /*c*/)<=UNTAG_Char( TAG_Char('z')));
72 /* Register variable[14]: Result */
73 /* Ensure var variable[14]: Left 'or' operand*/
74 if (!UNTAG_Bool(variable
[14])) { /* or */
75 /* Register variable[14]: Result */
76 variable
[14] = TAG_Bool(UNTAG_Char( variable
[13] /*c*/)>=UNTAG_Char( TAG_Char('A')));
77 /* Ensure var variable[14]: Left 'and' operand*/
78 if (UNTAG_Bool(variable
[14])) { /* and */
79 /* Register variable[14]: Result */
80 variable
[14] = TAG_Bool(UNTAG_Char( variable
[13] /*c*/)<=UNTAG_Char( TAG_Char('Z')));
82 /* Register variable[14]: Result */
84 /* Register variable[14]: Result */
85 /* Ensure var variable[14]: Left 'or' operand*/
86 if (!UNTAG_Bool(variable
[14])) { /* or */
87 /* Register variable[14]: Result */
88 variable
[14] = TAG_Bool(UNTAG_Char( variable
[13] /*c*/)>=UNTAG_Char( TAG_Char('0')));
89 /* Ensure var variable[14]: Left 'and' operand*/
90 if (UNTAG_Bool(variable
[14])) { /* and */
91 /* Register variable[14]: Result */
92 variable
[14] = TAG_Bool(UNTAG_Char( variable
[13] /*c*/)<=UNTAG_Char( TAG_Char('9')));
94 /* Register variable[14]: Result */
96 /* Register variable[14]: Result */
97 if (UNTAG_Bool(variable
[14])) { /*if*/
98 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, variable
[13] /*c*/) /*Buffer::add*/;
99 variable
[8] = TAG_Bool(false) /*underscore=*/;
100 variable
[9] = TAG_Bool(true) /*normal=*/;
102 /* Register variable[14]: Result */
103 variable
[14] = TAG_Bool(( variable
[13] /*c*/)==( TAG_Char('_')));
104 /* Ensure var variable[14]: Left 'and' operand*/
105 if (UNTAG_Bool(variable
[14])) { /* and */
106 variable
[14] = TAG_Bool(!UNTAG_Bool( variable
[8] /*underscore*/));
108 /* Register variable[14]: Result */
109 if (UNTAG_Bool(variable
[14])) { /*if*/
110 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, variable
[13] /*c*/) /*Buffer::add*/;
111 variable
[8] = TAG_Bool(true) /*underscore=*/;
112 variable
[9] = TAG_Bool(true) /*normal=*/;
114 /* Register variable[14]: Result */
115 variable
[14] = CALL_abstract_collection___MapRead___has_key( variable
[3] /*table*/)( variable
[3] /*table*/, variable
[13] /*c*/) /*CoupleMap::has_key*/;
116 if (UNTAG_Bool(variable
[14])) { /*if*/
117 if (UNTAG_Bool( variable
[9] /*normal*/)) { /*if*/
118 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
119 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*res*/)( variable
[4] /*res*/, TAG_Char('_')) /*Buffer::add*/;
121 /* Register variable[14]: Result */
122 variable
[14] = CALL_abstract_collection___MapRead_____bra( variable
[3] /*table*/)( variable
[3] /*table*/, variable
[13] /*c*/) /*CoupleMap::[]*/;
123 CALL_abstract_collection___IndexedCollection___append( variable
[4] /*res*/)( variable
[4] /*res*/, variable
[14]) /*Buffer::append*/;
124 variable
[9] = TAG_Bool(false) /*normal=*/;
125 variable
[8] = TAG_Bool(false) /*underscore=*/;
129 continue_3
: while(0);
130 CALL_abstract_collection___Iterator___next(variable
[11])(variable
[11]) /*ArrayIterator::next*/;
133 continue_2
: while(0);
134 CALL_abstract_collection___Iterator___next(variable
[5])(variable
[5]) /*ArrayIterator::next*/;
137 /* Register variable[5]: Result */
138 variable
[5] = CALL_string___Object___to_s( variable
[4] /*res*/)( variable
[4] /*res*/) /*Buffer::to_s*/;
139 variable
[2] = variable
[5];
141 return_label0
: while(false);
142 tracehead
= trace
.prev
;
145 val_t
utils___Object___cmangle_table(val_t self
) {
146 struct trace_t trace
= {NULL
, NULL
, 58, LOCATE_utils___Object___cmangle_table
};
147 static val_t once_value_5
= NIT_NULL
; /* Once value for string variable[3]*/
148 static val_t once_value_6
= NIT_NULL
; /* Once value for string variable[3]*/
149 static val_t once_value_7
= NIT_NULL
; /* Once value for string variable[3]*/
150 static val_t once_value_8
= NIT_NULL
; /* Once value for string variable[3]*/
151 static val_t once_value_9
= NIT_NULL
; /* Once value for string variable[3]*/
152 static val_t once_value_10
= NIT_NULL
; /* Once value for string variable[3]*/
153 static val_t once_value_11
= NIT_NULL
; /* Once value for string variable[3]*/
154 static val_t once_value_12
= NIT_NULL
; /* Once value for string variable[3]*/
155 static val_t once_value_13
= NIT_NULL
; /* Once value for string variable[3]*/
156 static val_t once_value_14
= NIT_NULL
; /* Once value for string variable[3]*/
157 static val_t once_value_15
= NIT_NULL
; /* Once value for string variable[3]*/
158 static val_t once_value_16
= NIT_NULL
; /* Once value for string variable[3]*/
160 struct WBT_
**closurevariable
= NULL
;
161 trace
.prev
= tracehead
; tracehead
= &trace
;
162 trace
.file
= LOCATE_utils
;
163 /* Register variable[0]: Local variable */
165 /* Register variable[1]: Method return value and escape marker */
166 /* Register variable[2]: Local variable */
167 /* Register variable[3]: Result */
168 variable
[3] = NEW_HashMap_hash___HashMap___init() /*new HashMap[Char, String]*/;
169 variable
[2] = variable
[3];
170 /* Register variable[3]: Once String constant */
171 if (once_value_5
!= NIT_NULL
) variable
[3] = once_value_5
;
173 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("plus"), TAG_Int(4)) /*new String*/;
174 once_value_5
= variable
[3];
176 /* Register variable[3]: Result */
177 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('+'), variable
[3]) /*HashMap::[]=*/;
178 /* Register variable[3]: Once String constant */
179 if (once_value_6
!= NIT_NULL
) variable
[3] = once_value_6
;
181 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("minus"), TAG_Int(5)) /*new String*/;
182 once_value_6
= variable
[3];
184 /* Register variable[3]: Result */
185 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('-'), variable
[3]) /*HashMap::[]=*/;
186 /* Register variable[3]: Once String constant */
187 if (once_value_7
!= NIT_NULL
) variable
[3] = once_value_7
;
189 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("star"), TAG_Int(4)) /*new String*/;
190 once_value_7
= variable
[3];
192 /* Register variable[3]: Result */
193 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('*'), variable
[3]) /*HashMap::[]=*/;
194 /* Register variable[3]: Once String constant */
195 if (once_value_8
!= NIT_NULL
) variable
[3] = once_value_8
;
197 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("slash"), TAG_Int(5)) /*new String*/;
198 once_value_8
= variable
[3];
200 /* Register variable[3]: Result */
201 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('/'), variable
[3]) /*HashMap::[]=*/;
202 /* Register variable[3]: Once String constant */
203 if (once_value_9
!= NIT_NULL
) variable
[3] = once_value_9
;
205 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("percent"), TAG_Int(7)) /*new String*/;
206 once_value_9
= variable
[3];
208 /* Register variable[3]: Result */
209 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('%'), variable
[3]) /*HashMap::[]=*/;
210 /* Register variable[3]: Once String constant */
211 if (once_value_10
!= NIT_NULL
) variable
[3] = once_value_10
;
213 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("bra"), TAG_Int(3)) /*new String*/;
214 once_value_10
= variable
[3];
216 /* Register variable[3]: Result */
217 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('['), variable
[3]) /*HashMap::[]=*/;
218 /* Register variable[3]: Once String constant */
219 if (once_value_11
!= NIT_NULL
) variable
[3] = once_value_11
;
221 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("eq"), TAG_Int(2)) /*new String*/;
222 once_value_11
= variable
[3];
224 /* Register variable[3]: Result */
225 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('='), variable
[3]) /*HashMap::[]=*/;
226 /* Register variable[3]: Once String constant */
227 if (once_value_12
!= NIT_NULL
) variable
[3] = once_value_12
;
229 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("l"), TAG_Int(1)) /*new String*/;
230 once_value_12
= variable
[3];
232 /* Register variable[3]: Result */
233 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('<'), variable
[3]) /*HashMap::[]=*/;
234 /* Register variable[3]: Once String constant */
235 if (once_value_13
!= NIT_NULL
) variable
[3] = once_value_13
;
237 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("g"), TAG_Int(1)) /*new String*/;
238 once_value_13
= variable
[3];
240 /* Register variable[3]: Result */
241 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('>'), variable
[3]) /*HashMap::[]=*/;
242 /* Register variable[3]: Once String constant */
243 if (once_value_14
!= NIT_NULL
) variable
[3] = once_value_14
;
245 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("n"), TAG_Int(1)) /*new String*/;
246 once_value_14
= variable
[3];
248 /* Register variable[3]: Result */
249 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('!'), variable
[3]) /*HashMap::[]=*/;
250 /* Register variable[3]: Once String constant */
251 if (once_value_15
!= NIT_NULL
) variable
[3] = once_value_15
;
253 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("u"), TAG_Int(1)) /*new String*/;
254 once_value_15
= variable
[3];
256 /* Register variable[3]: Result */
257 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('_'), variable
[3]) /*HashMap::[]=*/;
258 /* Register variable[3]: Once String constant */
259 if (once_value_16
!= NIT_NULL
) variable
[3] = once_value_16
;
261 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("at"), TAG_Int(2)) /*new String*/;
262 once_value_16
= variable
[3];
264 /* Register variable[3]: Result */
265 CALL_abstract_collection___Map_____braeq( variable
[2] /*res*/)( variable
[2] /*res*/, TAG_Char('@'), variable
[3]) /*HashMap::[]=*/;
266 variable
[1] = variable
[2] /*res*/;
268 return_label4
: while(false);
269 tracehead
= trace
.prev
;