4 let read_substs substs ich =
6 let line = input_line ich in
7 let subst = RL.split_on_char ',' line in
8 substs := List.map (RL.split_on_char ' ') subst :: !substs
12 let ich = open_in file in
13 let line = input_line ich in
14 let scan r f d p o = r, f, d, p, o in
15 let rmod, rfun, dmod, para, optn =
16 Scanf.sscanf line "%s %s %S %b %b" scan
18 let substs = ref [] in
20 try read_substs substs ich with
21 | End_of_file -> close_in ich
24 ET.cmod = Filename.remove_extension file;
25 rmod; rfun; dmod; para; optn;
29 let list_rev_filter_map filter map l =
30 let rec aux r = function
32 | hd :: tl -> if filter hd then aux (map hd :: r) tl else aux r tl
38 Filename.extension name = ".mrc"
41 Filename.remove_extension name
43 let dir = Array.to_list (Sys.readdir file) in
44 let mods = List.fast_sort Pervasives.compare (list_rev_filter_map filter map dir) in
49 let rec read_mods mods ich =
50 let line = input_line ich in
54 Scanf.sscanf line "module %s = RecommGc%s" scan;
58 let file = Filename.concat dir "recommGc.ml" in
60 if Sys.file_exists file then begin
61 let ich = open_in file in
62 try read_mods mods ich with
63 | End_of_file -> close_in ich
65 let mods = List.fast_sort Pervasives.compare !mods in