Add a first comment line for files generated by nitc.
[nit.git] / c_src / nitc._sep.c
1 /* This C file is generated by NIT to compile module nitc. */
2 #include "nitc._sep.h"
3 val_t nitc___NitCompiler___opt_output(val_t self) {
4 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_output (src/nitc.nit:26,2--91)"};
5 trace.prev = tracehead; tracehead = &trace;
6 tracehead = trace.prev;
7 return ATTR_nitc___NitCompiler____opt_output( self) /*NitCompiler::_opt_output*/;
8 }
9 val_t nitc___NitCompiler___opt_boost(val_t self) {
10 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_boost (src/nitc.nit:27,2--94)"};
11 trace.prev = tracehead; tracehead = &trace;
12 tracehead = trace.prev;
13 return ATTR_nitc___NitCompiler____opt_boost( self) /*NitCompiler::_opt_boost*/;
14 }
15 val_t nitc___NitCompiler___opt_no_cc(val_t self) {
16 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_no_cc (src/nitc.nit:28,2--92)"};
17 trace.prev = tracehead; tracehead = &trace;
18 tracehead = trace.prev;
19 return ATTR_nitc___NitCompiler____opt_no_cc( self) /*NitCompiler::_opt_no_cc*/;
20 }
21 val_t nitc___NitCompiler___opt_attr_sim(val_t self) {
22 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_attr_sim (src/nitc.nit:29,2--98)"};
23 trace.prev = tracehead; tracehead = &trace;
24 tracehead = trace.prev;
25 return ATTR_nitc___NitCompiler____opt_attr_sim( self) /*NitCompiler::_opt_attr_sim*/;
26 }
27 val_t nitc___NitCompiler___opt_global(val_t self) {
28 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_global (src/nitc.nit:30,2--92)"};
29 trace.prev = tracehead; tracehead = &trace;
30 tracehead = trace.prev;
31 return ATTR_nitc___NitCompiler____opt_global( self) /*NitCompiler::_opt_global*/;
32 }
33 val_t nitc___NitCompiler___opt_clibdir(val_t self) {
34 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_clibdir (src/nitc.nit:31,2--99)"};
35 trace.prev = tracehead; tracehead = &trace;
36 tracehead = trace.prev;
37 return ATTR_nitc___NitCompiler____opt_clibdir( self) /*NitCompiler::_opt_clibdir*/;
38 }
39 val_t nitc___NitCompiler___opt_bindir(val_t self) {
40 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_bindir (src/nitc.nit:32,2--93)"};
41 trace.prev = tracehead; tracehead = &trace;
42 tracehead = trace.prev;
43 return ATTR_nitc___NitCompiler____opt_bindir( self) /*NitCompiler::_opt_bindir*/;
44 }
45 val_t nitc___NitCompiler___opt_extension_prefix(val_t self) {
46 struct trace_t trace = {NULL, "nitc::NitCompiler::opt_extension_prefix (src/nitc.nit:33,2--131)"};
47 trace.prev = tracehead; tracehead = &trace;
48 tracehead = trace.prev;
49 return ATTR_nitc___NitCompiler____opt_extension_prefix( self) /*NitCompiler::_opt_extension_prefix*/;
50 }
51 void nitc___NitCompiler___init(val_t self, int* init_table) {
52 struct trace_t trace = {NULL, "nitc::NitCompiler::init (src/nitc.nit:35,2--38:133)"};
53 val_t variable0;
54 val_t variable1;
55 val_t variable2;
56 val_t variable3;
57 val_t variable4;
58 val_t variable5;
59 val_t variable6;
60 val_t variable7;
61 val_t variable8;
62 val_t variable9;
63 trace.prev = tracehead; tracehead = &trace;
64 if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_NitCompiler].i]) return;
65 ((abstracttool___AbstractCompiler___init_t)CALL( self,COLOR_abstracttool___AbstractCompiler___init))( self, init_table /*YYY*/) /*AbstractCompiler::init*/;
66 variable0 = ((mmloader___ToolContext___option_context_t)CALL( self,COLOR_mmloader___ToolContext___option_context))( self) /*NitCompiler::option_context*/;
67 variable1 = NEW_array___Array___with_capacity(TAG_Int(8)); /*new Array[Option]*/
68 variable2 = ((nitc___NitCompiler___opt_output_t)CALL( self,COLOR_nitc___NitCompiler___opt_output))( self) /*NitCompiler::opt_output*/;
69 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable2) /*Array::add*/;
70 variable3 = ((nitc___NitCompiler___opt_boost_t)CALL( self,COLOR_nitc___NitCompiler___opt_boost))( self) /*NitCompiler::opt_boost*/;
71 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable3) /*Array::add*/;
72 variable4 = ((nitc___NitCompiler___opt_no_cc_t)CALL( self,COLOR_nitc___NitCompiler___opt_no_cc))( self) /*NitCompiler::opt_no_cc*/;
73 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable4) /*Array::add*/;
74 variable5 = ((nitc___NitCompiler___opt_attr_sim_t)CALL( self,COLOR_nitc___NitCompiler___opt_attr_sim))( self) /*NitCompiler::opt_attr_sim*/;
75 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable5) /*Array::add*/;
76 variable6 = ((nitc___NitCompiler___opt_global_t)CALL( self,COLOR_nitc___NitCompiler___opt_global))( self) /*NitCompiler::opt_global*/;
77 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable6) /*Array::add*/;
78 variable7 = ((nitc___NitCompiler___opt_clibdir_t)CALL( self,COLOR_nitc___NitCompiler___opt_clibdir))( self) /*NitCompiler::opt_clibdir*/;
79 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable7) /*Array::add*/;
80 variable8 = ((nitc___NitCompiler___opt_bindir_t)CALL( self,COLOR_nitc___NitCompiler___opt_bindir))( self) /*NitCompiler::opt_bindir*/;
81 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable8) /*Array::add*/;
82 variable9 = ((nitc___NitCompiler___opt_extension_prefix_t)CALL( self,COLOR_nitc___NitCompiler___opt_extension_prefix))( self) /*NitCompiler::opt_extension_prefix*/;
83 ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable9) /*Array::add*/;
84 ((opts___OptionContext___add_option_t)CALL(variable0,COLOR_opts___OptionContext___add_option))(variable0, variable1) /*OptionContext::add_option*/;
85 init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_NitCompiler].i] = 1;
86 tracehead = trace.prev;
87 return;
88 }
89 void nitc___NitCompiler___process_options(val_t self) {
90 struct trace_t trace = {NULL, "nitc::NitCompiler::process_options (src/nitc.nit:41,2--80:10)"};
91 val_t variable0;
92 val_t variable1;
93 static val_t once_value_variable1_2; static int once_bool_variable1_2;
94 val_t variable2;
95 val_t variable3;
96 val_t variable4;
97 val_t variable5;
98 val_t variable6;
99 val_t variable7;
100 val_t variable8;
101 static val_t once_value_variable1_3; static int once_bool_variable1_3;
102 trace.prev = tracehead; tracehead = &trace;
103 ((nitc___NitCompiler___process_options_t)CALL( self,COLOR_SUPER_nitc___NitCompiler___process_options))( self) /*super NitCompiler::process_options*/;
104 variable0 = NEW_mmloader___ToolContext___init(); /*new ToolContext*/
105 ((syntax___MMContext___tc__eq_t)CALL( self,COLOR_syntax___MMContext___tc__eq))( self, variable0) /*NitCompiler::tc=*/;
106 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
107 variable1 = ((nitc___NitCompiler___opt_output_t)CALL( self,COLOR_nitc___NitCompiler___opt_output))( self) /*NitCompiler::opt_output*/;
108 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionString::value*/;
109 ((compiling_base___ToolContext___output_file__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___output_file__eq))(variable0, variable1) /*ToolContext::output_file=*/;
110 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
111 variable1 = ((nitc___NitCompiler___opt_boost_t)CALL( self,COLOR_nitc___NitCompiler___opt_boost))( self) /*NitCompiler::opt_boost*/;
112 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionBool::value*/;
113 ((compiling_base___ToolContext___boost__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___boost__eq))(variable0, variable1) /*ToolContext::boost=*/;
114 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
115 variable1 = ((nitc___NitCompiler___opt_no_cc_t)CALL( self,COLOR_nitc___NitCompiler___opt_no_cc))( self) /*NitCompiler::opt_no_cc*/;
116 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionBool::value*/;
117 ((compiling_base___ToolContext___no_cc__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___no_cc__eq))(variable0, variable1) /*ToolContext::no_cc=*/;
118 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
119 variable1 = ((nitc___NitCompiler___opt_extension_prefix_t)CALL( self,COLOR_nitc___NitCompiler___opt_extension_prefix))( self) /*NitCompiler::opt_extension_prefix*/;
120 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionString::value*/;
121 ((compiling_base___ToolContext___ext_prefix__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___ext_prefix__eq))(variable0, variable1) /*ToolContext::ext_prefix=*/;
122 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
123 variable0 = ((compiling_base___ToolContext___ext_prefix_t)CALL(variable0,COLOR_compiling_base___ToolContext___ext_prefix))(variable0) /*ToolContext::ext_prefix*/;
124 variable0 = TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*String::==*/)));
125 if (UNTAG_Bool(variable0)) { /*if*/
126 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
127 variable1 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
128 ((compiling_base___ToolContext___ext_prefix__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___ext_prefix__eq))(variable0, variable1) /*ToolContext::ext_prefix=*/;
129 }
130 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
131 variable1 = ((nitc___NitCompiler___opt_attr_sim_t)CALL( self,COLOR_nitc___NitCompiler___opt_attr_sim))( self) /*NitCompiler::opt_attr_sim*/;
132 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionBool::value*/;
133 ((compiling_base___ToolContext___attr_sim__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___attr_sim__eq))(variable0, variable1) /*ToolContext::attr_sim=*/;
134 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
135 variable1 = ((nitc___NitCompiler___opt_global_t)CALL( self,COLOR_nitc___NitCompiler___opt_global))( self) /*NitCompiler::opt_global*/;
136 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionBool::value*/;
137 ((compiling_base___ToolContext___global__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___global__eq))(variable0, variable1) /*ToolContext::global=*/;
138 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
139 variable1 = NEW_string___String___with_native(BOX_NativeString(".nit_compile"), TAG_Int(12)); /*new String*/
140 ((compiling_base___ToolContext___base_dir__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___base_dir__eq))(variable0, variable1) /*ToolContext::base_dir=*/;
141 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
142 variable1 = ((nitc___NitCompiler___opt_clibdir_t)CALL( self,COLOR_nitc___NitCompiler___opt_clibdir))( self) /*NitCompiler::opt_clibdir*/;
143 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionString::value*/;
144 ((compiling_base___ToolContext___clibdir__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___clibdir__eq))(variable0, variable1) /*ToolContext::clibdir=*/;
145 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
146 variable0 = ((compiling_base___ToolContext___clibdir_t)CALL(variable0,COLOR_compiling_base___ToolContext___clibdir))(variable0) /*ToolContext::clibdir*/;
147 variable0 = TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*String::==*/)));
148 if (UNTAG_Bool(variable0)) { /*if*/
149 if (once_bool_variable1_2) variable1 = once_value_variable1_2;
150 else {
151 variable1 = NEW_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/
152 variable1 = ((symbol___String___to_symbol_t)CALL(variable1,COLOR_symbol___String___to_symbol))(variable1) /*String::to_symbol*/;
153 variable1 = ((environ___Symbol___environ_t)CALL(variable1,COLOR_environ___Symbol___environ))(variable1) /*Symbol::environ*/;
154 once_value_variable1_2 = variable1;
155 once_bool_variable1_2 = true;
156 }
157 variable0 = variable1;
158 variable1 = ((array___AbstractArray___is_empty_t)CALL( variable0 /*dir*/,COLOR_abstract_collection___Collection___is_empty))( variable0 /*dir*/) /*String::is_empty*/;
159 if (UNTAG_Bool(variable1)) { /*if*/
160 variable2 = NEW_string___String___init(); /*new String*/
161 variable3 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
162 variable4 = variable3;
163 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable4) /*String::append*/;
164 variable5 = (G_sys);
165 variable5 = ((string___Sys___program_name_t)CALL(variable5,COLOR_string___Sys___program_name))(variable5) /*Sys::program_name*/;
166 variable5 = ((file___String___dirname_t)CALL(variable5,COLOR_file___String___dirname))(variable5) /*String::dirname*/;
167 variable6 = variable5;
168 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable6) /*String::append*/;
169 variable7 = NEW_string___String___with_native(BOX_NativeString("/../lib"), TAG_Int(7)); /*new String*/
170 variable8 = variable7;
171 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable8) /*String::append*/;
172 variable1 = variable2;
173 variable2 = ((file___String___file_exists_t)CALL( variable1 /*dir*/,COLOR_file___String___file_exists))( variable1 /*dir*/) /*String::file_exists*/;
174 if (UNTAG_Bool(variable2)) { /*if*/
175 variable2 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
176 ((compiling_base___ToolContext___clibdir__eq_t)CALL(variable2,COLOR_compiling_base___ToolContext___clibdir__eq))(variable2, variable1 /*dir*/) /*ToolContext::clibdir=*/;
177 }
178 } else { /*if*/
179 variable1 = NEW_string___String___init(); /*new String*/
180 variable2 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
181 variable3 = variable2;
182 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable3) /*String::append*/;
183 variable4 = variable0 /*dir*/;
184 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable4) /*String::append*/;
185 variable5 = NEW_string___String___with_native(BOX_NativeString("/lib"), TAG_Int(4)); /*new String*/
186 variable6 = variable5;
187 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable6) /*String::append*/;
188 variable0 = variable1 /*dir=*/;
189 variable1 = ((file___String___file_exists_t)CALL( variable0 /*dir*/,COLOR_file___String___file_exists))( variable0 /*dir*/) /*String::file_exists*/;
190 if (UNTAG_Bool(variable1)) { /*if*/
191 variable1 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
192 ((compiling_base___ToolContext___clibdir__eq_t)CALL(variable1,COLOR_compiling_base___ToolContext___clibdir__eq))(variable1, variable0 /*dir*/) /*ToolContext::clibdir=*/;
193 }
194 }
195 variable1 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
196 variable1 = ((compiling_base___ToolContext___clibdir_t)CALL(variable1,COLOR_compiling_base___ToolContext___clibdir))(variable1) /*ToolContext::clibdir*/;
197 variable1 = TAG_Bool((variable1 == NIT_NULL /*null*/) || ((variable1 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))(variable1, NIT_NULL /*null*/) /*String::==*/)));
198 if (UNTAG_Bool(variable1)) { /*if*/
199 variable1 = NEW_string___String___with_native(BOX_NativeString("Error: Cannot locate NIT C library directory. Uses --clibdir or envvar NIT_DIR."), TAG_Int(79)); /*new String*/
200 ((mmloader___ToolContext___error_t)CALL( self,COLOR_mmloader___ToolContext___error))( self, variable1) /*NitCompiler::error*/;
201 exit(UNTAG_Int( TAG_Int(1)));
202 }
203 }
204 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
205 variable1 = ((nitc___NitCompiler___opt_bindir_t)CALL( self,COLOR_nitc___NitCompiler___opt_bindir))( self) /*NitCompiler::opt_bindir*/;
206 variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*OptionString::value*/;
207 ((compiling_base___ToolContext___bindir__eq_t)CALL(variable0,COLOR_compiling_base___ToolContext___bindir__eq))(variable0, variable1) /*ToolContext::bindir=*/;
208 variable0 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
209 variable0 = ((compiling_base___ToolContext___bindir_t)CALL(variable0,COLOR_compiling_base___ToolContext___bindir))(variable0) /*ToolContext::bindir*/;
210 variable0 = TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*String::==*/)));
211 if (UNTAG_Bool(variable0)) { /*if*/
212 if (once_bool_variable1_3) variable1 = once_value_variable1_3;
213 else {
214 variable1 = NEW_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/
215 variable1 = ((symbol___String___to_symbol_t)CALL(variable1,COLOR_symbol___String___to_symbol))(variable1) /*String::to_symbol*/;
216 variable1 = ((environ___Symbol___environ_t)CALL(variable1,COLOR_environ___Symbol___environ))(variable1) /*Symbol::environ*/;
217 once_value_variable1_3 = variable1;
218 once_bool_variable1_3 = true;
219 }
220 variable0 = variable1;
221 variable1 = ((array___AbstractArray___is_empty_t)CALL( variable0 /*dir*/,COLOR_abstract_collection___Collection___is_empty))( variable0 /*dir*/) /*String::is_empty*/;
222 if (UNTAG_Bool(variable1)) { /*if*/
223 variable2 = NEW_string___String___init(); /*new String*/
224 variable3 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
225 variable4 = variable3;
226 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable4) /*String::append*/;
227 variable5 = (G_sys);
228 variable5 = ((string___Sys___program_name_t)CALL(variable5,COLOR_string___Sys___program_name))(variable5) /*Sys::program_name*/;
229 variable5 = ((file___String___dirname_t)CALL(variable5,COLOR_file___String___dirname))(variable5) /*String::dirname*/;
230 variable6 = variable5;
231 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable6) /*String::append*/;
232 variable7 = NEW_string___String___with_native(BOX_NativeString("/../bin"), TAG_Int(7)); /*new String*/
233 variable8 = variable7;
234 ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable8) /*String::append*/;
235 variable1 = variable2;
236 variable2 = ((file___String___file_exists_t)CALL( variable1 /*dir*/,COLOR_file___String___file_exists))( variable1 /*dir*/) /*String::file_exists*/;
237 if (UNTAG_Bool(variable2)) { /*if*/
238 variable2 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
239 ((compiling_base___ToolContext___bindir__eq_t)CALL(variable2,COLOR_compiling_base___ToolContext___bindir__eq))(variable2, variable1 /*dir*/) /*ToolContext::bindir=*/;
240 }
241 } else { /*if*/
242 variable1 = NEW_string___String___init(); /*new String*/
243 variable2 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
244 variable3 = variable2;
245 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable3) /*String::append*/;
246 variable4 = variable0 /*dir*/;
247 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable4) /*String::append*/;
248 variable5 = NEW_string___String___with_native(BOX_NativeString("/bin"), TAG_Int(4)); /*new String*/
249 variable6 = variable5;
250 ((string___String___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable6) /*String::append*/;
251 variable0 = variable1 /*dir=*/;
252 variable1 = ((file___String___file_exists_t)CALL( variable0 /*dir*/,COLOR_file___String___file_exists))( variable0 /*dir*/) /*String::file_exists*/;
253 if (UNTAG_Bool(variable1)) { /*if*/
254 variable1 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
255 ((compiling_base___ToolContext___bindir__eq_t)CALL(variable1,COLOR_compiling_base___ToolContext___bindir__eq))(variable1, variable0 /*dir*/) /*ToolContext::bindir=*/;
256 }
257 }
258 variable1 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
259 variable1 = ((compiling_base___ToolContext___bindir_t)CALL(variable1,COLOR_compiling_base___ToolContext___bindir))(variable1) /*ToolContext::bindir*/;
260 variable1 = TAG_Bool((variable1 == NIT_NULL /*null*/) || ((variable1 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))(variable1, NIT_NULL /*null*/) /*String::==*/)));
261 if (UNTAG_Bool(variable1)) { /*if*/
262 variable1 = NEW_string___String___with_native(BOX_NativeString("Error: Cannot locate NIT tools directory. Uses --bindir or envvar NIT_DIR."), TAG_Int(74)); /*new String*/
263 ((mmloader___ToolContext___error_t)CALL( self,COLOR_mmloader___ToolContext___error))( self, variable1) /*NitCompiler::error*/;
264 exit(UNTAG_Int( TAG_Int(1)));
265 }
266 }
267 tracehead = trace.prev;
268 return;
269 }
270 void nitc___NitCompiler___perform_work(val_t self, val_t param0) {
271 struct trace_t trace = {NULL, "nitc::NitCompiler::perform_work (src/nitc.nit:85,2--89:27)"};
272 val_t variable0;
273 val_t variable1;
274 val_t variable2;
275 val_t variable3;
276 trace.prev = tracehead; tracehead = &trace;
277 variable0 = param0;
278 variable1 = ((array___AbstractArray___iterator_t)CALL( variable0 /*mods*/,COLOR_abstract_collection___Collection___iterator))( variable0 /*mods*/) /*Array::iterator*/;
279 while (true) { /*for*/
280 variable2 = ((array___ArrayIterator___is_ok_t)CALL(variable1,COLOR_abstract_collection___Iterator___is_ok))(variable1) /*ArrayIterator::is_ok*/;
281 if (!UNTAG_Bool(variable2)) break; /*for*/
282 variable2 = ((array___ArrayIterator___item_t)CALL(variable1,COLOR_abstract_collection___Iterator___item))(variable1) /*ArrayIterator::item*/;
283 variable3 = TAG_Bool(( variable2 /*mod*/==NIT_NULL) || VAL_ISA( variable2 /*mod*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/;
284 if (!UNTAG_Bool(variable3)) { fprintf(stderr, "Assert failed: src/nitc.nit:88,4--29\n"); nit_exit(1);}
285 variable3 = ((syntax___MMContext___tc_t)CALL( self,COLOR_syntax___MMContext___tc))( self) /*NitCompiler::tc*/;
286 ((compiling___MMSrcModule___compile_prog_to_c_t)CALL( variable2 /*mod*/,COLOR_compiling___MMSrcModule___compile_prog_to_c))( variable2 /*mod*/, variable3) /*MMSrcModule::compile_prog_to_c*/;
287 continue_5: while(0);
288 ((array___ArrayIterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*ArrayIterator::next*/;
289 }
290 break_5: while(0);
291 tracehead = trace.prev;
292 return;
293 }
294 void nitc___Sys___main(val_t self) {
295 struct trace_t trace = {NULL, "nitc::Sys::main (src/nitc.nit:95,1--96:15)"};
296 val_t variable0;
297 val_t variable1;
298 trace.prev = tracehead; tracehead = &trace;
299 variable1 = NEW_nitc___NitCompiler___init(); /*new NitCompiler*/
300 variable0 = variable1;
301 ((abstracttool___AbstractCompiler___exec_cmd_line_t)CALL( variable0 /*c*/,COLOR_abstracttool___AbstractCompiler___exec_cmd_line))( variable0 /*c*/) /*NitCompiler::exec_cmd_line*/;
302 tracehead = trace.prev;
303 return;
304 }