pieuvre/main.ml

21 lines
323 B
OCaml
Raw Normal View History

2024-04-09 11:09:33 +02:00
open Expr
2024-04-09 11:30:52 +02:00
open Affichage
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-09 11:30:52 +02:00
(*print_int (eval 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()