First NIT release and new clean mercurial repository
[nit.git] / c_src / compiling._sep.c
1 #include "compiling._sep.h"
2 void compiling___MMSrcModule___compile_prog_to_c(val_t self, val_t param0) {
3 struct trace_t trace = {NULL, "compiling::MMSrcModule::compile_prog_to_c (src/compiling//compiling.nit:26,2--75:23)"};
4 val_t variable0;
5 val_t variable1;
6 val_t variable2;
7 val_t variable3;
8 val_t variable4;
9 val_t variable5;
10 val_t variable6;
11 val_t variable7;
12 val_t variable8;
13 val_t variable9;
14 val_t variable10;
15 val_t variable11;
16 val_t variable12;
17 val_t variable13;
18 val_t variable14;
19 val_t variable15;
20 val_t variable16;
21 val_t variable17;
22 val_t variable18;
23 val_t variable19;
24 val_t variable20;
25 trace.prev = tracehead; tracehead = &trace;
26 variable0 = param0;
27 variable1 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMSrcModule::mhe*/;
28 variable1 = ((partial_order___PartialOrderElement___greaters_and_self_t)CALL(variable1,COLOR_partial_order___PartialOrderElement___greaters_and_self))(variable1) /*PartialOrderElement::greaters_and_self*/;
29 variable1 = ((abstract_collection___Collection___iterator_t)CALL(variable1,COLOR_abstract_collection___Collection___iterator))(variable1) /*Collection::iterator*/;
30 while (true) { /*for*/
31 variable2 = ((abstract_collection___Iterator___is_ok_t)CALL(variable1,COLOR_abstract_collection___Iterator___is_ok))(variable1) /*Iterator::is_ok*/;
32 if (!UNTAG_Bool(variable2)) break; /*for*/
33 variable2 = ((abstract_collection___Iterator___item_t)CALL(variable1,COLOR_abstract_collection___Iterator___item))(variable1) /*Iterator::item*/;
34 variable3 = TAG_Bool(( variable2 /*m*/==NIT_NULL) || VAL_ISA( variable2 /*m*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/;
35 if (!UNTAG_Bool(variable3)) { fprintf(stderr, "Assert failed: src/compiling//compiling.nit:32,4--27\n"); nit_exit(1);}
36 ((compiling_global___MMSrcModule___local_analysis_t)CALL( variable2 /*m*/,COLOR_compiling_global___MMSrcModule___local_analysis))( variable2 /*m*/, variable0 /*tc*/) /*MMSrcModule::local_analysis*/;
37 continue_1: while(0);
38 ((abstract_collection___Iterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*Iterator::next*/;
39 }
40 break_1: while(0);
41 variable2 = ((compiling_global___MMSrcModule___global_analysis_t)CALL( self,COLOR_compiling_global___MMSrcModule___global_analysis))( self, variable0 /*tc*/) /*MMSrcModule::global_analysis*/;
42 variable1 = variable2;
43 variable2 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
44 ((file___String___mkdir_t)CALL(variable2,COLOR_file___String___mkdir))(variable2) /*String::mkdir*/;
45 variable3 = NEW_array___Array___init(); /*new Array[String]*/
46 variable2 = variable3;
47 variable4 = NEW_array___ArraySet___init(); /*new ArraySet[String]*/
48 variable3 = variable4;
49 variable4 = NEW_string___String___with_native(BOX_NativeString("$CLIBDIR/nit_main.c"), TAG_Int(19)); /*new String*/
50 ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable4) /*Array::add*/;
51 variable4 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMSrcModule::mhe*/;
52 variable4 = ((partial_order___PartialOrderElement___greaters_and_self_t)CALL(variable4,COLOR_partial_order___PartialOrderElement___greaters_and_self))(variable4) /*PartialOrderElement::greaters_and_self*/;
53 variable4 = ((abstract_collection___Collection___iterator_t)CALL(variable4,COLOR_abstract_collection___Collection___iterator))(variable4) /*Collection::iterator*/;
54 while (true) { /*for*/
55 variable5 = ((abstract_collection___Iterator___is_ok_t)CALL(variable4,COLOR_abstract_collection___Iterator___is_ok))(variable4) /*Iterator::is_ok*/;
56 if (!UNTAG_Bool(variable5)) break; /*for*/
57 variable5 = ((abstract_collection___Iterator___item_t)CALL(variable4,COLOR_abstract_collection___Iterator___item))(variable4) /*Iterator::item*/;
58 variable6 = TAG_Bool(( variable5 /*m*/==NIT_NULL) || VAL_ISA( variable5 /*m*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/;
59 if (!UNTAG_Bool(variable6)) { fprintf(stderr, "Assert failed: src/compiling//compiling.nit:44,4--27\n"); nit_exit(1);}
60 variable6 = NEW_string___String___init(); /*new String*/
61 variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
62 variable8 = variable7;
63 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
64 variable9 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
65 variable10 = variable9;
66 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
67 variable11 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
68 variable12 = variable11;
69 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
70 variable13 = ((abstractmetamodel___MMModule___name_t)CALL( variable5 /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable5 /*m*/) /*MMSrcModule::name*/;
71 variable14 = variable13;
72 variable14 = ((string___String___to_s_t)CALL(variable14,COLOR_string___Object___to_s))(variable14) /*String::to_s*/;
73 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/;
74 variable15 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
75 variable16 = variable15;
76 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/;
77 variable17 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
78 variable18 = variable17;
79 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable18) /*String::append*/;
80 variable19 = NEW_string___String___with_native(BOX_NativeString("_sep.c"), TAG_Int(6)); /*new String*/
81 variable20 = variable19;
82 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable20) /*String::append*/;
83 ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable6) /*Array::add*/;
84 ((compiling___MMSrcModule___compile_separate_module_t)CALL( variable5 /*m*/,COLOR_compiling___MMSrcModule___compile_separate_module))( variable5 /*m*/, variable0 /*tc*/, variable1 /*ga*/) /*MMSrcModule::compile_separate_module*/;
85 variable7 = ((mmloader___MMModule___filename_t)CALL( variable5 /*m*/,COLOR_mmloader___MMModule___filename))( variable5 /*m*/) /*MMSrcModule::filename*/;
86 variable8 = NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/
87 variable7 = ((file___String___strip_extension_t)CALL(variable7,COLOR_file___String___strip_extension))(variable7, variable8) /*String::strip_extension*/;
88 variable6 = variable7;
89 variable7 = NEW_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/
90 variable7 = ((string___String_____plus_t)CALL( variable6 /*native_name*/,COLOR_string___String_____plus))( variable6 /*native_name*/, variable7) /*String::+*/;
91 variable7 = ((file___String___file_exists_t)CALL(variable7,COLOR_file___String___file_exists))(variable7) /*String::file_exists*/;
92 if (UNTAG_Bool(variable7)) { /*if*/
93 variable7 = NEW_string___String___init(); /*new String*/
94 variable8 = NEW_string___String___with_native(BOX_NativeString("-I "), TAG_Int(3)); /*new String*/
95 variable9 = variable8;
96 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable9) /*String::append*/;
97 variable10 = ((file___String___dirname_t)CALL( variable6 /*native_name*/,COLOR_file___String___dirname))( variable6 /*native_name*/) /*String::dirname*/;
98 variable11 = variable10;
99 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable11) /*String::append*/;
100 variable12 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
101 variable13 = variable12;
102 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable13) /*String::append*/;
103 ((array___ArraySet___add_t)CALL( variable3 /*includes*/,COLOR_abstract_collection___SimpleCollection___add))( variable3 /*includes*/, variable7) /*ArraySet::add*/;
104 }
105 variable7 = NEW_string___String___with_native(BOX_NativeString("_nit.c"), TAG_Int(6)); /*new String*/
106 ((string___String___append_t)CALL( variable6 /*native_name*/,COLOR_abstract_collection___IndexedCollection___append))( variable6 /*native_name*/, variable7) /*String::append*/;
107 variable7 = ((file___String___file_exists_t)CALL( variable6 /*native_name*/,COLOR_file___String___file_exists))( variable6 /*native_name*/) /*String::file_exists*/;
108 if (UNTAG_Bool(variable7)) { /*if*/
109 ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable6 /*native_name*/) /*Array::add*/;
110 }
111 continue_2: while(0);
112 ((abstract_collection___Iterator___next_t)CALL(variable4,COLOR_abstract_collection___Iterator___next))(variable4) /*Iterator::next*/;
113 }
114 break_2: while(0);
115 variable4 = NEW_string___String___init(); /*new String*/
116 variable5 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
117 variable6 = variable5;
118 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/;
119 variable7 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
120 variable8 = variable7;
121 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable8) /*String::append*/;
122 variable9 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
123 variable10 = variable9;
124 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable10) /*String::append*/;
125 variable11 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
126 variable12 = variable11;
127 variable12 = ((string___String___to_s_t)CALL(variable12,COLOR_string___Object___to_s))(variable12) /*String::to_s*/;
128 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable12) /*String::append*/;
129 variable13 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
130 variable14 = variable13;
131 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable14) /*String::append*/;
132 variable15 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
133 variable16 = variable15;
134 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable16) /*String::append*/;
135 variable17 = NEW_string___String___with_native(BOX_NativeString("_tables.c"), TAG_Int(9)); /*new String*/
136 variable18 = variable17;
137 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable18) /*String::append*/;
138 ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable4) /*Array::add*/;
139 ((compiling___MMSrcModule___compile_main_t)CALL( self,COLOR_compiling___MMSrcModule___compile_main))( self, variable0 /*tc*/, variable1 /*ga*/) /*MMSrcModule::compile_main*/;
140 variable5 = NEW_string___String___init(); /*new String*/
141 variable6 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
142 variable7 = variable6;
143 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/;
144 variable8 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
145 variable9 = variable8;
146 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/;
147 variable10 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
148 variable11 = variable10;
149 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/;
150 variable12 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
151 variable13 = variable12;
152 variable13 = ((string___String___to_s_t)CALL(variable13,COLOR_string___Object___to_s))(variable13) /*String::to_s*/;
153 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable13) /*String::append*/;
154 variable14 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
155 variable15 = variable14;
156 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable15) /*String::append*/;
157 variable16 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
158 variable17 = variable16;
159 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable17) /*String::append*/;
160 variable18 = NEW_string___String___with_native(BOX_NativeString("_build.sh"), TAG_Int(9)); /*new String*/
161 variable19 = variable18;
162 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable19) /*String::append*/;
163 variable4 = variable5;
164 variable6 = NEW_file___OFStream___open( variable4 /*fn*/); /*new OFStream*/
165 variable5 = variable6;
166 variable6 = NEW_string___String___with_native(BOX_NativeString("#!/bin/sh\n"), TAG_Int(10)); /*new String*/
167 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
168 variable6 = NEW_string___String___init(); /*new String*/
169 variable7 = NEW_string___String___with_native(BOX_NativeString("CLIBDIR=\""), TAG_Int(9)); /*new String*/
170 variable8 = variable7;
171 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
172 variable9 = ((compiling_base___ToolContext___clibdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___clibdir))( variable0 /*tc*/) /*ToolContext::clibdir*/;
173 variable10 = variable9;
174 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
175 variable11 = NEW_string___String___with_native(BOX_NativeString("\"\n"), TAG_Int(2)); /*new String*/
176 variable12 = variable11;
177 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
178 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
179 variable6 = NEW_string___String___init(); /*new String*/
180 variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
181 variable8 = variable7;
182 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
183 variable9 = ((compiling_base___ToolContext___bindir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___bindir))( variable0 /*tc*/) /*ToolContext::bindir*/;
184 variable10 = variable9;
185 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
186 variable11 = NEW_string___String___with_native(BOX_NativeString("/gccx -d "), TAG_Int(9)); /*new String*/
187 variable12 = variable11;
188 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
189 variable13 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
190 variable14 = variable13;
191 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/;
192 variable15 = NEW_string___String___with_native(BOX_NativeString(" -I $CLIBDIR "), TAG_Int(13)); /*new String*/
193 variable16 = variable15;
194 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/;
195 variable17 = NEW_string___String___with_native(BOX_NativeString(" "), TAG_Int(1)); /*new String*/
196 variable17 = ((string___Collection___join_t)CALL( variable3 /*includes*/,COLOR_string___Collection___join))( variable3 /*includes*/, variable17) /*ArraySet::join*/;
197 variable18 = variable17;
198 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable18) /*String::append*/;
199 variable19 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
200 variable20 = variable19;
201 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable20) /*String::append*/;
202 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
203 variable6 = ((compiling_base___ToolContext___output_file_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___output_file))( variable0 /*tc*/) /*ToolContext::output_file*/;
204 variable6 = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable6 == NIT_NULL /*null*/) || ((variable6 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable6,COLOR_kernel___Object_____eqeq))(variable6, NIT_NULL /*null*/) /*String::==*/)))));
205 if (UNTAG_Bool(variable6)) { /*if*/
206 variable6 = NEW_string___String___init(); /*new String*/
207 variable7 = NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/
208 variable8 = variable7;
209 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
210 variable9 = ((compiling_base___ToolContext___output_file_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___output_file))( variable0 /*tc*/) /*ToolContext::output_file*/;
211 variable10 = variable9;
212 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
213 variable11 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
214 variable12 = variable11;
215 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
216 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
217 } else { /*if*/
218 variable6 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
219 variable6 = ((array___AbstractArray___is_empty_t)CALL(variable6,COLOR_abstract_collection___Collection___is_empty))(variable6) /*String::is_empty*/;
220 if (UNTAG_Bool(variable6)) { /*if*/
221 variable6 = NEW_string___String___init(); /*new String*/
222 variable7 = NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/
223 variable8 = variable7;
224 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
225 variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
226 variable10 = variable9;
227 variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/;
228 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
229 variable11 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
230 variable12 = variable11;
231 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
232 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
233 } else { /*if*/
234 variable6 = NEW_string___String___init(); /*new String*/
235 variable7 = NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/
236 variable8 = variable7;
237 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
238 variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
239 variable10 = variable9;
240 variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/;
241 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
242 variable11 = NEW_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/
243 variable12 = variable11;
244 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
245 variable13 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
246 variable14 = variable13;
247 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/;
248 variable15 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
249 variable16 = variable15;
250 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/;
251 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
252 }
253 }
254 variable6 = ((compiling_base___ToolContext___boost_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___boost))( variable0 /*tc*/) /*ToolContext::boost*/;
255 if (UNTAG_Bool(variable6)) { /*if*/
256 variable6 = NEW_string___String___with_native(BOX_NativeString(" -O"), TAG_Int(3)); /*new String*/
257 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
258 }
259 variable6 = NEW_string___String___init(); /*new String*/
260 variable7 = NEW_string___String___with_native(BOX_NativeString(" \"$@\" \\\n "), TAG_Int(10)); /*new String*/
261 variable8 = variable7;
262 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
263 variable9 = NEW_string___String___with_native(BOX_NativeString("\\\n "), TAG_Int(4)); /*new String*/
264 variable9 = ((string___Collection___join_t)CALL( variable2 /*files*/,COLOR_string___Collection___join))( variable2 /*files*/, variable9) /*Array::join*/;
265 variable10 = variable9;
266 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
267 variable11 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
268 variable12 = variable11;
269 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
270 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
271 ((file___OFStream___close_t)CALL( variable5 /*f*/,COLOR_stream___IOS___close))( variable5 /*f*/) /*OFStream::close*/;
272 variable6 = ((compiling_base___ToolContext___no_cc_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___no_cc))( variable0 /*tc*/) /*ToolContext::no_cc*/;
273 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable6)))) { /*if*/
274 variable6 = (G_sys);
275 variable7 = NEW_string___String___init(); /*new String*/
276 variable8 = NEW_string___String___with_native(BOX_NativeString("sh "), TAG_Int(3)); /*new String*/
277 variable9 = variable8;
278 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable9) /*String::append*/;
279 variable10 = variable4 /*fn*/;
280 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable10) /*String::append*/;
281 variable11 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
282 variable12 = variable11;
283 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable12) /*String::append*/;
284 ((exec___Sys___system_t)CALL(variable6,COLOR_exec___Sys___system))(variable6, variable7) /*Sys::system*/;
285 }
286 tracehead = trace.prev;
287 return;
288 }
289 void compiling___MMSrcModule___compile_main(val_t self, val_t param0, val_t param1) {
290 struct trace_t trace = {NULL, "compiling::MMSrcModule::compile_main (src/compiling//compiling.nit:79,2--93:9)"};
291 val_t variable0;
292 val_t variable1;
293 val_t variable2;
294 val_t variable3;
295 val_t variable4;
296 val_t variable5;
297 val_t variable6;
298 val_t variable7;
299 val_t variable8;
300 val_t variable9;
301 val_t variable10;
302 val_t variable11;
303 val_t variable12;
304 val_t variable13;
305 val_t variable14;
306 val_t variable15;
307 val_t variable16;
308 val_t variable17;
309 val_t variable18;
310 trace.prev = tracehead; tracehead = &trace;
311 variable0 = param0;
312 variable1 = param1;
313 variable3 = NEW_compiling_base___CompilerVisitor___init( self); /*new CompilerVisitor*/
314 variable2 = variable3;
315 ((compiling_base___CompilerVisitor___tc__eq_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___tc__eq))( variable2 /*v*/, variable0 /*tc*/) /*CompilerVisitor::tc=*/;
316 ((compiling_global___CompilerVisitor___global_analysis__eq_t)CALL( variable2 /*v*/,COLOR_compiling_global___CompilerVisitor___global_analysis__eq))( variable2 /*v*/, variable1 /*ga*/) /*CompilerVisitor::global_analysis=*/;
317 variable3 = NEW_string___String___with_native(BOX_NativeString("#include <nit_common.h>"), TAG_Int(23)); /*new String*/
318 ((compiling_base___CompilerVisitor___add_decl_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___add_decl))( variable2 /*v*/, variable3) /*CompilerVisitor::add_decl*/;
319 ((compiling_global___MMSrcModule___compile_tables_to_c_t)CALL( self,COLOR_compiling_global___MMSrcModule___compile_tables_to_c))( self, variable2 /*v*/) /*MMSrcModule::compile_tables_to_c*/;
320 ((compiling_global___MMSrcModule___compile_main_part_t)CALL( self,COLOR_compiling_global___MMSrcModule___compile_main_part))( self, variable2 /*v*/) /*MMSrcModule::compile_main_part*/;
321 variable4 = NEW_string___String___init(); /*new String*/
322 variable5 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
323 variable6 = variable5;
324 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/;
325 variable7 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
326 variable8 = variable7;
327 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable8) /*String::append*/;
328 variable9 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
329 variable10 = variable9;
330 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable10) /*String::append*/;
331 variable11 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
332 variable12 = variable11;
333 variable12 = ((string___String___to_s_t)CALL(variable12,COLOR_string___Object___to_s))(variable12) /*String::to_s*/;
334 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable12) /*String::append*/;
335 variable13 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
336 variable14 = variable13;
337 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable14) /*String::append*/;
338 variable15 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
339 variable16 = variable15;
340 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable16) /*String::append*/;
341 variable17 = NEW_string___String___with_native(BOX_NativeString("_tables.c"), TAG_Int(9)); /*new String*/
342 variable18 = variable17;
343 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable18) /*String::append*/;
344 variable5 = NEW_file___OFStream___open(variable4); /*new OFStream*/
345 variable4 = variable5;
346 variable3 = variable4;
347 variable4 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMSrcModule::mhe*/;
348 variable4 = ((partial_order___PartialOrderElement___greaters_and_self_t)CALL(variable4,COLOR_partial_order___PartialOrderElement___greaters_and_self))(variable4) /*PartialOrderElement::greaters_and_self*/;
349 variable4 = ((abstract_collection___Collection___iterator_t)CALL(variable4,COLOR_abstract_collection___Collection___iterator))(variable4) /*Collection::iterator*/;
350 while (true) { /*for*/
351 variable5 = ((abstract_collection___Iterator___is_ok_t)CALL(variable4,COLOR_abstract_collection___Iterator___is_ok))(variable4) /*Iterator::is_ok*/;
352 if (!UNTAG_Bool(variable5)) break; /*for*/
353 variable5 = ((abstract_collection___Iterator___item_t)CALL(variable4,COLOR_abstract_collection___Iterator___item))(variable4) /*Iterator::item*/;
354 variable6 = NEW_string___String___init(); /*new String*/
355 variable7 = NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/
356 variable8 = variable7;
357 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
358 variable9 = ((abstractmetamodel___MMModule___name_t)CALL( variable5 /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable5 /*m*/) /*MMModule::name*/;
359 variable10 = variable9;
360 variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/;
361 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
362 variable11 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
363 variable12 = variable11;
364 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
365 variable13 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
366 variable14 = variable13;
367 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/;
368 variable15 = NEW_string___String___with_native(BOX_NativeString("_sep.h\"\n"), TAG_Int(8)); /*new String*/
369 variable16 = variable15;
370 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/;
371 ((file___OFStream___write_t)CALL( variable3 /*f*/,COLOR_stream___OStream___write))( variable3 /*f*/, variable6) /*OFStream::write*/;
372 continue_4: while(0);
373 ((abstract_collection___Iterator___next_t)CALL(variable4,COLOR_abstract_collection___Iterator___next))(variable4) /*Iterator::next*/;
374 }
375 break_4: while(0);
376 variable4 = ((compiling_base___CompilerVisitor___to_s_t)CALL( variable2 /*v*/,COLOR_string___Object___to_s))( variable2 /*v*/) /*CompilerVisitor::to_s*/;
377 ((file___OFStream___write_t)CALL( variable3 /*f*/,COLOR_stream___OStream___write))( variable3 /*f*/, variable4) /*OFStream::write*/;
378 ((file___OFStream___close_t)CALL( variable3 /*f*/,COLOR_stream___IOS___close))( variable3 /*f*/) /*OFStream::close*/;
379 tracehead = trace.prev;
380 return;
381 }
382 void compiling___MMSrcModule___compile_separate_module(val_t self, val_t param0, val_t param1) {
383 struct trace_t trace = {NULL, "compiling::MMSrcModule::compile_separate_module (src/compiling//compiling.nit:96,2--119:9)"};
384 val_t variable0;
385 val_t variable1;
386 val_t variable2;
387 val_t variable3;
388 val_t variable4;
389 val_t variable5;
390 val_t variable6;
391 val_t variable7;
392 val_t variable8;
393 val_t variable9;
394 val_t variable10;
395 val_t variable11;
396 val_t variable12;
397 val_t variable13;
398 val_t variable14;
399 val_t variable15;
400 val_t variable16;
401 val_t variable17;
402 val_t variable18;
403 val_t variable19;
404 val_t variable20;
405 trace.prev = tracehead; tracehead = &trace;
406 variable0 = param0;
407 variable1 = param1;
408 variable3 = NEW_compiling_base___CompilerVisitor___init( self); /*new CompilerVisitor*/
409 variable2 = variable3;
410 ((compiling_base___CompilerVisitor___tc__eq_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___tc__eq))( variable2 /*v*/, variable0 /*tc*/) /*CompilerVisitor::tc=*/;
411 ((compiling_global___CompilerVisitor___global_analysis__eq_t)CALL( variable2 /*v*/,COLOR_compiling_global___CompilerVisitor___global_analysis__eq))( variable2 /*v*/, variable1 /*ga*/) /*CompilerVisitor::global_analysis=*/;
412 variable3 = NEW_string___String___with_native(BOX_NativeString("#include <nit_common.h>"), TAG_Int(23)); /*new String*/
413 ((compiling_base___CompilerVisitor___add_decl_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___add_decl))( variable2 /*v*/, variable3) /*CompilerVisitor::add_decl*/;
414 variable4 = ((mmloader___MMModule___filename_t)CALL( self,COLOR_mmloader___MMModule___filename))( self) /*MMSrcModule::filename*/;
415 variable5 = NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/
416 variable4 = ((file___String___strip_extension_t)CALL(variable4,COLOR_file___String___strip_extension))(variable4, variable5) /*String::strip_extension*/;
417 variable3 = variable4;
418 variable4 = NEW_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/
419 ((string___String___append_t)CALL( variable3 /*native_name*/,COLOR_abstract_collection___IndexedCollection___append))( variable3 /*native_name*/, variable4) /*String::append*/;
420 variable4 = ((file___String___file_exists_t)CALL( variable3 /*native_name*/,COLOR_file___String___file_exists))( variable3 /*native_name*/) /*String::file_exists*/;
421 if (UNTAG_Bool(variable4)) { /*if*/
422 variable4 = NEW_string___String___init(); /*new String*/
423 variable5 = NEW_string___String___with_native(BOX_NativeString("#include <"), TAG_Int(10)); /*new String*/
424 variable6 = variable5;
425 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/;
426 variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
427 variable7 = ((file___String___basename_t)CALL( variable3 /*native_name*/,COLOR_file___String___basename))( variable3 /*native_name*/, variable7) /*String::basename*/;
428 variable8 = variable7;
429 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable8) /*String::append*/;
430 variable9 = NEW_string___String___with_native(BOX_NativeString(">"), TAG_Int(1)); /*new String*/
431 variable10 = variable9;
432 ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable10) /*String::append*/;
433 ((compiling_base___CompilerVisitor___add_decl_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___add_decl))( variable2 /*v*/, variable4) /*CompilerVisitor::add_decl*/;
434 }
435 ((compiling_global___MMSrcModule___declare_class_tables_to_c_t)CALL( self,COLOR_compiling_global___MMSrcModule___declare_class_tables_to_c))( self, variable2 /*v*/) /*MMSrcModule::declare_class_tables_to_c*/;
436 ((compiling_global___MMSrcModule___compile_mod_to_c_t)CALL( self,COLOR_compiling_global___MMSrcModule___compile_mod_to_c))( self, variable2 /*v*/) /*MMSrcModule::compile_mod_to_c*/;
437 variable5 = NEW_string___String___init(); /*new String*/
438 variable6 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
439 variable7 = variable6;
440 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/;
441 variable8 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
442 variable9 = variable8;
443 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/;
444 variable10 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
445 variable11 = variable10;
446 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/;
447 variable12 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
448 variable13 = variable12;
449 variable13 = ((string___String___to_s_t)CALL(variable13,COLOR_string___Object___to_s))(variable13) /*String::to_s*/;
450 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable13) /*String::append*/;
451 variable14 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
452 variable15 = variable14;
453 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable15) /*String::append*/;
454 variable16 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
455 variable17 = variable16;
456 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable17) /*String::append*/;
457 variable18 = NEW_string___String___with_native(BOX_NativeString("_sep.h"), TAG_Int(6)); /*new String*/
458 variable19 = variable18;
459 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable19) /*String::append*/;
460 variable6 = NEW_file___OFStream___open(variable5); /*new OFStream*/
461 variable5 = variable6;
462 variable4 = variable5;
463 variable5 = NEW_string___String___init(); /*new String*/
464 variable6 = NEW_string___String___with_native(BOX_NativeString("#ifndef "), TAG_Int(8)); /*new String*/
465 variable7 = variable6;
466 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/;
467 variable8 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
468 variable9 = variable8;
469 variable9 = ((string___String___to_s_t)CALL(variable9,COLOR_string___Object___to_s))(variable9) /*String::to_s*/;
470 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/;
471 variable10 = NEW_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/
472 variable11 = variable10;
473 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/;
474 variable12 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
475 variable13 = variable12;
476 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable13) /*String::append*/;
477 variable14 = NEW_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/
478 variable15 = variable14;
479 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable15) /*String::append*/;
480 ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/;
481 variable5 = NEW_string___String___init(); /*new String*/
482 variable6 = NEW_string___String___with_native(BOX_NativeString("#define "), TAG_Int(8)); /*new String*/
483 variable7 = variable6;
484 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/;
485 variable8 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
486 variable9 = variable8;
487 variable9 = ((string___String___to_s_t)CALL(variable9,COLOR_string___Object___to_s))(variable9) /*String::to_s*/;
488 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/;
489 variable10 = NEW_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/
490 variable11 = variable10;
491 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/;
492 variable12 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
493 variable13 = variable12;
494 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable13) /*String::append*/;
495 variable14 = NEW_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/
496 variable15 = variable14;
497 ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable15) /*String::append*/;
498 ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/;
499 variable5 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMSrcModule::mhe*/;
500 variable5 = ((partial_order___PartialOrderElement___direct_greaters_t)CALL(variable5,COLOR_partial_order___PartialOrderElement___direct_greaters))(variable5) /*PartialOrderElement::direct_greaters*/;
501 variable5 = ((array___AbstractArray___iterator_t)CALL(variable5,COLOR_abstract_collection___Collection___iterator))(variable5) /*Array::iterator*/;
502 while (true) { /*for*/
503 variable6 = ((array___ArrayIterator___is_ok_t)CALL(variable5,COLOR_abstract_collection___Iterator___is_ok))(variable5) /*ArrayIterator::is_ok*/;
504 if (!UNTAG_Bool(variable6)) break; /*for*/
505 variable6 = ((array___ArrayIterator___item_t)CALL(variable5,COLOR_abstract_collection___Iterator___item))(variable5) /*ArrayIterator::item*/;
506 variable7 = NEW_string___String___init(); /*new String*/
507 variable8 = NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/
508 variable9 = variable8;
509 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable9) /*String::append*/;
510 variable10 = ((abstractmetamodel___MMModule___name_t)CALL( variable6 /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable6 /*m*/) /*MMModule::name*/;
511 variable11 = variable10;
512 variable11 = ((string___String___to_s_t)CALL(variable11,COLOR_string___Object___to_s))(variable11) /*String::to_s*/;
513 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable11) /*String::append*/;
514 variable12 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
515 variable13 = variable12;
516 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable13) /*String::append*/;
517 variable14 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
518 variable15 = variable14;
519 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable15) /*String::append*/;
520 variable16 = NEW_string___String___with_native(BOX_NativeString("_sep.h\"\n"), TAG_Int(8)); /*new String*/
521 variable17 = variable16;
522 ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable17) /*String::append*/;
523 ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable7) /*OFStream::write*/;
524 continue_6: while(0);
525 ((array___ArrayIterator___next_t)CALL(variable5,COLOR_abstract_collection___Iterator___next))(variable5) /*ArrayIterator::next*/;
526 }
527 break_6: while(0);
528 variable5 = ((compiling_base___CompilerVisitor___ctx_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___ctx))( variable2 /*v*/) /*CompilerVisitor::ctx*/;
529 variable5 = ((compiling_base___CContext___decls_t)CALL(variable5,COLOR_compiling_base___CContext___decls))(variable5) /*CContext::decls*/;
530 variable6 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
531 variable5 = ((string___Collection___join_t)CALL(variable5,COLOR_string___Collection___join))(variable5, variable6) /*Array::join*/;
532 ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/;
533 variable5 = NEW_string___String___with_native(BOX_NativeString("\n#endif\n"), TAG_Int(8)); /*new String*/
534 ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/;
535 ((file___OFStream___close_t)CALL( variable4 /*f*/,COLOR_stream___IOS___close))( variable4 /*f*/) /*OFStream::close*/;
536 variable6 = NEW_string___String___init(); /*new String*/
537 variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
538 variable8 = variable7;
539 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
540 variable9 = ((compiling_base___ToolContext___base_dir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___base_dir))( variable0 /*tc*/) /*ToolContext::base_dir*/;
541 variable10 = variable9;
542 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
543 variable11 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
544 variable12 = variable11;
545 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
546 variable13 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
547 variable14 = variable13;
548 variable14 = ((string___String___to_s_t)CALL(variable14,COLOR_string___Object___to_s))(variable14) /*String::to_s*/;
549 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/;
550 variable15 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
551 variable16 = variable15;
552 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/;
553 variable17 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
554 variable18 = variable17;
555 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable18) /*String::append*/;
556 variable19 = NEW_string___String___with_native(BOX_NativeString("_sep.c"), TAG_Int(6)); /*new String*/
557 variable20 = variable19;
558 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable20) /*String::append*/;
559 variable7 = NEW_file___OFStream___open(variable6); /*new OFStream*/
560 variable6 = variable7;
561 variable5 = variable6;
562 variable6 = NEW_string___String___init(); /*new String*/
563 variable7 = NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/
564 variable8 = variable7;
565 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/;
566 variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMSrcModule::name*/;
567 variable10 = variable9;
568 variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/;
569 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/;
570 variable11 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
571 variable12 = variable11;
572 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/;
573 variable13 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/;
574 variable14 = variable13;
575 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/;
576 variable15 = NEW_string___String___with_native(BOX_NativeString("_sep.h\"\n"), TAG_Int(8)); /*new String*/
577 variable16 = variable15;
578 ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/;
579 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
580 variable6 = ((compiling_base___CompilerVisitor___ctx_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___ctx))( variable2 /*v*/) /*CompilerVisitor::ctx*/;
581 variable6 = ((compiling_base___CContext___instrs_t)CALL(variable6,COLOR_compiling_base___CContext___instrs))(variable6) /*CContext::instrs*/;
582 variable7 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
583 variable6 = ((string___Collection___join_t)CALL(variable6,COLOR_string___Collection___join))(variable6, variable7) /*Array::join*/;
584 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
585 variable6 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
586 ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/;
587 ((file___OFStream___close_t)CALL( variable5 /*f*/,COLOR_stream___IOS___close))( variable5 /*f*/) /*OFStream::close*/;
588 tracehead = trace.prev;
589 return;
590 }