astprinter.ml 777 Bytes
Newer Older
1
Printexc.record_backtrace true;;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

let verbose = ref false
let typed = ref false
let lambda = ref false
let value = ref false
let program = ref ""

let main () = 
  let speclist = [
    ("-v", Arg.Set verbose, "Enables verbose mode (print all itermediate ASTs)");
    ("--lambda", Arg.Set lambda, "Print Lambda AST");
    ("--value", Arg.Set value, "Print Value AST");
  ]
  in 
  let usage_msg = "Print various cduce ASTs fragments (default typed)" in
  Arg.parse speclist (fun s -> program := s) usage_msg;
  let verbose = !verbose in
  if not(!lambda || !value) then ignore(Testlib.parse_cduce ~verbose:true !program);
  if !lambda then ignore (Testlib.parse_cduce_lexpr ~verbose !program);
  if !value then ignore (Testlib.parse_cduce_vexpr ~verbose !program)
;;

main ();;