]> matita.cs.unibo.it Git - helm.git/blob - helm/interface/theoryParser.ml
Initial revision
[helm.git] / helm / interface / theoryParser.ml
1 exception Warnings;;
2
3 class warner =
4   object 
5     method warn w =
6       print_endline ("WARNING: " ^ w) ;
7       (raise Warnings : unit)
8   end
9 ;;
10
11 exception EmptyUri;;
12
13 let theory_of_xml filename =
14  let module Y = Pxp_yacc in
15   try 
16     let d =
17      let config = {Y.default_config with Y.warner = new warner} in
18       Y.parse_document_entity config
19 (*PXP       (Y.ExtID (Pxp_types.System filename,
20          new Pxp_reader.resolve_as_file ~url_of_id ()))
21 *)     (PxpUriResolver.from_file filename)
22        Y.default_spec
23     in
24      TheoryParser2.get_theory d#root
25   with
26    e ->
27      print_endline (Pxp_types.string_of_exn e) ;
28      raise e
29 ;;