pieuvre/affichage.ml

15 lines
394 B
OCaml

open Expr
(* fonction d'affichage *)
let rec string_of_expr = function
Fun ((s, t), e) -> "fun ("^s^":"^t^") => "^(string_of_expr e)
| App (e1, e2) -> "("^(string_of_expr e1)^") "^(string_of_expr e2)
| Var (s) -> s
| Exf (e, s) -> "exf("^(string_of_expr e)^":"^s^")"
let print_expr e =
print_string (string_of_expr e)
let affiche_val v = print_string "TODO"