1 /* This C file is generated by NIT to compile module opts. */
3 val_t
opts___Option___names(val_t self
) {
4 struct trace_t trace
= {NULL
, "opts::Option::names (bin/../lib/opts.nit:16,2--17:35)"};
5 trace
.prev
= tracehead
; tracehead
= &trace
;
6 tracehead
= trace
.prev
;
7 return ATTR_opts___Option____names( self
) /*Option::_names*/;
9 val_t
opts___Option___helptext(val_t self
) {
10 struct trace_t trace
= {NULL
, "opts::Option::helptext (bin/../lib/opts.nit:22,2--23:32)"};
11 trace
.prev
= tracehead
; tracehead
= &trace
;
12 tracehead
= trace
.prev
;
13 return ATTR_opts___Option____helptext( self
) /*Option::_helptext*/;
15 val_t
opts___Option___mandatory(val_t self
) {
16 struct trace_t trace
= {NULL
, "opts::Option::mandatory (bin/../lib/opts.nit:25,2--26:40)"};
17 trace
.prev
= tracehead
; tracehead
= &trace
;
18 tracehead
= trace
.prev
;
19 return ATTR_opts___Option____mandatory( self
) /*Option::_mandatory*/;
21 void opts___Option___mandatory__eq(val_t self
, val_t param0
) {
22 struct trace_t trace
= {NULL
, "opts::Option::mandatory= (bin/../lib/opts.nit:25,2--26:40)"};
23 trace
.prev
= tracehead
; tracehead
= &trace
;
24 ATTR_opts___Option____mandatory( self
) /*Option::_mandatory*/ = param0
;
25 tracehead
= trace
.prev
;
28 val_t
opts___Option___context(val_t self
) {
29 struct trace_t trace
= {NULL
, "opts::Option::context (bin/../lib/opts.nit:28,2--29:47)"};
30 trace
.prev
= tracehead
; tracehead
= &trace
;
31 tracehead
= trace
.prev
;
32 return ATTR_opts___Option____context( self
) /*Option::_context*/;
34 void opts___Option___context__eq(val_t self
, val_t param0
) {
35 struct trace_t trace
= {NULL
, "opts::Option::context= (bin/../lib/opts.nit:28,2--29:47)"};
36 trace
.prev
= tracehead
; tracehead
= &trace
;
37 ATTR_opts___Option____context( self
) /*Option::_context*/ = param0
;
38 tracehead
= trace
.prev
;
41 val_t
opts___Option___value(val_t self
) {
42 struct trace_t trace
= {NULL
, "opts::Option::value (bin/../lib/opts.nit:31,2--32:37)"};
43 trace
.prev
= tracehead
; tracehead
= &trace
;
44 tracehead
= trace
.prev
;
45 return ATTR_opts___Option____value( self
) /*Option::_value*/;
47 void opts___Option___value__eq(val_t self
, val_t param0
) {
48 struct trace_t trace
= {NULL
, "opts::Option::value= (bin/../lib/opts.nit:31,2--32:37)"};
49 trace
.prev
= tracehead
; tracehead
= &trace
;
50 ATTR_opts___Option____value( self
) /*Option::_value*/ = param0
;
51 tracehead
= trace
.prev
;
54 val_t
opts___Option___default_value(val_t self
) {
55 struct trace_t trace
= {NULL
, "opts::Option::default_value (bin/../lib/opts.nit:34,2--35:45)"};
56 trace
.prev
= tracehead
; tracehead
= &trace
;
57 tracehead
= trace
.prev
;
58 return ATTR_opts___Option____default_value( self
) /*Option::_default_value*/;
60 void opts___Option___default_value__eq(val_t self
, val_t param0
) {
61 struct trace_t trace
= {NULL
, "opts::Option::default_value= (bin/../lib/opts.nit:34,2--35:45)"};
62 trace
.prev
= tracehead
; tracehead
= &trace
;
63 ATTR_opts___Option____default_value( self
) /*Option::_default_value*/ = param0
;
64 tracehead
= trace
.prev
;
67 void opts___Option___init_opt(val_t self
, val_t param0
, val_t param1
, val_t param2
, int* init_table
) {
68 struct trace_t trace
= {NULL
, "opts::Option::init_opt (bin/../lib/opts.nit:37,2--47:26)"};
73 trace
.prev
= tracehead
; tracehead
= &trace
;
77 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_Option
].i
]) return;
78 variable3
= TAG_Bool(( variable2
/*names*/ == NIT_NULL
/*null*/) || (( variable2
/*names*/ != NIT_NULL
) && UNTAG_Bool(((array___AbstractArray_____eqeq_t
)CALL( variable2
/*names*/,COLOR_kernel___Object_____eqeq
))( variable2
/*names*/, NIT_NULL
/*null*/) /*Array::==*/)));
79 if (UNTAG_Bool(variable3
)) { /*if*/
80 variable3
= NEW_array___Array___init(); /*new Array[String]*/
81 ATTR_opts___Option____names( self
) /*Option::_names*/ = variable3
;
83 variable3
= ((array___Collection___to_a_t
)CALL( variable2
/*names*/,COLOR_array___Collection___to_a
))( variable2
/*names*/) /*Array::to_a*/;
84 ATTR_opts___Option____names( self
) /*Option::_names*/ = variable3
;
86 ATTR_opts___Option____helptext( self
) /*Option::_helptext*/ = variable0
/*help*/;
87 ATTR_opts___Option____mandatory( self
) /*Option::_mandatory*/ = TAG_Bool(false);
88 ATTR_opts___Option____default_value( self
) /*Option::_default_value*/ = variable1
/*default*/;
89 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_Option
].i
] = 1;
90 tracehead
= trace
.prev
;
93 void opts___Option___add_aliases(val_t self
, val_t param0
) {
94 struct trace_t trace
= {NULL
, "opts::Option::add_aliases (bin/../lib/opts.nit:50,2--51:59)"};
97 trace
.prev
= tracehead
; tracehead
= &trace
;
98 /* check if p<Array[String] with p:String */
99 if (( param0
!=NIT_NULL
) && !VAL_ISA( param0
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled at bin/../lib/opts.nit:51,19--34\n"); nit_exit(1); } /*cast Array[String]*/;
101 variable1
= ATTR_opts___Option____names( self
) /*Option::_names*/;
102 ((abstract_collection___SimpleCollection___add_all_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add_all
))(variable1
, variable0
/*names*/) /*Array::add_all*/;
103 tracehead
= trace
.prev
;
106 val_t
opts___Option___to_s(val_t self
) {
107 struct trace_t trace
= {NULL
, "opts::Option::to_s (bin/../lib/opts.nit:53,2--54:35)"};
109 trace
.prev
= tracehead
; tracehead
= &trace
;
110 variable0
= ((opts___Option___pretty_t
)CALL( self
,COLOR_opts___Option___pretty
))( self
, TAG_Int(2)) /*Option::pretty*/;
112 return_label2
: while(false);
113 tracehead
= trace
.prev
;
116 val_t
opts___Option___pretty(val_t self
, val_t param0
) {
117 struct trace_t trace
= {NULL
, "opts::Option::pretty (bin/../lib/opts.nit:56,2--66:13)"};
122 trace
.prev
= tracehead
; tracehead
= &trace
;
124 variable2
= NEW_string___String___with_native(BOX_NativeString(" "), TAG_Int(2)); /*new String*/
125 variable1
= variable2
;
126 variable2
= ATTR_opts___Option____names( self
) /*Option::_names*/;
127 variable3
= NEW_string___String___with_native(BOX_NativeString(", "), TAG_Int(2)); /*new String*/
128 variable2
= ((string___Collection___join_t
)CALL(variable2
,COLOR_string___Collection___join
))(variable2
, variable3
) /*Array::join*/;
129 ((string___String___append_t
)CALL( variable1
/*text*/,COLOR_abstract_collection___IndexedCollection___append
))( variable1
/*text*/, variable2
) /*String::append*/;
130 variable2
= NEW_string___String___with_native(BOX_NativeString(" "), TAG_Int(2)); /*new String*/
131 ((string___String___append_t
)CALL( variable1
/*text*/,COLOR_abstract_collection___IndexedCollection___append
))( variable1
/*text*/, variable2
) /*String::append*/;
132 variable3
= ((array___AbstractArray___length_t
)CALL( variable1
/*text*/,COLOR_abstract_collection___Collection___length
))( variable1
/*text*/) /*String::length*/;
133 variable3
= TAG_Int(UNTAG_Int( variable0
/*off*/)-UNTAG_Int(variable3
));
134 variable2
= variable3
;
135 variable3
= TAG_Bool(UNTAG_Int( variable2
/*rest*/)>UNTAG_Int( TAG_Int(0)));
136 if (UNTAG_Bool(variable3
)) { /*if*/
137 variable3
= NEW_string___String___with_native(BOX_NativeString(" "), TAG_Int(1)); /*new String*/
138 variable3
= ((string___String_____star_t
)CALL(variable3
,COLOR_string___String_____star
))(variable3
, variable2
/*rest*/) /*String::**/;
139 ((string___String___append_t
)CALL( variable1
/*text*/,COLOR_abstract_collection___IndexedCollection___append
))( variable1
/*text*/, variable3
) /*String::append*/;
141 variable3
= ((opts___Option___helptext_t
)CALL( self
,COLOR_opts___Option___helptext
))( self
) /*Option::helptext*/;
142 ((string___String___append_t
)CALL( variable1
/*text*/,COLOR_abstract_collection___IndexedCollection___append
))( variable1
/*text*/, variable3
) /*String::append*/;
143 variable1
= variable1
/*text*/;
145 return_label3
: while(false);
146 tracehead
= trace
.prev
;
149 val_t
opts___Option___pretty_default(val_t self
) {
150 struct trace_t trace
= {NULL
, "opts::Option::pretty_default (bin/../lib/opts.nit:69,2--74:11)"};
158 trace
.prev
= tracehead
; tracehead
= &trace
;
159 variable0
= ((opts___Option___default_value_t
)CALL( self
,COLOR_opts___Option___default_value
))( self
) /*Option::default_value*/;
160 variable0
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable0
== NIT_NULL
/*null*/) || ((variable0
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable0
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable0
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable0
,COLOR_kernel___Object_____eqeq
))(variable0
, NIT_NULL
/*null*/) /*Object::==*/)))))));
161 if (UNTAG_Bool(variable0
)) { /*if*/
162 variable0
= NEW_string___String___init(); /*new String*/
163 variable1
= NEW_string___String___with_native(BOX_NativeString(" ("), TAG_Int(2)); /*new String*/
164 variable2
= variable1
;
165 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable2
) /*String::append*/;
166 variable3
= ((opts___Option___default_value_t
)CALL( self
,COLOR_opts___Option___default_value
))( self
) /*Option::default_value*/;
167 variable4
= variable3
;
168 variable4
= ((string___String___to_s_t
)CALL(variable4
,COLOR_string___Object___to_s
))(variable4
) /*String::to_s*/;
169 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable4
) /*String::append*/;
170 variable5
= NEW_string___String___with_native(BOX_NativeString(")"), TAG_Int(1)); /*new String*/
171 variable6
= variable5
;
172 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable6
) /*String::append*/;
175 variable0
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
177 return_label4
: while(false);
178 tracehead
= trace
.prev
;
181 void opts___Option___read_param(val_t self
, val_t param0
) {
182 struct trace_t trace
= {NULL
, "opts::Option::read_param (bin/../lib/opts.nit:77,2--78:46)"};
183 trace
.prev
= tracehead
; tracehead
= &trace
;
184 fprintf(stderr
, "Deferred method read_param called (bin/../lib/opts.nit:77,2)\n");
186 tracehead
= trace
.prev
;
189 void opts___OptionText___init(val_t self
, val_t param0
, int* init_table
) {
190 struct trace_t trace
= {NULL
, "opts::OptionText::init (bin/../lib/opts.nit:83,2--48)"};
192 trace
.prev
= tracehead
; tracehead
= &trace
;
194 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionText
].i
]) return;
195 ((opts___Option___init_opt_t
)CALL( self
,COLOR_opts___Option___init_opt
))( self
, variable0
/*text*/, NIT_NULL
/*null*/, NIT_NULL
/*null*/, init_table
/*YYY*/) /*OptionText::init_opt*/;
196 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionText
].i
] = 1;
197 tracehead
= trace
.prev
;
200 val_t
opts___OptionText___pretty(val_t self
, val_t param0
) {
201 struct trace_t trace
= {NULL
, "opts::OptionText::pretty (bin/../lib/opts.nit:85,2--38)"};
204 trace
.prev
= tracehead
; tracehead
= &trace
;
206 variable1
= ((opts___OptionText___to_s_t
)CALL( self
,COLOR_string___Object___to_s
))( self
) /*OptionText::to_s*/;
208 return_label6
: while(false);
209 tracehead
= trace
.prev
;
212 val_t
opts___OptionText___to_s(val_t self
) {
213 struct trace_t trace
= {NULL
, "opts::OptionText::to_s (bin/../lib/opts.nit:87,2--35)"};
215 trace
.prev
= tracehead
; tracehead
= &trace
;
216 variable0
= ((opts___Option___helptext_t
)CALL( self
,COLOR_opts___Option___helptext
))( self
) /*OptionText::helptext*/;
218 return_label7
: while(false);
219 tracehead
= trace
.prev
;
222 void opts___OptionBool___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
223 struct trace_t trace
= {NULL
, "opts::OptionBool::init (bin/../lib/opts.nit:94,2--68)"};
226 trace
.prev
= tracehead
; tracehead
= &trace
;
228 /* check if p<Array[String] with p:String */
229 if (( param1
!=NIT_NULL
) && !VAL_ISA( param1
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled at bin/../lib/opts.nit:94,21--36\n"); nit_exit(1); } /*cast Array[String]*/;
231 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionBool
].i
]) return;
232 ((opts___Option___init_opt_t
)CALL( self
,COLOR_opts___Option___init_opt
))( self
, variable0
/*help*/, TAG_Bool(false), variable1
/*names*/, init_table
/*YYY*/) /*OptionBool::init_opt*/;
233 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionBool
].i
] = 1;
234 tracehead
= trace
.prev
;
237 void opts___OptionBool___read_param(val_t self
, val_t param0
) {
238 struct trace_t trace
= {NULL
, "opts::OptionBool::read_param (bin/../lib/opts.nit:96,2--42)"};
240 trace
.prev
= tracehead
; tracehead
= &trace
;
242 ((opts___Option___value__eq_t
)CALL( self
,COLOR_opts___Option___value__eq
))( self
, TAG_Bool(true)) /*OptionBool::value=*/;
243 tracehead
= trace
.prev
;
246 val_t
opts___OptionParameter___convert(val_t self
, val_t param0
) {
247 struct trace_t trace
= {NULL
, "opts::OptionParameter::convert (bin/../lib/opts.nit:102,2--43)"};
248 trace
.prev
= tracehead
; tracehead
= &trace
;
249 fprintf(stderr
, "Deferred method convert called (bin/../lib/opts.nit:102,2)\n");
251 tracehead
= trace
.prev
;
254 void opts___OptionParameter___read_param(val_t self
, val_t param0
) {
255 struct trace_t trace
= {NULL
, "opts::OptionParameter::read_param (bin/../lib/opts.nit:104,2--109:10)"};
258 trace
.prev
= tracehead
; tracehead
= &trace
;
260 variable1
= ((opts___Option___context_t
)CALL( self
,COLOR_opts___Option___context
))( self
) /*OptionParameter::context*/;
261 variable1
= TAG_Bool(!UNTAG_Bool(TAG_Bool((variable1
== NIT_NULL
/*null*/) || ((variable1
!= NIT_NULL
) && ((((kernel___Object_____eqeq_t
)CALL(variable1
,COLOR_kernel___Object_____eqeq
))==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable1
, NIT_NULL
/*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t
)CALL(variable1
,COLOR_kernel___Object_____eqeq
))(variable1
, NIT_NULL
/*null*/) /*OptionContext::==*/)))))));
262 if (!UNTAG_Bool(variable1
)) { fprintf(stderr
, "Assert failed: bin/../lib/opts.nit:106,3--24\n"); nit_exit(1);}
263 variable1
= ((abstract_collection___Iterator___is_ok_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___is_ok
))( variable0
/*it*/) /*Iterator::is_ok*/;
264 if (UNTAG_Bool(variable1
)) { /*if*/
265 variable1
= ((abstract_collection___Iterator___item_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___item
))( variable0
/*it*/) /*Iterator::item*/;
266 variable1
= ((opts___OptionParameter___convert_t
)CALL( self
,COLOR_opts___OptionParameter___convert
))( self
, variable1
) /*OptionParameter::convert*/;
267 ((opts___Option___value__eq_t
)CALL( self
,COLOR_opts___Option___value__eq
))( self
, variable1
) /*OptionParameter::value=*/;
268 ((abstract_collection___Iterator___next_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___next
))( variable0
/*it*/) /*Iterator::next*/;
270 tracehead
= trace
.prev
;
273 void opts___OptionParameter___init_opt(val_t self
, val_t param0
, val_t param1
, val_t param2
, int* init_table
) {
274 struct trace_t trace
= {NULL
, "opts::OptionParameter::init_opt (bin/../lib/opts.nit:115,2--32)"};
278 trace
.prev
= tracehead
; tracehead
= &trace
;
282 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionParameter
].i
]) return;
283 ((opts___Option___init_opt_t
)CALL( self
,COLOR_opts___Option___init_opt
))( self
, param0
, param1
, param2
, init_table
/*YYY*/) /*Option::init_opt*/;
284 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionParameter
].i
] = 1;
285 tracehead
= trace
.prev
;
288 void opts___OptionString___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
289 struct trace_t trace
= {NULL
, "opts::OptionString::init (bin/../lib/opts.nit:122,2--67)"};
292 trace
.prev
= tracehead
; tracehead
= &trace
;
294 /* check if p<Array[String] with p:String */
295 if (( param1
!=NIT_NULL
) && !VAL_ISA( param1
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled at bin/../lib/opts.nit:122,21--36\n"); nit_exit(1); } /*cast Array[String]*/;
297 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionString
].i
]) return;
298 ((opts___OptionParameter___init_opt_t
)CALL( self
,COLOR_opts___OptionParameter___init_opt
))( self
, variable0
/*help*/, NIT_NULL
/*null*/, variable1
/*names*/, init_table
/*YYY*/) /*OptionString::init_opt*/;
299 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionString
].i
] = 1;
300 tracehead
= trace
.prev
;
303 val_t
opts___OptionString___convert(val_t self
, val_t param0
) {
304 struct trace_t trace
= {NULL
, "opts::OptionString::convert (bin/../lib/opts.nit:124,2--38)"};
307 trace
.prev
= tracehead
; tracehead
= &trace
;
309 variable1
= variable0
/*str*/;
311 return_label13
: while(false);
312 tracehead
= trace
.prev
;
315 void opts___OptionEnum___init(val_t self
, val_t param0
, val_t param1
, val_t param2
, val_t param3
, int* init_table
) {
316 struct trace_t trace
= {NULL
, "opts::OptionEnum::init (bin/../lib/opts.nit:132,2--136:55)"};
331 trace
.prev
= tracehead
; tracehead
= &trace
;
335 /* check if p<Array[String] with p:String */
336 if (( param3
!=NIT_NULL
) && !VAL_ISA( param3
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled at bin/../lib/opts.nit:132,56--71\n"); nit_exit(1); } /*cast Array[String]*/;
338 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionEnum
].i
]) return;
339 variable4
= TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable0
/*enum*/ == NIT_NULL
/*null*/) || (( variable0
/*enum*/ != NIT_NULL
) && UNTAG_Bool(((array___AbstractArray_____eqeq_t
)CALL( variable0
/*enum*/,COLOR_kernel___Object_____eqeq
))( variable0
/*enum*/, NIT_NULL
/*null*/) /*Array::==*/)))));
340 variable5
= variable4
;
341 if (UNTAG_Bool(variable5
)) { /* and */
342 variable5
= ((array___AbstractArray___length_t
)CALL( variable0
/*enum*/,COLOR_abstract_collection___Collection___length
))( variable0
/*enum*/) /*Array::length*/;
343 variable5
= TAG_Bool(UNTAG_Int(variable5
)>UNTAG_Int( TAG_Int(0)));
345 variable4
= variable5
;
346 if (!UNTAG_Bool(variable4
)) { fprintf(stderr
, "Assert failed: bin/../lib/opts.nit:134,3--41\n"); nit_exit(1);}
347 variable4
= ((array___Collection___to_a_t
)CALL( variable0
/*enum*/,COLOR_array___Collection___to_a
))( variable0
/*enum*/) /*Array::to_a*/;
348 ATTR_opts___OptionEnum____enum( self
) /*OptionEnum::_enum*/ = variable4
;
349 variable4
= NEW_string___String___init(); /*new String*/
350 variable5
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
351 variable6
= variable5
;
352 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable6
) /*String::append*/;
353 variable7
= variable1
/*help*/;
354 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable7
) /*String::append*/;
355 variable8
= NEW_string___String___with_native(BOX_NativeString(" <"), TAG_Int(2)); /*new String*/
356 variable9
= variable8
;
357 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable9
) /*String::append*/;
358 variable10
= NEW_string___String___with_native(BOX_NativeString(", "), TAG_Int(2)); /*new String*/
359 variable10
= ((string___Collection___join_t
)CALL( variable0
/*enum*/,COLOR_string___Collection___join
))( variable0
/*enum*/, variable10
) /*Array::join*/;
360 variable11
= variable10
;
361 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable11
) /*String::append*/;
362 variable12
= NEW_string___String___with_native(BOX_NativeString(">"), TAG_Int(1)); /*new String*/
363 variable13
= variable12
;
364 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable13
) /*String::append*/;
365 ((opts___OptionParameter___init_opt_t
)CALL( self
,COLOR_opts___OptionParameter___init_opt
))( self
, variable4
, variable2
/*default*/, variable3
/*names*/, init_table
/*YYY*/) /*OptionEnum::init_opt*/;
366 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionEnum
].i
] = 1;
367 tracehead
= trace
.prev
;
370 val_t
opts___OptionEnum___convert(val_t self
, val_t param0
) {
371 struct trace_t trace
= {NULL
, "opts::OptionEnum::convert (bin/../lib/opts.nit:139,2--142:11)"};
375 trace
.prev
= tracehead
; tracehead
= &trace
;
377 variable2
= ATTR_opts___OptionEnum____enum( self
) /*OptionEnum::_enum*/;
378 variable2
= ((array___AbstractArray___index_of_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___index_of
))(variable2
, variable0
/*str*/) /*Array::index_of*/;
379 variable1
= variable2
;
380 variable1
= variable1
/*id*/;
382 return_label15
: while(false);
383 tracehead
= trace
.prev
;
386 val_t
opts___OptionEnum___pretty_default(val_t self
) {
387 struct trace_t trace
= {NULL
, "opts::OptionEnum::pretty_default (bin/../lib/opts.nit:145,2--150:12)"};
396 trace
.prev
= tracehead
; tracehead
= &trace
;
397 variable0
= ((opts___Option___default_value_t
)CALL( self
,COLOR_opts___Option___default_value
))( self
) /*OptionEnum::default_value*/;
398 variable0
= TAG_Bool((variable0
)!=( NIT_NULL
/*null*/));
399 if (UNTAG_Bool(variable0
)) { /*if*/
400 variable0
= NEW_string___String___init(); /*new String*/
401 variable1
= NEW_string___String___with_native(BOX_NativeString(" ("), TAG_Int(2)); /*new String*/
402 variable2
= variable1
;
403 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable2
) /*String::append*/;
404 variable3
= ATTR_opts___OptionEnum____enum( self
) /*OptionEnum::_enum*/;
405 variable4
= ((opts___Option___default_value_t
)CALL( self
,COLOR_opts___Option___default_value
))( self
) /*OptionEnum::default_value*/;
406 variable5
= variable4
;
407 variable6
= TAG_Bool(UNTAG_Int( variable5
/*index*/)>=UNTAG_Int( TAG_Int(0)));
408 variable7
= variable6
;
409 if (UNTAG_Bool(variable7
)) { /* and */
410 variable7
= variable3
;
411 variable7
= ATTR_array___AbstractArray____length(variable7
) /*Array::_length*/;
412 variable7
= TAG_Bool(UNTAG_Int( variable5
/*index*/)<UNTAG_Int(variable7
));
414 variable6
= variable7
;
415 if (!UNTAG_Bool(variable6
)) { fprintf(stderr
, "Assert 'index' failed: bin/../lib/standard//array.nit:229,3--46\n"); nit_exit(1);}
416 variable6
= variable3
;
417 variable6
= ATTR_array___Array____items(variable6
) /*Array::_items*/;
418 variable6
= UNBOX_NativeArray(variable6
)[UNTAG_Int( variable5
/*index*/)];
420 return_label17
: while(false);
421 variable3
= variable6
;
422 variable4
= variable3
;
423 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable4
) /*String::append*/;
424 variable5
= NEW_string___String___with_native(BOX_NativeString(")"), TAG_Int(1)); /*new String*/
425 variable6
= variable5
;
426 ((string___String___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable6
) /*String::append*/;
429 variable0
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
432 return_label16
: while(false);
433 tracehead
= trace
.prev
;
436 void opts___OptionInt___init(val_t self
, val_t param0
, val_t param1
, val_t param2
, int* init_table
) {
437 struct trace_t trace
= {NULL
, "opts::OptionInt::init (bin/../lib/opts.nit:159,2--84)"};
441 trace
.prev
= tracehead
; tracehead
= &trace
;
444 /* check if p<Array[String] with p:String */
445 if (( param2
!=NIT_NULL
) && !VAL_ISA( param2
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled at bin/../lib/opts.nit:159,35--50\n"); nit_exit(1); } /*cast Array[String]*/;
447 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionInt
].i
]) return;
448 ((opts___OptionParameter___init_opt_t
)CALL( self
,COLOR_opts___OptionParameter___init_opt
))( self
, variable0
/*help*/, variable1
/*default*/, variable2
/*names*/, init_table
/*YYY*/) /*OptionInt::init_opt*/;
449 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionInt
].i
] = 1;
450 tracehead
= trace
.prev
;
453 val_t
opts___OptionInt___convert(val_t self
, val_t param0
) {
454 struct trace_t trace
= {NULL
, "opts::OptionInt::convert (bin/../lib/opts.nit:161,2--43)"};
457 trace
.prev
= tracehead
; tracehead
= &trace
;
459 variable1
= ((string___String___to_i_t
)CALL( variable0
/*str*/,COLOR_string___String___to_i
))( variable0
/*str*/) /*String::to_i*/;
461 return_label19
: while(false);
462 tracehead
= trace
.prev
;
465 void opts___OptionArray___init(val_t self
, val_t param0
, val_t param1
, int* init_table
) {
466 struct trace_t trace
= {NULL
, "opts::OptionArray::init (bin/../lib/opts.nit:168,2--171:31)"};
470 trace
.prev
= tracehead
; tracehead
= &trace
;
472 /* check if p<Array[String] with p:String */
473 if (( param1
!=NIT_NULL
) && !VAL_ISA( param1
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled at bin/../lib/opts.nit:168,21--36\n"); nit_exit(1); } /*cast Array[String]*/;
475 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionArray
].i
]) return;
476 variable2
= NEW_array___Array___init(); /*new Array[String]*/
477 ATTR_opts___OptionArray____values( self
) /*OptionArray::_values*/ = variable2
;
478 variable2
= ATTR_opts___OptionArray____values( self
) /*OptionArray::_values*/;
479 ((opts___OptionParameter___init_opt_t
)CALL( self
,COLOR_opts___OptionParameter___init_opt
))( self
, variable0
/*help*/, variable2
, variable1
/*names*/, init_table
/*YYY*/) /*OptionArray::init_opt*/;
480 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionArray
].i
] = 1;
481 tracehead
= trace
.prev
;
484 val_t
opts___OptionArray___convert(val_t self
, val_t param0
) {
485 struct trace_t trace
= {NULL
, "opts::OptionArray::convert (bin/../lib/opts.nit:175,2--178:16)"};
488 trace
.prev
= tracehead
; tracehead
= &trace
;
490 variable1
= ATTR_opts___OptionArray____values( self
) /*OptionArray::_values*/;
491 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable0
/*str*/) /*Array::add*/;
492 variable1
= ATTR_opts___OptionArray____values( self
) /*OptionArray::_values*/;
494 return_label21
: while(false);
495 tracehead
= trace
.prev
;
498 val_t
opts___OptionContext___options(val_t self
) {
499 struct trace_t trace
= {NULL
, "opts::OptionContext::options (bin/../lib/opts.nit:183,2--37)"};
500 trace
.prev
= tracehead
; tracehead
= &trace
;
501 tracehead
= trace
.prev
;
502 return ATTR_opts___OptionContext____options( self
) /*OptionContext::_options*/;
504 val_t
opts___OptionContext___rest(val_t self
) {
505 struct trace_t trace
= {NULL
, "opts::OptionContext::rest (bin/../lib/opts.nit:184,2--34)"};
506 trace
.prev
= tracehead
; tracehead
= &trace
;
507 tracehead
= trace
.prev
;
508 return ATTR_opts___OptionContext____rest( self
) /*OptionContext::_rest*/;
510 void opts___OptionContext___usage(val_t self
) {
511 struct trace_t trace
= {NULL
, "opts::OptionContext::usage (bin/../lib/opts.nit:188,2--200:22)"};
519 trace
.prev
= tracehead
; tracehead
= &trace
;
520 variable0
= TAG_Int(1);
521 variable1
= ATTR_opts___OptionContext____options( self
) /*OptionContext::_options*/;
522 variable1
= ((array___AbstractArray___iterator_t
)CALL(variable1
,COLOR_abstract_collection___Collection___iterator
))(variable1
) /*Array::iterator*/;
523 while (true) { /*for*/
524 variable2
= ((array___ArrayIterator___is_ok_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___is_ok
))(variable1
) /*ArrayIterator::is_ok*/;
525 if (!UNTAG_Bool(variable2
)) break; /*for*/
526 variable2
= ((array___ArrayIterator___item_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___item
))(variable1
) /*ArrayIterator::item*/;
527 variable3
= TAG_Int(3);
528 variable4
= ((opts___Option___names_t
)CALL( variable2
/*i*/,COLOR_opts___Option___names
))( variable2
/*i*/) /*Option::names*/;
529 variable4
= ((array___AbstractArray___iterator_t
)CALL(variable4
,COLOR_abstract_collection___Collection___iterator
))(variable4
) /*Array::iterator*/;
530 while (true) { /*for*/
531 variable5
= ((array___ArrayIterator___is_ok_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___is_ok
))(variable4
) /*ArrayIterator::is_ok*/;
532 if (!UNTAG_Bool(variable5
)) break; /*for*/
533 variable5
= ((array___ArrayIterator___item_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___item
))(variable4
) /*ArrayIterator::item*/;
534 variable6
= ((array___AbstractArray___length_t
)CALL( variable5
/*n*/,COLOR_abstract_collection___Collection___length
))( variable5
/*n*/) /*String::length*/;
535 variable6
= TAG_Int(UNTAG_Int(variable6
)+UNTAG_Int( TAG_Int(2)));
536 variable3
= TAG_Int(UNTAG_Int(variable3
)+UNTAG_Int(variable6
)) /*l*/;
537 continue_24
: while(0);
538 ((array___ArrayIterator___next_t
)CALL(variable4
,COLOR_abstract_collection___Iterator___next
))(variable4
) /*ArrayIterator::next*/;
541 variable4
= TAG_Bool(UNTAG_Int( variable0
/*lmax*/)<UNTAG_Int( variable3
/*l*/));
542 if (UNTAG_Bool(variable4
)) { /*if*/
543 variable0
= variable3
/*l*/ /*lmax=*/;
545 continue_23
: while(0);
546 ((array___ArrayIterator___next_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___next
))(variable1
) /*ArrayIterator::next*/;
549 variable1
= ATTR_opts___OptionContext____options( self
) /*OptionContext::_options*/;
550 variable1
= ((array___AbstractArray___iterator_t
)CALL(variable1
,COLOR_abstract_collection___Collection___iterator
))(variable1
) /*Array::iterator*/;
551 while (true) { /*for*/
552 variable2
= ((array___ArrayIterator___is_ok_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___is_ok
))(variable1
) /*ArrayIterator::is_ok*/;
553 if (!UNTAG_Bool(variable2
)) break; /*for*/
554 variable2
= ((array___ArrayIterator___item_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___item
))(variable1
) /*ArrayIterator::item*/;
555 variable3
= ((opts___Option___pretty_t
)CALL( variable2
/*i*/,COLOR_opts___Option___pretty
))( variable2
/*i*/, variable0
/*lmax*/) /*Option::pretty*/;
556 ((file___Object___print_t
)CALL( self
,COLOR_file___Object___print
))( self
, variable3
) /*OptionContext::print*/;
557 continue_25
: while(0);
558 ((array___ArrayIterator___next_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___next
))(variable1
) /*ArrayIterator::next*/;
561 tracehead
= trace
.prev
;
564 void opts___OptionContext___parse(val_t self
, val_t param0
) {
565 struct trace_t trace
= {NULL
, "opts::OptionContext::parse (bin/../lib/opts.nit:204,2--208:17)"};
569 trace
.prev
= tracehead
; tracehead
= &trace
;
571 variable2
= ((abstract_collection___Collection___iterator_t
)CALL( variable0
/*argv*/,COLOR_abstract_collection___Collection___iterator
))( variable0
/*argv*/) /*Collection::iterator*/;
572 variable1
= variable2
;
573 ((opts___OptionContext___parse_intern_t
)CALL( self
,COLOR_opts___OptionContext___parse_intern
))( self
, variable1
/*it*/) /*OptionContext::parse_intern*/;
574 tracehead
= trace
.prev
;
577 void opts___OptionContext___parse_intern(val_t self
, val_t param0
) {
578 struct trace_t trace
= {NULL
, "opts::OptionContext::parse_intern (bin/../lib/opts.nit:211,2--230:12)"};
585 trace
.prev
= tracehead
; tracehead
= &trace
;
587 variable1
= TAG_Bool(true);
588 ((opts___OptionContext___build_t
)CALL( self
,COLOR_opts___OptionContext___build
))( self
) /*OptionContext::build*/;
589 variable3
= ATTR_opts___OptionContext____rest( self
) /*OptionContext::_rest*/;
590 variable2
= variable3
;
591 while (true) { /*while*/
592 variable3
= variable1
/*parseargs*/;
593 if (UNTAG_Bool(variable3
)) { /* and */
594 variable3
= ((abstract_collection___Iterator___is_ok_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___is_ok
))( variable0
/*it*/) /*Iterator::is_ok*/;
596 if (!UNTAG_Bool(variable3
)) break; /* while*/
597 variable4
= ((abstract_collection___Iterator___item_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___item
))( variable0
/*it*/) /*Iterator::item*/;
598 variable3
= variable4
;
599 variable4
= NEW_string___String___with_native(BOX_NativeString("--"), TAG_Int(2)); /*new String*/
600 variable4
= TAG_Bool(( variable3
/*str*/ == variable4
) || (( variable3
/*str*/ != NIT_NULL
) && UNTAG_Bool(((string___String_____eqeq_t
)CALL( variable3
/*str*/,COLOR_kernel___Object_____eqeq
))( variable3
/*str*/, variable4
) /*String::==*/)));
601 if (UNTAG_Bool(variable4
)) { /*if*/
602 ((abstract_collection___Iterator___next_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___next
))( variable0
/*it*/) /*Iterator::next*/;
603 variable4
= ((array___Iterator___to_a_t
)CALL( variable0
/*it*/,COLOR_array___Iterator___to_a
))( variable0
/*it*/) /*Iterator::to_a*/;
604 ((abstract_collection___SimpleCollection___add_all_t
)CALL( variable2
/*rest*/,COLOR_abstract_collection___SimpleCollection___add_all
))( variable2
/*rest*/, variable4
) /*Array::add_all*/;
605 variable1
= TAG_Bool(false) /*parseargs=*/;
607 variable4
= ATTR_opts___OptionContext____optmap( self
) /*OptionContext::_optmap*/;
608 variable4
= ((abstract_collection___Map___has_key_t
)CALL(variable4
,COLOR_abstract_collection___Map___has_key
))(variable4
, variable3
/*str*/) /*Map::has_key*/;
609 if (UNTAG_Bool(variable4
)) { /*if*/
610 variable5
= ATTR_opts___OptionContext____optmap( self
) /*OptionContext::_optmap*/;
611 variable5
= ((abstract_collection___Map_____bra_t
)CALL(variable5
,COLOR_abstract_collection___Map_____bra
))(variable5
, variable3
/*str*/) /*Map::[]*/;
612 variable4
= variable5
;
613 ((abstract_collection___Iterator___next_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___next
))( variable0
/*it*/) /*Iterator::next*/;
614 ((opts___Option___read_param_t
)CALL( variable4
/*opt*/,COLOR_opts___Option___read_param
))( variable4
/*opt*/, variable0
/*it*/) /*Option::read_param*/;
616 variable4
= ((abstract_collection___Iterator___item_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___item
))( variable0
/*it*/) /*Iterator::item*/;
617 ((array___AbstractArray___add_t
)CALL( variable2
/*rest*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*rest*/, variable4
) /*Array::add*/;
618 ((abstract_collection___Iterator___next_t
)CALL( variable0
/*it*/,COLOR_abstract_collection___Iterator___next
))( variable0
/*it*/) /*Iterator::next*/;
621 continue_28
: while(0);
624 tracehead
= trace
.prev
;
627 void opts___OptionContext___add_option(val_t self
, val_t param0
) {
628 struct trace_t trace
= {NULL
, "opts::OptionContext::add_option (bin/../lib/opts.nit:236,2--240:19)"};
633 trace
.prev
= tracehead
; tracehead
= &trace
;
634 /* check if p<Array[Option] with p:Option */
635 if (( param0
!=NIT_NULL
) && !VAL_ISA( param0
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled at bin/../lib/opts.nit:236,18--32\n"); nit_exit(1); } /*cast Array[Option]*/;
637 variable1
= ((array___AbstractArray___iterator_t
)CALL( variable0
/*opts*/,COLOR_abstract_collection___Collection___iterator
))( variable0
/*opts*/) /*Array::iterator*/;
638 while (true) { /*for*/
639 variable2
= ((array___ArrayIterator___is_ok_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___is_ok
))(variable1
) /*ArrayIterator::is_ok*/;
640 if (!UNTAG_Bool(variable2
)) break; /*for*/
641 variable2
= ((array___ArrayIterator___item_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___item
))(variable1
) /*ArrayIterator::item*/;
642 ((opts___Option___context__eq_t
)CALL( variable2
/*opt*/,COLOR_opts___Option___context__eq
))( variable2
/*opt*/, self
) /*Option::context=*/;
643 variable3
= ATTR_opts___OptionContext____options( self
) /*OptionContext::_options*/;
644 ((array___AbstractArray___add_t
)CALL(variable3
,COLOR_abstract_collection___SimpleCollection___add
))(variable3
, variable2
/*opt*/) /*Array::add*/;
645 continue_30
: while(0);
646 ((array___ArrayIterator___next_t
)CALL(variable1
,COLOR_abstract_collection___Iterator___next
))(variable1
) /*ArrayIterator::next*/;
649 tracehead
= trace
.prev
;
652 void opts___OptionContext___init(val_t self
, int* init_table
) {
653 struct trace_t trace
= {NULL
, "opts::OptionContext::init (bin/../lib/opts.nit:244,2--248:26)"};
655 trace
.prev
= tracehead
; tracehead
= &trace
;
656 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionContext
].i
]) return;
657 variable0
= NEW_array___Array___init(); /*new Array[Option]*/
658 ATTR_opts___OptionContext____options( self
) /*OptionContext::_options*/ = variable0
;
659 variable0
= NEW_hash___HashMap___init(); /*new HashMap[String, Option]*/
660 ATTR_opts___OptionContext____optmap( self
) /*OptionContext::_optmap*/ = variable0
;
661 variable0
= NEW_array___Array___init(); /*new Array[String]*/
662 ATTR_opts___OptionContext____rest( self
) /*OptionContext::_rest*/ = variable0
;
663 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_OptionContext
].i
] = 1;
664 tracehead
= trace
.prev
;
667 void opts___OptionContext___build(val_t self
) {
668 struct trace_t trace
= {NULL
, "opts::OptionContext::build (bin/../lib/opts.nit:251,2--255:18)"};
674 trace
.prev
= tracehead
; tracehead
= &trace
;
675 variable0
= ATTR_opts___OptionContext____options( self
) /*OptionContext::_options*/;
676 variable0
= ((array___AbstractArray___iterator_t
)CALL(variable0
,COLOR_abstract_collection___Collection___iterator
))(variable0
) /*Array::iterator*/;
677 while (true) { /*for*/
678 variable1
= ((array___ArrayIterator___is_ok_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___is_ok
))(variable0
) /*ArrayIterator::is_ok*/;
679 if (!UNTAG_Bool(variable1
)) break; /*for*/
680 variable1
= ((array___ArrayIterator___item_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___item
))(variable0
) /*ArrayIterator::item*/;
681 variable2
= ((opts___Option___names_t
)CALL( variable1
/*o*/,COLOR_opts___Option___names
))( variable1
/*o*/) /*Option::names*/;
682 variable2
= ((array___AbstractArray___iterator_t
)CALL(variable2
,COLOR_abstract_collection___Collection___iterator
))(variable2
) /*Array::iterator*/;
683 while (true) { /*for*/
684 variable3
= ((array___ArrayIterator___is_ok_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___is_ok
))(variable2
) /*ArrayIterator::is_ok*/;
685 if (!UNTAG_Bool(variable3
)) break; /*for*/
686 variable3
= ((array___ArrayIterator___item_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___item
))(variable2
) /*ArrayIterator::item*/;
687 variable4
= ATTR_opts___OptionContext____optmap( self
) /*OptionContext::_optmap*/;
688 ((abstract_collection___Map_____braeq_t
)CALL(variable4
,COLOR_abstract_collection___Map_____braeq
))(variable4
, variable3
/*n*/, variable1
/*o*/) /*Map::[]=*/;
689 continue_34
: while(0);
690 ((array___ArrayIterator___next_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___next
))(variable2
) /*ArrayIterator::next*/;
693 continue_33
: while(0);
694 ((array___ArrayIterator___next_t
)CALL(variable0
,COLOR_abstract_collection___Iterator___next
))(variable0
) /*ArrayIterator::next*/;
697 tracehead
= trace
.prev
;