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
};
8 static val_t once_value_variable2_1
; static int once_bool_variable2_1
;
19 trace
.prev
= tracehead
; tracehead
= &trace
;
20 trace
.file
= LOCATE_utils
;
21 /* check if p<Array[Symbol] with p:Symbol */
22 if (( param0
!=NIT_NULL
) && !VAL_ISA( param0
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled"); fprintf(stderr
, " (%s:%d)\n", LOCATE_utils
, 22); nit_exit(1); } /*cast Array[Symbol]*/;
24 if (once_bool_variable2_1
) variable2
= once_value_variable2_1
;
26 variable2
= ((utils___Object___cmangle_table_t
)CALL( self
,COLOR_utils___Object___cmangle_table
))( self
) /*Object::cmangle_table*/;
27 once_value_variable2_1
= variable2
;
28 once_bool_variable2_1
= true;
30 variable1
= variable2
;
31 variable3
= NEW_String_string___String___init(); /*new String*/
32 variable2
= variable3
;
33 variable3
= ((array___AbstractArray___iterator_t
)CALL( variable0
/*symbols*/,COLOR_abstract_collection___Collection___iterator
))( variable0
/*symbols*/) /*AbstractArray::iterator*/;
34 while (true) { /*for*/
35 variable4
= ((array___ArrayIterator___is_ok_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___is_ok
))(variable3
) /*ArrayIterator::is_ok*/;
36 if (!UNTAG_Bool(variable4
)) break; /*for*/
37 variable4
= ((array___ArrayIterator___item_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___item
))(variable3
) /*ArrayIterator::item*/;
38 variable5
= ((array___AbstractArray___is_empty_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___Collection___is_empty
))( variable2
/*res*/) /*AbstractArray::is_empty*/;
39 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable5
)))) { /*if*/
40 ((string___String___add_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*res*/, TAG_Char('_')) /*String::add*/;
41 ((string___String___add_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*res*/, TAG_Char('_')) /*String::add*/;
42 ((string___String___add_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*res*/, TAG_Char('_')) /*String::add*/;
44 variable5
= TAG_Bool(false);
45 variable6
= TAG_Bool(true);
46 variable8
= ((symbol___Symbol___to_s_t
)CALL( variable4
/*sym*/,COLOR_string___Object___to_s
))( variable4
/*sym*/) /*Symbol::to_s*/;
47 variable7
= variable8
;
48 variable8
= ((array___AbstractArray___iterator_t
)CALL( variable7
/*s*/,COLOR_abstract_collection___Collection___iterator
))( variable7
/*s*/) /*AbstractArray::iterator*/;
49 while (true) { /*for*/
50 variable9
= ((array___ArrayIterator___is_ok_t
)CALL(variable8
,COLOR_abstract_collection___Iterator___is_ok
))(variable8
) /*ArrayIterator::is_ok*/;
51 if (!UNTAG_Bool(variable9
)) break; /*for*/
52 variable9
= ((array___ArrayIterator___item_t
)CALL(variable8
,COLOR_abstract_collection___Iterator___item
))(variable8
) /*ArrayIterator::item*/;
53 variable10
= TAG_Bool(UNTAG_Char( variable9
/*c*/)>=UNTAG_Char( TAG_Char('a')));
54 variable11
= variable10
;
55 if (UNTAG_Bool(variable11
)) { /* and */
56 variable11
= TAG_Bool(UNTAG_Char( variable9
/*c*/)<=UNTAG_Char( TAG_Char('z')));
58 variable10
= variable11
;
59 variable11
= variable10
;
60 if (!UNTAG_Bool(variable11
)) { /* or */
61 variable11
= TAG_Bool(UNTAG_Char( variable9
/*c*/)>=UNTAG_Char( TAG_Char('A')));
62 variable12
= variable11
;
63 if (UNTAG_Bool(variable12
)) { /* and */
64 variable12
= TAG_Bool(UNTAG_Char( variable9
/*c*/)<=UNTAG_Char( TAG_Char('Z')));
66 variable11
= variable12
;
68 variable10
= variable11
;
69 variable11
= variable10
;
70 if (!UNTAG_Bool(variable11
)) { /* or */
71 variable11
= TAG_Bool(UNTAG_Char( variable9
/*c*/)>=UNTAG_Char( TAG_Char('0')));
72 variable12
= variable11
;
73 if (UNTAG_Bool(variable12
)) { /* and */
74 variable12
= TAG_Bool(UNTAG_Char( variable9
/*c*/)<=UNTAG_Char( TAG_Char('9')));
76 variable11
= variable12
;
78 variable10
= variable11
;
79 if (UNTAG_Bool(variable10
)) { /*if*/
80 ((string___String___add_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*res*/, variable9
/*c*/) /*String::add*/;
81 variable5
= TAG_Bool(false) /*underscore=*/;
82 variable6
= TAG_Bool(true) /*normal=*/;
84 variable10
= TAG_Bool(( variable9
/*c*/)==( TAG_Char('_')));
85 variable11
= variable10
;
86 if (UNTAG_Bool(variable11
)) { /* and */
87 variable11
= TAG_Bool(!UNTAG_Bool( variable5
/*underscore*/));
89 variable10
= variable11
;
90 if (UNTAG_Bool(variable10
)) { /*if*/
91 ((string___String___add_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*res*/, variable9
/*c*/) /*String::add*/;
92 variable5
= TAG_Bool(true) /*underscore=*/;
93 variable6
= TAG_Bool(true) /*normal=*/;
95 variable10
= ((abstract_collection___CoupleMap___has_key_t
)CALL( variable1
/*table*/,COLOR_abstract_collection___Map___has_key
))( variable1
/*table*/, variable9
/*c*/) /*CoupleMap::has_key*/;
96 if (UNTAG_Bool(variable10
)) { /*if*/
97 if (UNTAG_Bool( variable6
/*normal*/)) { /*if*/
98 ((string___String___add_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*res*/, TAG_Char('_')) /*String::add*/;
99 ((string___String___add_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*res*/, TAG_Char('_')) /*String::add*/;
101 variable10
= ((abstract_collection___CoupleMap_____bra_t
)CALL( variable1
/*table*/,COLOR_abstract_collection___Map_____bra
))( variable1
/*table*/, variable9
/*c*/) /*CoupleMap::[]*/;
102 ((string___String___append_t
)CALL( variable2
/*res*/,COLOR_abstract_collection___IndexedCollection___append
))( variable2
/*res*/, variable10
) /*String::append*/;
103 variable6
= TAG_Bool(false) /*normal=*/;
104 variable5
= TAG_Bool(false) /*underscore=*/;
108 continue_3
: while(0);
109 ((array___ArrayIterator___next_t
)CALL(variable8
,COLOR_abstract_collection___Iterator___next
))(variable8
) /*ArrayIterator::next*/;
112 continue_2
: while(0);
113 ((array___ArrayIterator___next_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___next
))(variable3
) /*ArrayIterator::next*/;
116 variable1
= variable2
/*res*/;
118 return_label0
: while(false);
119 tracehead
= trace
.prev
;
122 val_t
utils___Object___cmangle_table(val_t self
) {
123 struct trace_t trace
= {NULL
, NULL
, 58, LOCATE_utils___Object___cmangle_table
};
126 trace
.prev
= tracehead
; tracehead
= &trace
;
127 trace
.file
= LOCATE_utils
;
128 variable1
= NEW_HashMap_hash___HashMap___init(); /*new HashMap[Char, String]*/
129 variable0
= variable1
;
130 variable1
= NEW_String_string___String___with_native(BOX_NativeString("plus"), TAG_Int(4)); /*new String*/
131 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('+'), variable1
) /*HashMap::[]=*/;
132 variable1
= NEW_String_string___String___with_native(BOX_NativeString("minus"), TAG_Int(5)); /*new String*/
133 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('-'), variable1
) /*HashMap::[]=*/;
134 variable1
= NEW_String_string___String___with_native(BOX_NativeString("star"), TAG_Int(4)); /*new String*/
135 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('*'), variable1
) /*HashMap::[]=*/;
136 variable1
= NEW_String_string___String___with_native(BOX_NativeString("slash"), TAG_Int(5)); /*new String*/
137 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('/'), variable1
) /*HashMap::[]=*/;
138 variable1
= NEW_String_string___String___with_native(BOX_NativeString("percent"), TAG_Int(7)); /*new String*/
139 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('%'), variable1
) /*HashMap::[]=*/;
140 variable1
= NEW_String_string___String___with_native(BOX_NativeString("bra"), TAG_Int(3)); /*new String*/
141 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('['), variable1
) /*HashMap::[]=*/;
142 variable1
= NEW_String_string___String___with_native(BOX_NativeString("eq"), TAG_Int(2)); /*new String*/
143 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('='), variable1
) /*HashMap::[]=*/;
144 variable1
= NEW_String_string___String___with_native(BOX_NativeString("l"), TAG_Int(1)); /*new String*/
145 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('<'), variable1
) /*HashMap::[]=*/;
146 variable1
= NEW_String_string___String___with_native(BOX_NativeString("g"), TAG_Int(1)); /*new String*/
147 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('>'), variable1
) /*HashMap::[]=*/;
148 variable1
= NEW_String_string___String___with_native(BOX_NativeString("n"), TAG_Int(1)); /*new String*/
149 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('!'), variable1
) /*HashMap::[]=*/;
150 variable1
= NEW_String_string___String___with_native(BOX_NativeString("u"), TAG_Int(1)); /*new String*/
151 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('_'), variable1
) /*HashMap::[]=*/;
152 variable1
= NEW_String_string___String___with_native(BOX_NativeString("at"), TAG_Int(2)); /*new String*/
153 ((hash___HashMap_____braeq_t
)CALL( variable0
/*res*/,COLOR_abstract_collection___Map_____braeq
))( variable0
/*res*/, TAG_Char('@'), variable1
) /*HashMap::[]=*/;
154 variable0
= variable0
/*res*/;
156 return_label4
: while(false);
157 tracehead
= trace
.prev
;