20 lines
306 B
OCaml
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()
|