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