pieuvre/main.ml
2024-04-09 11:09:33 +02:00

20 lines
306 B
OCaml

open Expr
let interpret e =
begin
affiche_expr e;
print_newline();
print_int (eval e);
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()