]> matita.cs.unibo.it Git - helm.git/blob - matita/components/binaries/xoa/xoa.ml
xoa: new binary for the generation of multiple logical constants
[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 R   = Helm_registry
13
14 module L = Lib
15 module A = Ast
16 module E = Engine 
17
18 let unm_ex s =
19    Scanf.sscanf s "%u %u" A.mk_exists
20
21 let unm_or s =
22    Scanf.sscanf s "%u" A.mk_or 
23
24 let process conf =
25    let preamble = L.get_preamble conf in
26    let ooch = L.open_out preamble (R.get_string "xoa.objects") in
27    let noch = L.open_out preamble (R.get_string "xoa.notations") in
28    List.iter (L.out_include ooch) (R.get_list R.string "xoa.include");   
29    List.iter (E.generate ooch noch) (R.get_list unm_ex "xoa.ex");
30    List.iter (E.generate ooch noch) (R.get_list unm_or "xoa.or");
31    close_out noch; close_out ooch
32
33 let _ =
34    let help = "Usage: xoa [ <configuration file> ]*\n" in
35    Arg.parse [] process help