1 /* This C file is generated by NIT to compile module compiling. */
2 #include "compiling._sep.h"
3 void compiling___MMSrcModule___compile_prog_to_c(val_t self
, val_t param0
) {
4 struct trace_t trace
= {NULL
, LOCATE_compiling
, 26, LOCATE_compiling___MMSrcModule___compile_prog_to_c
};
26 trace
.prev
= tracehead
; tracehead
= &trace
;
28 variable1
= ((abstractmetamodel___MMModule___mhe_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___mhe
))( self
) /*MMModule::mhe*/;
29 variable1
= ((partial_order___PartialOrderElement___greaters_and_self_t
)CALL(variable1
,COLOR_partial_order___PartialOrderElement___greaters_and_self
))(variable1
) /*PartialOrderElement::greaters_and_self*/;
30 variable1
= ((abstract_collection___Collection___iterator_t
)CALL(variable1
,COLOR_abstract_collection___Collection___iterator
))(variable1
) /*Collection::iterator*/;
31 while (true) { /*for*/
32 variable2
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___is_ok
))(variable1
) /*Iterator::is_ok*/;
33 if (!UNTAG_Bool(variable2
)) break; /*for*/
34 variable2
= ((abstract_collection___Iterator___item_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___item
))(variable1
) /*Iterator::item*/;
35 variable3
= TAG_Bool(( variable2
/*m*/==NIT_NULL
) || VAL_ISA( variable2
/*m*/, COLOR_MMSrcModule
, ID_MMSrcModule
)) /*cast MMSrcModule*/;
36 if (!UNTAG_Bool(variable3
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_compiling___MMSrcModule___compile_prog_to_c
, LOCATE_compiling
, 32); nit_exit(1);}
37 ((compiling_global___MMSrcModule___local_analysis_t
)CALL( variable2
/*m*/,COLOR_compiling_global___MMSrcModule___local_analysis
))( variable2
/*m*/, variable0
/*tc*/) /*MMSrcModule::local_analysis*/;
39 ((abstract_collection___Iterator___next_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___next
))(variable1
) /*Iterator::next*/;
42 variable2
= ((compiling_global___MMSrcModule___global_analysis_t
)CALL( self
,COLOR_compiling_global___MMSrcModule___global_analysis
))( self
, variable0
/*tc*/) /*MMSrcModule::global_analysis*/;
43 variable1
= variable2
;
44 variable2
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
45 ((file___String___mkdir_t
)CALL(variable2
,COLOR_file___String___mkdir
))(variable2
) /*String::mkdir*/;
46 variable3
= NEW_array___Array___init(); /*new Array[E]*/
47 variable2
= variable3
;
48 variable4
= NEW_array___ArraySet___init(); /*new ArraySet[E]*/
49 variable3
= variable4
;
50 variable4
= NEW_string___String___with_native(BOX_NativeString("$CLIBDIR/nit_main.c"), TAG_Int(19)); /*new String*/
51 ((array___AbstractArray___add_t
)CALL( variable2
/*files*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*files*/, variable4
) /*AbstractArray::add*/;
52 variable4
= ((abstractmetamodel___MMModule___mhe_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___mhe
))( self
) /*MMModule::mhe*/;
53 variable4
= ((partial_order___PartialOrderElement___greaters_and_self_t
)CALL(variable4
,COLOR_partial_order___PartialOrderElement___greaters_and_self
))(variable4
) /*PartialOrderElement::greaters_and_self*/;
54 variable4
= ((abstract_collection___Collection___iterator_t
)CALL(variable4
,COLOR_abstract_collection___Collection___iterator
))(variable4
) /*Collection::iterator*/;
55 while (true) { /*for*/
56 variable5
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___is_ok
))(variable4
) /*Iterator::is_ok*/;
57 if (!UNTAG_Bool(variable5
)) break; /*for*/
58 variable5
= ((abstract_collection___Iterator___item_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___item
))(variable4
) /*Iterator::item*/;
59 variable6
= TAG_Bool(( variable5
/*m*/==NIT_NULL
) || VAL_ISA( variable5
/*m*/, COLOR_MMSrcModule
, ID_MMSrcModule
)) /*cast MMSrcModule*/;
60 if (!UNTAG_Bool(variable6
)) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_compiling___MMSrcModule___compile_prog_to_c
, LOCATE_compiling
, 44); nit_exit(1);}
61 variable6
= NEW_string___String___init(); /*new String*/
62 variable7
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
63 variable8
= variable7
;
64 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
65 variable9
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
66 variable10
= variable9
;
67 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
68 variable11
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
69 variable12
= variable11
;
70 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
71 variable13
= ((abstractmetamodel___MMModule___name_t
)CALL( variable5
/*m*/,COLOR_abstractmetamodel___MMModule___name
))( variable5
/*m*/) /*MMModule::name*/;
72 variable14
= variable13
;
73 variable14
= ((string___String___to_s_t
)CALL(variable14
,COLOR_string___Object___to_s
))(variable14
) /*String::to_s*/;
74 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable14
) /*String::append*/;
75 variable15
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
76 variable16
= variable15
;
77 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable16
) /*String::append*/;
78 variable17
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
79 variable18
= variable17
;
80 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable18
) /*String::append*/;
81 variable19
= NEW_string___String___with_native(BOX_NativeString("_sep.c"), TAG_Int(6)); /*new String*/
82 variable20
= variable19
;
83 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable20
) /*String::append*/;
84 ((array___AbstractArray___add_t
)CALL( variable2
/*files*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*files*/, variable6
) /*AbstractArray::add*/;
85 ((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*/;
86 variable7
= ((mmloader___MMModule___filename_t
)CALL( variable5
/*m*/,COLOR_mmloader___MMModule___filename
))( variable5
/*m*/) /*MMModule::filename*/;
87 variable8
= NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/
88 variable7
= ((file___String___strip_extension_t
)CALL(variable7
,COLOR_file___String___strip_extension
))(variable7
, variable8
) /*String::strip_extension*/;
89 variable6
= variable7
;
90 variable7
= NEW_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/
91 variable7
= ((string___String_____plus_t
)CALL( variable6
/*native_name*/,COLOR_string___String_____plus
))( variable6
/*native_name*/, variable7
) /*String::+*/;
92 variable7
= ((file___String___file_exists_t
)CALL(variable7
,COLOR_file___String___file_exists
))(variable7
) /*String::file_exists*/;
93 if (UNTAG_Bool(variable7
)) { /*if*/
94 variable7
= NEW_string___String___init(); /*new String*/
95 variable8
= NEW_string___String___with_native(BOX_NativeString("-I "), TAG_Int(3)); /*new String*/
96 variable9
= variable8
;
97 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable9
) /*String::append*/;
98 variable10
= ((file___String___dirname_t
)CALL( variable6
/*native_name*/,COLOR_file___String___dirname
))( variable6
/*native_name*/) /*String::dirname*/;
99 variable11
= variable10
;
100 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable11
) /*String::append*/;
101 variable12
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
102 variable13
= variable12
;
103 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable13
) /*String::append*/;
104 ((array___ArraySet___add_t
)CALL( variable3
/*includes*/,COLOR_abstract_collection___SimpleCollection___add
))( variable3
/*includes*/, variable7
) /*ArraySet::add*/;
106 variable7
= NEW_string___String___with_native(BOX_NativeString("_nit.c"), TAG_Int(6)); /*new String*/
107 ((string___String___append_t
)CALL( variable6
/*native_name*/,COLOR_abstract_collection___IndexedCollection___append
))( variable6
/*native_name*/, variable7
) /*String::append*/;
108 variable7
= ((file___String___file_exists_t
)CALL( variable6
/*native_name*/,COLOR_file___String___file_exists
))( variable6
/*native_name*/) /*String::file_exists*/;
109 if (UNTAG_Bool(variable7
)) { /*if*/
110 ((array___AbstractArray___add_t
)CALL( variable2
/*files*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*files*/, variable6
/*native_name*/) /*AbstractArray::add*/;
112 continue_2
: while(0);
113 ((abstract_collection___Iterator___next_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___next
))(variable4
) /*Iterator::next*/;
116 variable4
= NEW_string___String___init(); /*new String*/
117 variable5
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
118 variable6
= variable5
;
119 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable6
) /*String::append*/;
120 variable7
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
121 variable8
= variable7
;
122 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable8
) /*String::append*/;
123 variable9
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
124 variable10
= variable9
;
125 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable10
) /*String::append*/;
126 variable11
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
127 variable12
= variable11
;
128 variable12
= ((string___String___to_s_t
)CALL(variable12
,COLOR_string___Object___to_s
))(variable12
) /*String::to_s*/;
129 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable12
) /*String::append*/;
130 variable13
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
131 variable14
= variable13
;
132 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable14
) /*String::append*/;
133 variable15
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
134 variable16
= variable15
;
135 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable16
) /*String::append*/;
136 variable17
= NEW_string___String___with_native(BOX_NativeString("_tables.c"), TAG_Int(9)); /*new String*/
137 variable18
= variable17
;
138 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable18
) /*String::append*/;
139 ((array___AbstractArray___add_t
)CALL( variable2
/*files*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*files*/, variable4
) /*AbstractArray::add*/;
140 ((compiling___MMSrcModule___compile_main_t
)CALL( self
,COLOR_compiling___MMSrcModule___compile_main
))( self
, variable0
/*tc*/, variable1
/*ga*/) /*MMSrcModule::compile_main*/;
141 variable5
= NEW_string___String___init(); /*new String*/
142 variable6
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
143 variable7
= variable6
;
144 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable7
) /*String::append*/;
145 variable8
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
146 variable9
= variable8
;
147 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable9
) /*String::append*/;
148 variable10
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
149 variable11
= variable10
;
150 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable11
) /*String::append*/;
151 variable12
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
152 variable13
= variable12
;
153 variable13
= ((string___String___to_s_t
)CALL(variable13
,COLOR_string___Object___to_s
))(variable13
) /*String::to_s*/;
154 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable13
) /*String::append*/;
155 variable14
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
156 variable15
= variable14
;
157 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable15
) /*String::append*/;
158 variable16
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
159 variable17
= variable16
;
160 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable17
) /*String::append*/;
161 variable18
= NEW_string___String___with_native(BOX_NativeString("_build.sh"), TAG_Int(9)); /*new String*/
162 variable19
= variable18
;
163 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable19
) /*String::append*/;
164 variable4
= variable5
;
165 variable6
= NEW_file___OFStream___open( variable4
/*fn*/); /*new OFStream*/
166 variable5
= variable6
;
167 variable6
= NEW_string___String___with_native(BOX_NativeString("#!/bin/sh\n"), TAG_Int(10)); /*new String*/
168 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
169 variable6
= NEW_string___String___init(); /*new String*/
170 variable7
= NEW_string___String___with_native(BOX_NativeString("# This shell script is generated by NIT to compile the program "), TAG_Int(63)); /*new String*/
171 variable8
= variable7
;
172 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
173 variable9
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
174 variable10
= variable9
;
175 variable10
= ((string___String___to_s_t
)CALL(variable10
,COLOR_string___Object___to_s
))(variable10
) /*String::to_s*/;
176 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
177 variable11
= NEW_string___String___with_native(BOX_NativeString(".\n"), TAG_Int(2)); /*new String*/
178 variable12
= variable11
;
179 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
180 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
181 variable6
= NEW_string___String___init(); /*new String*/
182 variable7
= NEW_string___String___with_native(BOX_NativeString("CLIBDIR=\""), TAG_Int(9)); /*new String*/
183 variable8
= variable7
;
184 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
185 variable9
= ((compiling_base___ToolContext___clibdir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___clibdir
))( variable0
/*tc*/) /*ToolContext::clibdir*/;
186 variable10
= variable9
;
187 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
188 variable11
= NEW_string___String___with_native(BOX_NativeString("\"\n"), TAG_Int(2)); /*new String*/
189 variable12
= variable11
;
190 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
191 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
192 variable6
= NEW_string___String___init(); /*new String*/
193 variable7
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
194 variable8
= variable7
;
195 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
196 variable9
= ((compiling_base___ToolContext___bindir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___bindir
))( variable0
/*tc*/) /*ToolContext::bindir*/;
197 variable10
= variable9
;
198 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
199 variable11
= NEW_string___String___with_native(BOX_NativeString("/gccx -d "), TAG_Int(9)); /*new String*/
200 variable12
= variable11
;
201 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
202 variable13
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
203 variable14
= variable13
;
204 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable14
) /*String::append*/;
205 variable15
= NEW_string___String___with_native(BOX_NativeString(" -I $CLIBDIR "), TAG_Int(13)); /*new String*/
206 variable16
= variable15
;
207 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable16
) /*String::append*/;
208 variable17
= NEW_string___String___with_native(BOX_NativeString(" "), TAG_Int(1)); /*new String*/
209 variable17
= ((string___Collection___join_t
)CALL( variable3
/*includes*/,COLOR_string___Collection___join
))( variable3
/*includes*/, variable17
) /*Collection::join*/;
210 variable18
= variable17
;
211 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable18
) /*String::append*/;
212 variable19
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
213 variable20
= variable19
;
214 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable20
) /*String::append*/;
215 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
216 variable6
= ((compiling_base___ToolContext___output_file_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___output_file
))( variable0
/*tc*/) /*ToolContext::output_file*/;
217 variable6
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable6
== NIT_NULL
/*null*/) || ((variable6
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable6
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable6
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable6
,COLOR_kernel___Object_____eqeq
))(variable6
, NIT_NULL
/*null*/) /*Object::==*/)))))));
218 if (UNTAG_Bool(variable6
)) { /*if*/
219 variable6
= NEW_string___String___init(); /*new String*/
220 variable7
= NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/
221 variable8
= variable7
;
222 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
223 variable9
= ((compiling_base___ToolContext___output_file_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___output_file
))( variable0
/*tc*/) /*ToolContext::output_file*/;
224 variable10
= variable9
;
225 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
226 variable11
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
227 variable12
= variable11
;
228 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
229 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
231 variable6
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
232 variable6
= ((array___AbstractArray___is_empty_t
)CALL(variable6
,COLOR_abstract_collection___Collection___is_empty
))(variable6
) /*AbstractArray::is_empty*/;
233 if (UNTAG_Bool(variable6
)) { /*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
) /*MMModule::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(0)); /*new String*/
243 variable12
= variable11
;
244 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
245 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
247 variable6
= NEW_string___String___init(); /*new String*/
248 variable7
= NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/
249 variable8
= variable7
;
250 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
251 variable9
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
252 variable10
= variable9
;
253 variable10
= ((string___String___to_s_t
)CALL(variable10
,COLOR_string___Object___to_s
))(variable10
) /*String::to_s*/;
254 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
255 variable11
= NEW_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/
256 variable12
= variable11
;
257 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
258 variable13
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
259 variable14
= variable13
;
260 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable14
) /*String::append*/;
261 variable15
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
262 variable16
= variable15
;
263 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable16
) /*String::append*/;
264 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
267 variable6
= ((compiling_base___ToolContext___boost_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___boost
))( variable0
/*tc*/) /*ToolContext::boost*/;
268 if (UNTAG_Bool(variable6
)) { /*if*/
269 variable6
= NEW_string___String___with_native(BOX_NativeString(" -O"), TAG_Int(3)); /*new String*/
270 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
272 variable6
= NEW_string___String___init(); /*new String*/
273 variable7
= NEW_string___String___with_native(BOX_NativeString(" \"$@\" \\\n "), TAG_Int(10)); /*new String*/
274 variable8
= variable7
;
275 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
276 variable9
= NEW_string___String___with_native(BOX_NativeString("\\\n "), TAG_Int(4)); /*new String*/
277 variable9
= ((string___Collection___join_t
)CALL( variable2
/*files*/,COLOR_string___Collection___join
))( variable2
/*files*/, variable9
) /*Collection::join*/;
278 variable10
= variable9
;
279 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
280 variable11
= NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
281 variable12
= variable11
;
282 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
283 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
284 ((file___OFStream___close_t
)CALL( variable5
/*f*/,COLOR_stream___IOS___close
))( variable5
/*f*/) /*OFStream::close*/;
285 variable6
= ((compiling_base___ToolContext___no_cc_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___no_cc
))( variable0
/*tc*/) /*ToolContext::no_cc*/;
286 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable6
)))) { /*if*/
288 variable7
= NEW_string___String___init(); /*new String*/
289 variable8
= NEW_string___String___with_native(BOX_NativeString("sh "), TAG_Int(3)); /*new String*/
290 variable9
= variable8
;
291 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable9
) /*String::append*/;
292 variable10
= variable4
/*fn*/;
293 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable10
) /*String::append*/;
294 variable11
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
295 variable12
= variable11
;
296 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable12
) /*String::append*/;
297 ((exec___Sys___system_t
)CALL(variable6
,COLOR_exec___Sys___system
))(variable6
, variable7
) /*Sys::system*/;
299 tracehead
= trace
.prev
;
302 void compiling___MMSrcModule___compile_main(val_t self
, val_t param0
, val_t param1
) {
303 struct trace_t trace
= {NULL
, LOCATE_compiling
, 80, LOCATE_compiling___MMSrcModule___compile_main
};
323 trace
.prev
= tracehead
; tracehead
= &trace
;
326 variable3
= NEW_compiling_base___CompilerVisitor___init( self
); /*new CompilerVisitor*/
327 variable2
= variable3
;
328 ((compiling_base___CompilerVisitor___tc__eq_t
)CALL( variable2
/*v*/,COLOR_compiling_base___CompilerVisitor___tc__eq
))( variable2
/*v*/, variable0
/*tc*/) /*CompilerVisitor::tc=*/;
329 ((compiling_global___CompilerVisitor___global_analysis__eq_t
)CALL( variable2
/*v*/,COLOR_compiling_global___CompilerVisitor___global_analysis__eq
))( variable2
/*v*/, variable1
/*ga*/) /*CompilerVisitor::global_analysis=*/;
330 variable3
= NEW_string___String___with_native(BOX_NativeString("#include <nit_common.h>"), TAG_Int(23)); /*new String*/
331 ((compiling_base___CompilerVisitor___add_decl_t
)CALL( variable2
/*v*/,COLOR_compiling_base___CompilerVisitor___add_decl
))( variable2
/*v*/, variable3
) /*CompilerVisitor::add_decl*/;
332 ((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*/;
333 ((compiling_global___MMSrcModule___compile_main_part_t
)CALL( self
,COLOR_compiling_global___MMSrcModule___compile_main_part
))( self
, variable2
/*v*/) /*MMSrcModule::compile_main_part*/;
334 variable4
= NEW_string___String___init(); /*new String*/
335 variable5
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
336 variable6
= variable5
;
337 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable6
) /*String::append*/;
338 variable7
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
339 variable8
= variable7
;
340 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable8
) /*String::append*/;
341 variable9
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
342 variable10
= variable9
;
343 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable10
) /*String::append*/;
344 variable11
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
345 variable12
= variable11
;
346 variable12
= ((string___String___to_s_t
)CALL(variable12
,COLOR_string___Object___to_s
))(variable12
) /*String::to_s*/;
347 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable12
) /*String::append*/;
348 variable13
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
349 variable14
= variable13
;
350 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable14
) /*String::append*/;
351 variable15
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
352 variable16
= variable15
;
353 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable16
) /*String::append*/;
354 variable17
= NEW_string___String___with_native(BOX_NativeString("_tables.c"), TAG_Int(9)); /*new String*/
355 variable18
= variable17
;
356 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable18
) /*String::append*/;
357 variable5
= NEW_file___OFStream___open(variable4
); /*new OFStream*/
358 variable4
= variable5
;
359 variable3
= variable4
;
360 variable4
= NEW_string___String___init(); /*new String*/
361 variable5
= NEW_string___String___with_native(BOX_NativeString("/* This C file is generated by NIT to compile program "), TAG_Int(54)); /*new String*/
362 variable6
= variable5
;
363 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable6
) /*String::append*/;
364 variable7
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
365 variable8
= variable7
;
366 variable8
= ((string___String___to_s_t
)CALL(variable8
,COLOR_string___Object___to_s
))(variable8
) /*String::to_s*/;
367 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable8
) /*String::append*/;
368 variable9
= NEW_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/
369 variable10
= variable9
;
370 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable10
) /*String::append*/;
371 ((file___OFStream___write_t
)CALL( variable3
/*f*/,COLOR_stream___OStream___write
))( variable3
/*f*/, variable4
) /*OFStream::write*/;
372 variable4
= ((abstractmetamodel___MMModule___mhe_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___mhe
))( self
) /*MMModule::mhe*/;
373 variable4
= ((partial_order___PartialOrderElement___greaters_and_self_t
)CALL(variable4
,COLOR_partial_order___PartialOrderElement___greaters_and_self
))(variable4
) /*PartialOrderElement::greaters_and_self*/;
374 variable4
= ((abstract_collection___Collection___iterator_t
)CALL(variable4
,COLOR_abstract_collection___Collection___iterator
))(variable4
) /*Collection::iterator*/;
375 while (true) { /*for*/
376 variable5
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___is_ok
))(variable4
) /*Iterator::is_ok*/;
377 if (!UNTAG_Bool(variable5
)) break; /*for*/
378 variable5
= ((abstract_collection___Iterator___item_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___item
))(variable4
) /*Iterator::item*/;
379 variable6
= NEW_string___String___init(); /*new String*/
380 variable7
= NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/
381 variable8
= variable7
;
382 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
383 variable9
= ((abstractmetamodel___MMModule___name_t
)CALL( variable5
/*m*/,COLOR_abstractmetamodel___MMModule___name
))( variable5
/*m*/) /*MMModule::name*/;
384 variable10
= variable9
;
385 variable10
= ((string___String___to_s_t
)CALL(variable10
,COLOR_string___Object___to_s
))(variable10
) /*String::to_s*/;
386 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
387 variable11
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
388 variable12
= variable11
;
389 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
390 variable13
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
391 variable14
= variable13
;
392 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable14
) /*String::append*/;
393 variable15
= NEW_string___String___with_native(BOX_NativeString("_sep.h\"\n"), TAG_Int(8)); /*new String*/
394 variable16
= variable15
;
395 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable16
) /*String::append*/;
396 ((file___OFStream___write_t
)CALL( variable3
/*f*/,COLOR_stream___OStream___write
))( variable3
/*f*/, variable6
) /*OFStream::write*/;
397 continue_4
: while(0);
398 ((abstract_collection___Iterator___next_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___next
))(variable4
) /*Iterator::next*/;
401 variable4
= ((compiling_base___CompilerVisitor___to_s_t
)CALL( variable2
/*v*/,COLOR_string___Object___to_s
))( variable2
/*v*/) /*CompilerVisitor::to_s*/;
402 ((file___OFStream___write_t
)CALL( variable3
/*f*/,COLOR_stream___OStream___write
))( variable3
/*f*/, variable4
) /*OFStream::write*/;
403 ((file___OFStream___close_t
)CALL( variable3
/*f*/,COLOR_stream___IOS___close
))( variable3
/*f*/) /*OFStream::close*/;
404 tracehead
= trace
.prev
;
407 void compiling___MMSrcModule___compile_separate_module(val_t self
, val_t param0
, val_t param1
) {
408 struct trace_t trace
= {NULL
, LOCATE_compiling
, 98, LOCATE_compiling___MMSrcModule___compile_separate_module
};
430 trace
.prev
= tracehead
; tracehead
= &trace
;
433 variable3
= NEW_compiling_base___CompilerVisitor___init( self
); /*new CompilerVisitor*/
434 variable2
= variable3
;
435 ((compiling_base___CompilerVisitor___tc__eq_t
)CALL( variable2
/*v*/,COLOR_compiling_base___CompilerVisitor___tc__eq
))( variable2
/*v*/, variable0
/*tc*/) /*CompilerVisitor::tc=*/;
436 ((compiling_global___CompilerVisitor___global_analysis__eq_t
)CALL( variable2
/*v*/,COLOR_compiling_global___CompilerVisitor___global_analysis__eq
))( variable2
/*v*/, variable1
/*ga*/) /*CompilerVisitor::global_analysis=*/;
437 variable3
= NEW_string___String___with_native(BOX_NativeString("#include <nit_common.h>"), TAG_Int(23)); /*new String*/
438 ((compiling_base___CompilerVisitor___add_decl_t
)CALL( variable2
/*v*/,COLOR_compiling_base___CompilerVisitor___add_decl
))( variable2
/*v*/, variable3
) /*CompilerVisitor::add_decl*/;
439 variable4
= ((mmloader___MMModule___filename_t
)CALL( self
,COLOR_mmloader___MMModule___filename
))( self
) /*MMModule::filename*/;
440 variable5
= NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/
441 variable4
= ((file___String___strip_extension_t
)CALL(variable4
,COLOR_file___String___strip_extension
))(variable4
, variable5
) /*String::strip_extension*/;
442 variable3
= variable4
;
443 variable4
= NEW_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/
444 ((string___String___append_t
)CALL( variable3
/*native_name*/,COLOR_abstract_collection___IndexedCollection___append
))( variable3
/*native_name*/, variable4
) /*String::append*/;
445 variable4
= ((file___String___file_exists_t
)CALL( variable3
/*native_name*/,COLOR_file___String___file_exists
))( variable3
/*native_name*/) /*String::file_exists*/;
446 if (UNTAG_Bool(variable4
)) { /*if*/
447 variable4
= NEW_string___String___init(); /*new String*/
448 variable5
= NEW_string___String___with_native(BOX_NativeString("#include <"), TAG_Int(10)); /*new String*/
449 variable6
= variable5
;
450 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable6
) /*String::append*/;
451 variable7
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
452 variable7
= ((file___String___basename_t
)CALL( variable3
/*native_name*/,COLOR_file___String___basename
))( variable3
/*native_name*/, variable7
) /*String::basename*/;
453 variable8
= variable7
;
454 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable8
) /*String::append*/;
455 variable9
= NEW_string___String___with_native(BOX_NativeString(">"), TAG_Int(1)); /*new String*/
456 variable10
= variable9
;
457 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable10
) /*String::append*/;
458 ((compiling_base___CompilerVisitor___add_decl_t
)CALL( variable2
/*v*/,COLOR_compiling_base___CompilerVisitor___add_decl
))( variable2
/*v*/, variable4
) /*CompilerVisitor::add_decl*/;
460 ((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*/;
461 ((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*/;
462 variable5
= NEW_string___String___init(); /*new String*/
463 variable6
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
464 variable7
= variable6
;
465 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable7
) /*String::append*/;
466 variable8
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
467 variable9
= variable8
;
468 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable9
) /*String::append*/;
469 variable10
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
470 variable11
= variable10
;
471 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable11
) /*String::append*/;
472 variable12
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
473 variable13
= variable12
;
474 variable13
= ((string___String___to_s_t
)CALL(variable13
,COLOR_string___Object___to_s
))(variable13
) /*String::to_s*/;
475 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable13
) /*String::append*/;
476 variable14
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
477 variable15
= variable14
;
478 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable15
) /*String::append*/;
479 variable16
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
480 variable17
= variable16
;
481 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable17
) /*String::append*/;
482 variable18
= NEW_string___String___with_native(BOX_NativeString("_sep.h"), TAG_Int(6)); /*new String*/
483 variable19
= variable18
;
484 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable19
) /*String::append*/;
485 variable6
= NEW_file___OFStream___open(variable5
); /*new OFStream*/
486 variable5
= variable6
;
487 variable4
= variable5
;
488 variable5
= NEW_string___String___init(); /*new String*/
489 variable6
= NEW_string___String___with_native(BOX_NativeString("/* This C header file is generated by NIT to compile modules and programs that requires "), TAG_Int(88)); /*new String*/
490 variable7
= variable6
;
491 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable7
) /*String::append*/;
492 variable8
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
493 variable9
= variable8
;
494 variable9
= ((string___String___to_s_t
)CALL(variable9
,COLOR_string___Object___to_s
))(variable9
) /*String::to_s*/;
495 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable9
) /*String::append*/;
496 variable10
= NEW_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/
497 variable11
= variable10
;
498 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable11
) /*String::append*/;
499 ((file___OFStream___write_t
)CALL( variable4
/*f*/,COLOR_stream___OStream___write
))( variable4
/*f*/, variable5
) /*OFStream::write*/;
500 variable5
= NEW_string___String___init(); /*new String*/
501 variable6
= NEW_string___String___with_native(BOX_NativeString("#ifndef "), TAG_Int(8)); /*new String*/
502 variable7
= variable6
;
503 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable7
) /*String::append*/;
504 variable8
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
505 variable9
= variable8
;
506 variable9
= ((string___String___to_s_t
)CALL(variable9
,COLOR_string___Object___to_s
))(variable9
) /*String::to_s*/;
507 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable9
) /*String::append*/;
508 variable10
= NEW_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/
509 variable11
= variable10
;
510 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable11
) /*String::append*/;
511 variable12
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
512 variable13
= variable12
;
513 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable13
) /*String::append*/;
514 variable14
= NEW_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/
515 variable15
= variable14
;
516 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable15
) /*String::append*/;
517 ((file___OFStream___write_t
)CALL( variable4
/*f*/,COLOR_stream___OStream___write
))( variable4
/*f*/, variable5
) /*OFStream::write*/;
518 variable5
= NEW_string___String___init(); /*new String*/
519 variable6
= NEW_string___String___with_native(BOX_NativeString("#define "), TAG_Int(8)); /*new String*/
520 variable7
= variable6
;
521 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable7
) /*String::append*/;
522 variable8
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
523 variable9
= variable8
;
524 variable9
= ((string___String___to_s_t
)CALL(variable9
,COLOR_string___Object___to_s
))(variable9
) /*String::to_s*/;
525 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable9
) /*String::append*/;
526 variable10
= NEW_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/
527 variable11
= variable10
;
528 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable11
) /*String::append*/;
529 variable12
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
530 variable13
= variable12
;
531 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable13
) /*String::append*/;
532 variable14
= NEW_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/
533 variable15
= variable14
;
534 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable15
) /*String::append*/;
535 ((file___OFStream___write_t
)CALL( variable4
/*f*/,COLOR_stream___OStream___write
))( variable4
/*f*/, variable5
) /*OFStream::write*/;
536 variable5
= ((abstractmetamodel___MMModule___mhe_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___mhe
))( self
) /*MMModule::mhe*/;
537 variable5
= ((partial_order___PartialOrderElement___direct_greaters_t
)CALL(variable5
,COLOR_partial_order___PartialOrderElement___direct_greaters
))(variable5
) /*PartialOrderElement::direct_greaters*/;
538 variable5
= ((array___AbstractArray___iterator_t
)CALL(variable5
,COLOR_abstract_collection___Collection___iterator
))(variable5
) /*AbstractArray::iterator*/;
539 while (true) { /*for*/
540 variable6
= ((array___ArrayIterator___is_ok_t
)CALL(variable5
,COLOR_abstract_collection___Iterator___is_ok
))(variable5
) /*ArrayIterator::is_ok*/;
541 if (!UNTAG_Bool(variable6
)) break; /*for*/
542 variable6
= ((array___ArrayIterator___item_t
)CALL(variable5
,COLOR_abstract_collection___Iterator___item
))(variable5
) /*ArrayIterator::item*/;
543 variable7
= NEW_string___String___init(); /*new String*/
544 variable8
= NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/
545 variable9
= variable8
;
546 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable9
) /*String::append*/;
547 variable10
= ((abstractmetamodel___MMModule___name_t
)CALL( variable6
/*m*/,COLOR_abstractmetamodel___MMModule___name
))( variable6
/*m*/) /*MMModule::name*/;
548 variable11
= variable10
;
549 variable11
= ((string___String___to_s_t
)CALL(variable11
,COLOR_string___Object___to_s
))(variable11
) /*String::to_s*/;
550 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable11
) /*String::append*/;
551 variable12
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
552 variable13
= variable12
;
553 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable13
) /*String::append*/;
554 variable14
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
555 variable15
= variable14
;
556 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable15
) /*String::append*/;
557 variable16
= NEW_string___String___with_native(BOX_NativeString("_sep.h\"\n"), TAG_Int(8)); /*new String*/
558 variable17
= variable16
;
559 ((string___String___append_t
)CALL(variable7
,COLOR_abstract_collection___IndexedCollection___append
))(variable7
, variable17
) /*String::append*/;
560 ((file___OFStream___write_t
)CALL( variable4
/*f*/,COLOR_stream___OStream___write
))( variable4
/*f*/, variable7
) /*OFStream::write*/;
561 continue_6
: while(0);
562 ((array___ArrayIterator___next_t
)CALL(variable5
,COLOR_abstract_collection___Iterator___next
))(variable5
) /*ArrayIterator::next*/;
565 variable5
= ((compiling_base___CompilerVisitor___ctx_t
)CALL( variable2
/*v*/,COLOR_compiling_base___CompilerVisitor___ctx
))( variable2
/*v*/) /*CompilerVisitor::ctx*/;
566 variable5
= ((compiling_base___CContext___decls_t
)CALL(variable5
,COLOR_compiling_base___CContext___decls
))(variable5
) /*CContext::decls*/;
567 variable6
= NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
568 variable5
= ((string___Collection___join_t
)CALL(variable5
,COLOR_string___Collection___join
))(variable5
, variable6
) /*Collection::join*/;
569 ((file___OFStream___write_t
)CALL( variable4
/*f*/,COLOR_stream___OStream___write
))( variable4
/*f*/, variable5
) /*OFStream::write*/;
570 variable5
= NEW_string___String___with_native(BOX_NativeString("\n#endif\n"), TAG_Int(8)); /*new String*/
571 ((file___OFStream___write_t
)CALL( variable4
/*f*/,COLOR_stream___OStream___write
))( variable4
/*f*/, variable5
) /*OFStream::write*/;
572 ((file___OFStream___close_t
)CALL( variable4
/*f*/,COLOR_stream___IOS___close
))( variable4
/*f*/) /*OFStream::close*/;
573 variable6
= NEW_string___String___init(); /*new String*/
574 variable7
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
575 variable8
= variable7
;
576 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
577 variable9
= ((compiling_base___ToolContext___base_dir_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___base_dir
))( variable0
/*tc*/) /*ToolContext::base_dir*/;
578 variable10
= variable9
;
579 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
580 variable11
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
581 variable12
= variable11
;
582 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
583 variable13
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
584 variable14
= variable13
;
585 variable14
= ((string___String___to_s_t
)CALL(variable14
,COLOR_string___Object___to_s
))(variable14
) /*String::to_s*/;
586 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable14
) /*String::append*/;
587 variable15
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
588 variable16
= variable15
;
589 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable16
) /*String::append*/;
590 variable17
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
591 variable18
= variable17
;
592 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable18
) /*String::append*/;
593 variable19
= NEW_string___String___with_native(BOX_NativeString("_sep.c"), TAG_Int(6)); /*new String*/
594 variable20
= variable19
;
595 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable20
) /*String::append*/;
596 variable7
= NEW_file___OFStream___open(variable6
); /*new OFStream*/
597 variable6
= variable7
;
598 variable5
= variable6
;
599 variable6
= NEW_string___String___init(); /*new String*/
600 variable7
= NEW_string___String___with_native(BOX_NativeString("/* This C file is generated by NIT to compile module "), TAG_Int(53)); /*new String*/
601 variable8
= variable7
;
602 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
603 variable9
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
604 variable10
= variable9
;
605 variable10
= ((string___String___to_s_t
)CALL(variable10
,COLOR_string___Object___to_s
))(variable10
) /*String::to_s*/;
606 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
607 variable11
= NEW_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/
608 variable12
= variable11
;
609 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
610 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
611 variable6
= NEW_string___String___init(); /*new String*/
612 variable7
= NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/
613 variable8
= variable7
;
614 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
615 variable9
= ((abstractmetamodel___MMModule___name_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___name
))( self
) /*MMModule::name*/;
616 variable10
= variable9
;
617 variable10
= ((string___String___to_s_t
)CALL(variable10
,COLOR_string___Object___to_s
))(variable10
) /*String::to_s*/;
618 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable10
) /*String::append*/;
619 variable11
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
620 variable12
= variable11
;
621 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable12
) /*String::append*/;
622 variable13
= ((compiling_base___ToolContext___ext_prefix_t
)CALL( variable0
/*tc*/,COLOR_compiling_base___ToolContext___ext_prefix
))( variable0
/*tc*/) /*ToolContext::ext_prefix*/;
623 variable14
= variable13
;
624 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable14
) /*String::append*/;
625 variable15
= NEW_string___String___with_native(BOX_NativeString("_sep.h\"\n"), TAG_Int(8)); /*new String*/
626 variable16
= variable15
;
627 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable16
) /*String::append*/;
628 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
629 variable6
= ((compiling_base___CompilerVisitor___ctx_t
)CALL( variable2
/*v*/,COLOR_compiling_base___CompilerVisitor___ctx
))( variable2
/*v*/) /*CompilerVisitor::ctx*/;
630 variable6
= ((compiling_base___CContext___instrs_t
)CALL(variable6
,COLOR_compiling_base___CContext___instrs
))(variable6
) /*CContext::instrs*/;
631 variable7
= NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
632 variable6
= ((string___Collection___join_t
)CALL(variable6
,COLOR_string___Collection___join
))(variable6
, variable7
) /*Collection::join*/;
633 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
634 variable6
= NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
635 ((file___OFStream___write_t
)CALL( variable5
/*f*/,COLOR_stream___OStream___write
))( variable5
/*f*/, variable6
) /*OFStream::write*/;
636 ((file___OFStream___close_t
)CALL( variable5
/*f*/,COLOR_stream___IOS___close
))( variable5
/*f*/) /*OFStream::close*/;
637 tracehead
= trace
.prev
;