]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/camlp4/Camlp4Filters/Camlp4AstLifter.ml
update
[l4.git] / l4 / pkg / ocaml / contrib / camlp4 / Camlp4Filters / Camlp4AstLifter.ml
1 (* camlp4r *)
2 (****************************************************************************)
3 (*                                                                          *)
4 (*                              Objective Caml                              *)
5 (*                                                                          *)
6 (*                            INRIA Rocquencourt                            *)
7 (*                                                                          *)
8 (*  Copyright   2006    Institut National de Recherche en Informatique et   *)
9 (*  en Automatique.  All rights reserved.  This file is distributed under   *)
10 (*  the terms of the GNU Library General Public License, with the special   *)
11 (*  exception on linking described in LICENSE at the top of the Objective   *)
12 (*  Caml source tree.                                                       *)
13 (*                                                                          *)
14 (****************************************************************************)
15
16 (* Authors:
17  * - Nicolas Pouillard: initial version
18  *)
19
20
21 open Camlp4;
22
23 module Id = struct
24   value name    = "Camlp4AstLifter";
25   value version = Sys.ocaml_version;
26 end;
27
28 module Make (AstFilters : Camlp4.Sig.AstFilters) = struct
29   open AstFilters;
30
31   module MetaLoc = struct
32     module Ast = Ast;
33     value meta_loc_patt _loc _ = <:patt< loc >>;
34     value meta_loc_expr _loc _ = <:expr< loc >>;
35   end;
36   module MetaAst = Ast.Meta.Make MetaLoc;
37
38   register_str_item_filter (fun ast ->
39     let _loc = Ast.loc_of_str_item ast in
40     <:str_item< let loc = Loc.ghost in $exp:MetaAst.Expr.meta_str_item _loc ast$ >>);
41
42 end;
43
44 let module M = Camlp4.Register.AstFilter Id Make in ();