2024-04-09 11:30:52 +02:00
|
|
|
open Affichage
|
2024-04-16 10:07:09 +02:00
|
|
|
open Typing
|
2024-04-09 11:09:33 +02:00
|
|
|
|
|
|
|
let interpret e =
|
|
|
|
begin
|
2024-04-09 11:30:52 +02:00
|
|
|
print_expr e;
|
2024-04-09 11:09:33 +02:00
|
|
|
print_newline();
|
2024-04-16 10:07:09 +02:00
|
|
|
print_ty (typeinfer [] e);
|
2024-04-09 11:09:33 +02:00
|
|
|
print_newline()
|
|
|
|
end
|
|
|
|
|
|
|
|
let lexbuf = Lexing.from_channel stdin
|
|
|
|
|
|
|
|
let parse () = Parser.main Lexer.token lexbuf
|
|
|
|
|
|
|
|
let calc () =
|
|
|
|
let result = parse () in
|
|
|
|
interpret result; flush stdout
|
|
|
|
|
|
|
|
let _ = calc()
|