| hd :: tl -> if hd = dname then tl else hd :: purge dname tl
let add fname =
+ if fname = "" then () else
if Hashtbl.mem graph fname then () else
Hashtbl.add graph fname {ddeps = []; rdeps = None}
let add_ddep fname dname =
+ if dname = "" then () else
let file = Hashtbl.find graph fname in
Hashtbl.replace graph fname {file with ddeps = dname :: file.ddeps}
StringSet.iter iter fnames
let rec read ich =
- let _ = Scanf.sscanf (input_line ich) "%s@:include \"%s@\"." init in
+ let line = input_line ich in
+ begin try Scanf.sscanf line "%s@:include \"%s@\"." init
+ with Scanf.Scan_failure _ ->
+ begin try Scanf.sscanf line "./%s@:include \"%s@\"." init
+ with Scanf.Scan_failure _ ->
+ begin try Scanf.sscanf line "%s@:(*%s@*)" (fun _ _ -> ())
+ with Scanf.Scan_failure _ ->
+ Printf.eprintf "unknown line: %s.\n" line
+ end
+ end
+ end;
read ich
let _ =
if !show_top then top ();
if !show_leaf then leaf ()
in
- let help = "" in
+ let help = "matitadep [-clt | -d <int> ] < <file>" in
let help_c = " Print the redundant and looping arcs of the dependences graph" in
let help_d = "<flags> Set these debug options" in
let help_l = " Print the leaf nodes of the dependences graph" in