]> matita.cs.unibo.it Git - helm.git/blob - helm/proofChecker/proofChecker.ml
It now exits gracefully after an End-of-file.
[helm.git] / helm / proofChecker / proofChecker.ml
1 (* Copyright (C) 2000, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://cs.unibo.it/helm/.
24  *)
25
26 let main () =
27  let usage_msg =
28   "
29 usage: proofChecker[.opt]
30 The proof-checker reads from the stdin one URI at a time and proof-checks it.
31
32 List of options:"
33  in
34   Arg.parse []
35    (fun _ -> 
36      begin
37       prerr_string "Error: no options expected.\n" ;
38       Arg.usage [] usage_msg ;
39       exit (-1)
40      end
41   ) usage_msg ;
42   try
43    while true do
44     begin
45      try
46       CicTypeChecker.typecheck (UriManager.uri_of_string (read_line ()))
47      with
48         End_of_file -> raise End_of_file
49       | e ->
50        print_newline() ;
51        flush stdout ;
52        raise e
53     end ;
54     print_endline "END"
55    done
56   with
57    End_of_file -> ()
58 ;;
59
60 CicCooking.init() ;
61 main ();;