method write ?(with_help=true) filename =
let out_channel = open_out filename in
let formatter = Format.formatter_of_out_channel out_channel in
let print = Format.fprintf formatter in
print "@[<v>";
let rec save_queue formatter =
queue_iter_between
(fun (name,nametree) -> save_nametree name nametree)
(Format.pp_print_cut formatter)
and save_nametree name = function
| Immediate cp ->
if with_help && cp#get_help <> "" then
(print "@[<hov3>(* "; cp#get_help_formatted formatter;
print "@ *)@]@,");
Format.fprintf formatter "@[<hov2>%s =@ @[<b2>" (safe_string name);
cp#get_formatted formatter;
print "@]@]"
| Subsection queue ->
Format.fprintf formatter "%s = {@;<0 2>@[<v>" (safe_string name);
save_queue formatter queue;
print "@]@,}" in
save_queue formatter cps;
print "@]@."; close_out out_channel