forked from flurischt/interproc-trunk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterproc.ml
45 lines (38 loc) · 1.19 KB
/
interproc.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(** Master module *)
(* This file is part of the Interproc analyzer, released under GPL license.
Please read the COPYING file packaged in the distribution.
Copyright (C) Mathias Argoud, Gaël Lalire, Bertrand Jeannet 2007.
*)
open Format
open Option
let main () =
(* Parsing the command line *)
Arg.parse
Option.speclist
(begin fun name -> Option.inputfilename := name end)
"interproc <options> <inputfile>"
;
(* Parsing the program *)
let input = open_in !Option.inputfilename in
let lexbuf = Lexing.from_channel input in
lexbuf.Lexing.lex_curr_p <- { lexbuf.Lexing.lex_curr_p with
Lexing.pos_fname = "file "^(!Option.inputfilename);
};
let prog = Frontend.parse_lexbuf Format.err_formatter lexbuf in
close_in input;
if !debug>0 then
printf "%sProgram with its control points:%s@.%a@."
(!Option.displaytags).precolorB (!Option.displaytags).postcolor
(PSpl_syn.print_program
(begin fun fmt point ->
fprintf fmt "%s%a%s"
(!Option.displaytags).precolorR
PSpl_syn.print_point point
(!Option.displaytags).postcolor
end))
prog
;
(* Computing solution *)
Frontend.analyze_and_display Format.std_formatter prog;
()
let _ = main()