]> matita.cs.unibo.it Git - helm.git/blob - matita/components/binaries/xoa/xoa.ml
- lambdadelta: third recursive part of preservation finally proved!
[helm.git] / matita / components / binaries / xoa / xoa.ml
1 (*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic        
3     ||A||  Library of Mathematics, developed at the Computer Science     
4     ||T||  Department, University of Bologna, Italy.                     
5     ||I||                                                                
6     ||T||  HELM is free software; you can redistribute it and/or         
7     ||A||  modify it under the terms of the GNU General Public License   
8     \   /  version 2 or (at your option) any later version.      
9      \ /   This software is distributed as is, NO WARRANTY.     
10       V_______________________________________________________________ *)
11
12 module G = Arg
13
14 module R = Helm_registry
15
16 module L = Lib
17 module A = Ast
18 module E = Engine 
19
20 let unm_ex s =
21    Scanf.sscanf s "%u %u" A.mk_exists
22
23 let unm_or s =
24    Scanf.sscanf s "%u" A.mk_or 
25
26 let unm_and s =
27    Scanf.sscanf s "%u" A.mk_and 
28
29 let process conf =
30    let preamble = L.get_preamble conf in
31    if R.has "xoa.objects" && R.has "xoa.notations" then begin
32       let ooch = L.open_out preamble (R.get_string "xoa.objects") in
33       let noch = L.open_out preamble (R.get_string "xoa.notations") in
34       List.iter (L.out_include ooch) (R.get_list R.string "xoa.include");   
35       List.iter (E.generate ooch noch) (R.get_list unm_ex "xoa.ex");
36       List.iter (E.generate ooch noch) (R.get_list unm_or "xoa.or");
37       List.iter (E.generate ooch noch) (R.get_list unm_and "xoa.and");
38       close_out noch; close_out ooch
39    end
40
41 let _ =
42    let help = "Usage: xoa [ -X | <configuration file> ]*\n" in
43    let help_X  = " Clear configuration" in   
44    Arg.parse [
45       "-X" , G.Unit R.clear, help_X;
46    ] process help