12 lines
369 B
OCaml
12 lines
369 B
OCaml
open E0
|
|
|
|
let () =
|
|
let p = Lexing.from_channel stdin |> Parse.try_parse in
|
|
match p with
|
|
| Error msg -> Printf.eprintf "Could not load program: %s" msg
|
|
| Ok p ->
|
|
let decl_map = Typeck.get_decl_map p in
|
|
Hashtbl.iter
|
|
(fun name ty -> Printf.eprintf " %s : %s\n" name (Ast.show_ty ty))
|
|
decl_map;
|
|
Ast.show_program p |> print_endline
|