New c_src (with reduced string pool and simplified building)
[nit.git] / c_src / utils._sep.c
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, LOCATE_utils___Object___cmangle, 21};
5 val_t variable0;
6 val_t variable1;
7 val_t variable2;
8 static val_t once_value_variable2_1; static int once_bool_variable2_1;
9 val_t variable3;
10 val_t variable4;
11 val_t variable5;
12 val_t variable6;
13 val_t variable7;
14 val_t variable8;
15 val_t variable9;
16 val_t variable10;
17 val_t variable11;
18 val_t variable12;
19 trace.prev = tracehead; tracehead = &trace;
20 /* check if p<Array[Symbol] with p:Symbol */
21 if (( param0!=NIT_NULL) && !VAL_ISA( param0, COLOR_Array, ID_Array)) { fprintf(stderr, "Cast failled (%s: %d)\n", LOCATE_utils, 22); nit_exit(1); } /*cast Array[Symbol]*/;
22 variable0 = param0;
23 if (once_bool_variable2_1) variable2 = once_value_variable2_1;
24 else {
25 variable2 = ((utils___Object___cmangle_table_t)CALL( self,COLOR_utils___Object___cmangle_table))( self) /*Object::cmangle_table*/;
26 once_value_variable2_1 = variable2;
27 once_bool_variable2_1 = true;
28 }
29 variable1 = variable2;
30 variable3 = NEW_string___String___init(); /*new String*/
31 variable2 = variable3;
32 variable3 = ((array___AbstractArray___iterator_t)CALL( variable0 /*symbols*/,COLOR_abstract_collection___Collection___iterator))( variable0 /*symbols*/) /*Array::iterator*/;
33 while (true) { /*for*/
34 variable4 = ((array___ArrayIterator___is_ok_t)CALL(variable3,COLOR_abstract_collection___Iterator___is_ok))(variable3) /*ArrayIterator::is_ok*/;
35 if (!UNTAG_Bool(variable4)) break; /*for*/
36 variable4 = ((array___ArrayIterator___item_t)CALL(variable3,COLOR_abstract_collection___Iterator___item))(variable3) /*ArrayIterator::item*/;
37 variable5 = ((array___AbstractArray___is_empty_t)CALL( variable2 /*res*/,COLOR_abstract_collection___Collection___is_empty))( variable2 /*res*/) /*String::is_empty*/;
38 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable5)))) { /*if*/
39 ((string___String___add_t)CALL( variable2 /*res*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*res*/, TAG_Char('_')) /*String::add*/;
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 }
43 variable5 = TAG_Bool(false);
44 variable6 = TAG_Bool(true);
45 variable8 = ((symbol___Symbol___to_s_t)CALL( variable4 /*sym*/,COLOR_string___Object___to_s))( variable4 /*sym*/) /*Symbol::to_s*/;
46 variable7 = variable8;
47 variable8 = ((array___AbstractArray___iterator_t)CALL( variable7 /*s*/,COLOR_abstract_collection___Collection___iterator))( variable7 /*s*/) /*String::iterator*/;
48 while (true) { /*for*/
49 variable9 = ((array___ArrayIterator___is_ok_t)CALL(variable8,COLOR_abstract_collection___Iterator___is_ok))(variable8) /*ArrayIterator::is_ok*/;
50 if (!UNTAG_Bool(variable9)) break; /*for*/
51 variable9 = ((array___ArrayIterator___item_t)CALL(variable8,COLOR_abstract_collection___Iterator___item))(variable8) /*ArrayIterator::item*/;
52 variable10 = TAG_Bool(UNTAG_Char( variable9 /*c*/)>=UNTAG_Char( TAG_Char('a')));
53 variable11 = variable10;
54 if (UNTAG_Bool(variable11)) { /* and */
55 variable11 = TAG_Bool(UNTAG_Char( variable9 /*c*/)<=UNTAG_Char( TAG_Char('z')));
56 }
57 variable10 = variable11;
58 variable11 = variable10;
59 if (!UNTAG_Bool(variable11)) { /* or */
60 variable11 = TAG_Bool(UNTAG_Char( variable9 /*c*/)>=UNTAG_Char( TAG_Char('A')));
61 variable12 = variable11;
62 if (UNTAG_Bool(variable12)) { /* and */
63 variable12 = TAG_Bool(UNTAG_Char( variable9 /*c*/)<=UNTAG_Char( TAG_Char('Z')));
64 }
65 variable11 = variable12;
66 }
67 variable10 = variable11;
68 variable11 = variable10;
69 if (!UNTAG_Bool(variable11)) { /* or */
70 variable11 = TAG_Bool(UNTAG_Char( variable9 /*c*/)>=UNTAG_Char( TAG_Char('0')));
71 variable12 = variable11;
72 if (UNTAG_Bool(variable12)) { /* and */
73 variable12 = TAG_Bool(UNTAG_Char( variable9 /*c*/)<=UNTAG_Char( TAG_Char('9')));
74 }
75 variable11 = variable12;
76 }
77 variable10 = variable11;
78 if (UNTAG_Bool(variable10)) { /*if*/
79 ((string___String___add_t)CALL( variable2 /*res*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*res*/, variable9 /*c*/) /*String::add*/;
80 variable5 = TAG_Bool(false) /*underscore=*/;
81 variable6 = TAG_Bool(true) /*normal=*/;
82 } else { /*if*/
83 variable10 = TAG_Bool(( variable9 /*c*/)==( TAG_Char('_')));
84 variable11 = variable10;
85 if (UNTAG_Bool(variable11)) { /* and */
86 variable11 = TAG_Bool(!UNTAG_Bool( variable5 /*underscore*/));
87 }
88 variable10 = variable11;
89 if (UNTAG_Bool(variable10)) { /*if*/
90 ((string___String___add_t)CALL( variable2 /*res*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*res*/, variable9 /*c*/) /*String::add*/;
91 variable5 = TAG_Bool(true) /*underscore=*/;
92 variable6 = TAG_Bool(true) /*normal=*/;
93 } else { /*if*/
94 variable10 = ((abstract_collection___CoupleMap___has_key_t)CALL( variable1 /*table*/,COLOR_abstract_collection___Map___has_key))( variable1 /*table*/, variable9 /*c*/) /*HashMap::has_key*/;
95 if (UNTAG_Bool(variable10)) { /*if*/
96 if (UNTAG_Bool( variable6 /*normal*/)) { /*if*/
97 ((string___String___add_t)CALL( variable2 /*res*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*res*/, TAG_Char('_')) /*String::add*/;
98 ((string___String___add_t)CALL( variable2 /*res*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*res*/, TAG_Char('_')) /*String::add*/;
99 }
100 variable10 = ((abstract_collection___CoupleMap_____bra_t)CALL( variable1 /*table*/,COLOR_abstract_collection___Map_____bra))( variable1 /*table*/, variable9 /*c*/) /*HashMap::[]*/;
101 ((string___String___append_t)CALL( variable2 /*res*/,COLOR_abstract_collection___IndexedCollection___append))( variable2 /*res*/, variable10) /*String::append*/;
102 variable6 = TAG_Bool(false) /*normal=*/;
103 variable5 = TAG_Bool(false) /*underscore=*/;
104 }
105 }
106 }
107 continue_3: while(0);
108 ((array___ArrayIterator___next_t)CALL(variable8,COLOR_abstract_collection___Iterator___next))(variable8) /*ArrayIterator::next*/;
109 }
110 break_3: while(0);
111 continue_2: while(0);
112 ((array___ArrayIterator___next_t)CALL(variable3,COLOR_abstract_collection___Iterator___next))(variable3) /*ArrayIterator::next*/;
113 }
114 break_2: while(0);
115 variable1 = variable2 /*res*/;
116 goto return_label0;
117 return_label0: while(false);
118 tracehead = trace.prev;
119 return variable1;
120 }
121 val_t utils___Object___cmangle_table(val_t self) {
122 struct trace_t trace = {NULL, LOCATE_utils___Object___cmangle_table, 58};
123 val_t variable0;
124 val_t variable1;
125 trace.prev = tracehead; tracehead = &trace;
126 variable1 = NEW_hash___HashMap___init(); /*new HashMap[Char, String]*/
127 variable0 = variable1;
128 variable1 = NEW_string___String___with_native(BOX_NativeString("plus"), TAG_Int(4)); /*new String*/
129 ((hash___HashMap_____braeq_t)CALL( variable0 /*res*/,COLOR_abstract_collection___Map_____braeq))( variable0 /*res*/, TAG_Char('+'), variable1) /*HashMap::[]=*/;
130 variable1 = NEW_string___String___with_native(BOX_NativeString("minus"), TAG_Int(5)); /*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___with_native(BOX_NativeString("star"), TAG_Int(4)); /*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___with_native(BOX_NativeString("slash"), TAG_Int(5)); /*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___with_native(BOX_NativeString("percent"), TAG_Int(7)); /*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___with_native(BOX_NativeString("bra"), TAG_Int(3)); /*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___with_native(BOX_NativeString("eq"), TAG_Int(2)); /*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___with_native(BOX_NativeString("l"), TAG_Int(1)); /*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___with_native(BOX_NativeString("g"), 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___with_native(BOX_NativeString("n"), 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___with_native(BOX_NativeString("u"), 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___with_native(BOX_NativeString("at"), TAG_Int(2)); /*new String*/
151 ((hash___HashMap_____braeq_t)CALL( variable0 /*res*/,COLOR_abstract_collection___Map_____braeq))( variable0 /*res*/, TAG_Char('@'), variable1) /*HashMap::[]=*/;
152 variable0 = variable0 /*res*/;
153 goto return_label4;
154 return_label4: while(false);
155 tracehead = trace.prev;
156 return variable0;
157 }