]> matita.cs.unibo.it Git - helm.git/blob - helm/interface/annotationParser.ml
3c645fe5dc0147014b34ae09019a1d022668b727
[helm.git] / helm / interface / annotationParser.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 annotate filename ids_to_targets =
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
24     in
25      AnnotationParser2.annotate ids_to_targets d#root
26   with
27    e ->
28      print_endline (Pxp_types.string_of_exn e) ;
29      raise e
30 ;;