3 let read_substs substs ich =
5 let words = String.split_on_char ' ' subst in
6 List.filter ((<>) "") words
9 let line = input_line ich in
10 let subst = String.split_on_char ',' line in
11 substs := List.map map subst :: !substs
15 let ich = open_in file in
16 let line = input_line ich in
17 let scan r f d p o = r, f, d, p, o in
18 let rmod, rfun, dmod, para, optn =
19 Scanf.sscanf line "%s %s %S %b %b" scan
21 let substs = ref [] in
23 try read_substs substs ich with
24 | End_of_file -> close_in ich
27 ET.cmod = Filename.remove_extension file;
28 rmod; rfun; dmod; para; optn;
32 let list_rev_filter_map filter map l =
33 let rec aux r = function
35 | hd :: tl -> if filter hd then aux (map hd :: r) tl else aux r tl
41 Filename.extension name = ".mrc"
44 Filename.remove_extension name
46 let dir = Array.to_list (Sys.readdir file) in
47 let mods = List.fast_sort Pervasives.compare (list_rev_filter_map filter map dir) in
52 let rec read_mods mods ich =
53 let line = input_line ich in
57 Scanf.sscanf line "module %s = RecommGc%s" scan;
61 let file = Filename.concat dir "recommGc.ml" in
63 if Sys.file_exists file then begin
64 let ich = open_in file in
65 try read_mods mods ich with
66 | End_of_file -> close_in ich
68 let mods = List.fast_sort Pervasives.compare !mods in