method execution (fileName : string) (outText : Widget.text Widget.widget) : unit = (
let out_name_if = get_output_if fileName in
let out_name_atse = (temp_dir^(Filename.basename fileName)^".atse") in
let error_if_file = (out_name_if^".error") in
let error_atse_file = (out_name_atse^".error") in
if(Sys.file_exists out_name_if) then ignore(Sys.remove out_name_if);
if(Sys.file_exists out_name_atse) then ignore(Sys.remove out_name_atse);
if(Sys.file_exists error_if_file) then ignore(Sys.remove error_if_file);
if(Sys.file_exists error_atse_file) then ignore(Sys.remove error_atse_file);
let select = match (Listbox.curselection lst)
with [(`Num num)] -> num
| _ -> -1 in
let algo = match select
with 0 -> " -td "
| 1 -> " -lr "
| _ -> "" in
ignore(Sys.command(hlpsl2if^" --stdout "^esc^fileName^esc^" >"^esc^out_name_if^esc^" 2>"^esc^error_if_file^esc));
ignore(Sys.command(atse^" "^esc^out_name_if^esc^" "^simplifyString^untypedString^verboseString^algo^" > "^esc^out_name_atse^esc^" 2>"^esc^error_atse_file^esc));
Text.delete outText ~start:(`Linechar(0, 0),[`Linestart]) ~stop:(`End,[]);
if(Sys.file_exists out_name_atse) then (
let txt = readFile out_name_atse in
if(Sys.file_exists error_if_file)
then (let (_,line_number)= (readFile_and_give_line_number error_if_file) in
if(line_number > 2)
then (Text.insert ~index:(`End,[]) ~text:(("\n----- Output error of if translator :\n\n")^(readFile error_if_file)) outText;
if(Sys.file_exists error_atse_file)
then Text.insert ~index:(`End,[]) ~text:(("\n\n\n----- Output error of ATSE :\n\n")^(readFile error_atse_file)) outText;
if(Sys.file_exists out_name_atse)
then Text.insert ~index:(`End,[]) ~text:(("\n\n")^txt) outText;
)
else (if(Sys.file_exists out_name_atse)
then Text.insert ~index:(`End,[]) ~text:txt outText;)
)
else (if(Sys.file_exists out_name_atse)
then Text.insert ~index:(`End,[]) ~text:txt outText;)
);
if(Sys.file_exists out_name_if) then ignore(Sys.remove out_name_if);
if(Sys.file_exists out_name_atse) then ignore(Sys.remove out_name_atse);
if(Sys.file_exists error_if_file) then ignore(Sys.remove error_if_file);
if(Sys.file_exists error_atse_file) then ignore(Sys.remove error_atse_file);
)