pieuvre/affichage.ml

22 lines
425 B
OCaml
Raw Normal View History

2024-04-09 11:09:33 +02:00
open Expr
(* fonction d'affichage *)
let rec affiche_expr e =
let aff_aux s a b =
begin
print_string s;
affiche_expr a;
print_string ", ";
affiche_expr b;
print_string ")"
end
in
match e with
| Const k -> print_int k
| Add(e1,e2) -> aff_aux "Add(" e1 e2
| Mul(e1,e2) -> aff_aux "Mul(" e1 e2
| Min(e1,e2) -> aff_aux "Min(" e1 e2
let affiche_val v = print_string "TODO"