You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
923 B

module Compiler = Complice.Comp.Make (struct
include Dddddml
type ast = Dddddml.Lang.t
let expected_ext = Some "dddddml"
end)
let _ =
let print s = Format.printf "%s@." s in
let open Dddddml in
print "lexing and parsing..." ;
let ast = Compiler.compile () in
(* let print_ast = Pp.fprintf_file Format.std_formatter in *)
(* print_ast ast; *)
print "analysing scope..." ;
let renamed_ast, _old_names = Scope_analysis.file ast in
(* Hashtbl.iter (fun k v -> Format.printf "variable %s was %s@." k v) _old_names; *)
(* print_ast renamed_ast; *)
print "infering types..." ;
let infered, t = Type_inference.file renamed_ast in
(* Hashtbl.iter (fun k v ->
Format.printf "%s has type %a@." k Pp.fprintf_type v
) infered; *)
print "type checking..." ;
Type_check.file renamed_ast infered ;
print "OK !" ;
Format.printf "%a : %a@." Pp.fprintf_expr ast Pp.fprintf_type t ;
()