* http://cs.unibo.it/helm/.
*)
-module AH = AutHelpers
+module AO = AutOutput
+module MA = MetaAut
+module MO = MetaOutput
let main =
let version_string = "Helena Checker 0.8.0 M (June 2008)" in
let summary = ref 0 in
+ let stage = ref 1 in
let set_summary i = summary := i in
let print_version () = print_endline version_string; exit 0 in
+ let set_stage i = stage := i in
let read_file name =
if !summary > 0 then
Printf.printf "Processing file: %s\n" name; flush stdout;
let book = AutParser.book AutLexer.token lexbuf in
close_in ich;
if !summary > 1 then
- AH.count (AH.print_counters Cps.id) AH.initial_counters book
+ AO.count (AO.print_counters Cps.id) AO.initial_counters book;
+ let f env =
+ if !summary > 1 then
+ MO.count (MO.print_counters Cps.id) MO.initial_counters env;
+ let frm = Format.err_formatter in
+ Format.pp_set_margin frm max_int;
+ MO.pp_environment Cps.id frm (List.rev env)
+ in
+ if !stage > 0 then MA.meta_of_aut f book
in
- let help = "Usage: helena [ -V | -S <number> ] <file> ..." in
- let help_S = "<number> Set summary level" in
+ let help = "Usage: helena [ -V | -Ss <number> ] <file> ..." in
+ let help_S = "<number> Set summary level" in
let help_V = " Show version information" in
+ let help_s = "<number> Set translation stage" in
Arg.parse [
("-S", Arg.Int set_summary, help_S);
- ("-V", Arg.Unit print_version, help_V)
+ ("-V", Arg.Unit print_version, help_V);
+ ("-s", Arg.Int set_stage, help_s);
] read_file help