2022-03-08 06:16:27 +00:00
|
|
|
open E0
|
|
|
|
|
|
|
|
let () =
|
2022-03-08 09:20:19 +00:00
|
|
|
let p = Lexing.from_channel stdin |> Parse.try_parse in
|
2022-03-08 08:52:20 +00:00
|
|
|
match p with
|
|
|
|
| Error msg -> Printf.eprintf "Could not load program: %s" msg
|
2022-03-23 06:12:37 +00:00
|
|
|
| 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
|