compilateur-projet-prog-1/cprint.ml

21 lines
662 B
OCaml

open Cparse
let print_declarations out dec_list =
let rec print_dec_list = function
| [] -> ();
| h :: t -> print_dec h; print_dec_list t;
and print_dec = function
| CDECL(l, s) -> Printf.printf "Declare varaible %s\n" s;
| CFUN(l, s, vdl, lc) -> begin
Printf.printf "Starting function %s\n" s;
print_dec_list vdl;
end
in print_dec_list dec_list;;
let print_locator out nom fl fc ll lc =
Printf.printf "%s %d %d %d %d\n" nom fl fc ll lc
let print_ast out dec_list =
print_declarations out dec_list;
Printf.printf "Ended\n";;