camlspotter avatar camlspotter committed 36e2470

name change

Comments (0)

Files changed (5)

 autoapioo.ml: autoapi.ml pa/pa_opycaml.cmo
     camlp4o ./pa/pa_opycaml.cmo -impl autoapi.ml -printer Camlp4OCamlPrinter > $@
 
-autoapioo2.ml: api.auto.mli oowrap/pa_opycaml.cmo
-    camlp4o ./oowrap/pa_opycaml.cmo api.auto.mli -printer Camlp4OCamlPrinter > $@
+autoapioo2.ml: api.auto.mli oowrap/oowrap.cmo
+    camlp4o ./oowrap/oowrap.cmo api.auto.mli -printer Camlp4OCamlPrinter > $@
 
 auto_stubs.o: auto_stubs.c auto.h api_ml.h autoclasses.h
 
 OCAMLPACKAGEFLAGS= 
 
 FILES[] =
-	pa_opycaml
+	oowrap
 
-LIB = pa_opycaml
+LIB = oowrap
 
 .DEFAULT: $(OCamlLibrary $(LIB), $(FILES))
 
 
 OCAMLDEPFLAGS=-pp camlp4of
 OCAMLPPFLAGS=-pp camlp4of
-
-# top_test: pa_bind_inline.cma
-# 	ocaml -I +camlp4 dynlink.cma camlp4o.cma pa_bind_inline.cma 
-# 
-# .PHONY: test
-# 
-# test: pa_bind_inline.cma
-# 	camlp4o -printer OCaml -I . pa_bind_inline.cma test_pa_bind_inline.ml  
-
-# It is local use
-
-# install: pa_bind_inline.cma pa_bind_inline.cmxa
-# 	ocamlfind remove bind_inline
-# 	ocamlfind install bind_inline META pa*.cmo pa*.cmx pa*.cmi pa*.cma pa*.cmxa
+module Id = struct
+  let name = "pa_oowrap"
+  let version = "1.0"
+end
+
+open Camlp4
+open PreCast
+
+(* See P4 filter tutorial at
+   http://ambassadortothecomputers.blogspot.com/2010/03/reading-camlp4-part-5-filters.html
+   http://brion.inria.fr/gallium/index.php/Camlp4MapGenerator
+*)
+
+module Make (AstFilters : Sig.AstFilters) = struct
+  open AstFilters
+  open Ast
+
+  (* Actually the AST is the same type, but the fact is not known to the type system.... *)
+  let print_str_item (sitem : str_item) = Register.CurrentPrinter.print_implem (Obj.magic sitem)
+
+  let _loc = Loc.ghost
+
+  let rec iter_sig_item ~f = function
+    | SgNil _ -> ()
+    | SgSem (_, sig_item1, sig_item2) -> iter_sig_item ~f sig_item1; iter_sig_item ~f sig_item2
+    | sig_item -> f <:sig_item< $sig_item$ >>
+
+  let rec fold_sig_item ~f ~init = function
+    | SgNil _ -> init
+    | SgSem (_, sig_item1, sig_item2) -> 
+        let st = fold_sig_item ~f ~init sig_item1 in
+        fold_sig_item ~f ~init:st sig_item2
+    | sig_item -> f init <:sig_item< $sig_item$ >>
+
+  let rec scan_tyors = function
+    | <:ctyp< $t1$ | $t2$ >> -> scan_tyors t1 @ scan_tyors t2
+    | <:ctyp< `$v$ >> -> [v]
+    | _ -> []
+
+  let class_type = 
+    let extract k varpath typath =
+      let normalize_path = function
+        | <:ident< Type.$lid:name$ >>
+        | <:ident< $lid:name$ >> -> Some name
+        | _ -> None
+      in
+      match normalize_path varpath, normalize_path typath with
+      | Some varpath, Some "t" -> Some (k, varpath)
+      | _ -> None
+    in
+    function
+    | <:ctyp< [> $id:varpath$ ] $id:typath$ >> -> extract `Bigger varpath typath
+    | <:ctyp< $id:varpath$ $id:typath$ >> -> extract `Equal varpath typath
+    | _ -> None
+
+  let _ = 
+    assert (class_type <:ctyp< [> _Object ] t >> = Some (`Bigger, "_Object"));
+    assert (class_type <:ctyp< _Object Type.t >> = Some (`Equal, "_Object"))
+    assert (class_type <:ctyp< Type._Object Type.t >> = Some (`Equal, "_Object"))
+  ;;
+
+  (* Obtain class dependencies encoded as poly-variant type definitions in the top sig *)
+  let get_class_dep_graph sig_item = 
+    let ancestors = 
+      let tbl = Hashtbl.create 107 in
+      iter_sig_item sig_item ~f:(function
+        | <:sig_item< type $lid:name$ = [ $tyors$ ] >> ->
+              prerr_endline ("found class dependency " ^ name);
+              let variants = scan_tyors tyors in
+              (* remove self to create ancestors *)
+              let ancestors = List.filter (fun x -> x <> name) variants in
+              Hashtbl.add tbl name ancestors
+        | _ -> ());
+      tbl
+    in
+    let is_ancestor_of a k = List.mem a (try Hashtbl.find ancestors k with Not_found -> assert false) in
+
+    (* create direct parent relationship from [ancestors] *)
+    let tbl = Hashtbl.create 107 in
+    Hashtbl.iter (fun k ancs ->
+      (* direct parents are ancestors which are not ancestors of other ancestors *)
+      let parents = List.filter (fun anc ->
+        List.for_all (fun anc' -> not (is_ancestor_of anc anc')) ancs)
+        ancs
+      in
+      Format.eprintf "class dependency %s : %s@." k (String.concat " " parents);
+      Hashtbl.add tbl k parents
+    ) ancestors;
+    tbl
+
+  let rec extract_vals sig_item = 
+    let vals = ref [] in
+    let rec visit rev_path sig_item = 
+      iter_sig_item sig_item ~f:(function
+        | <:sig_item< external $name$ : $typ$ = $_$ >> -> 
+            Format.eprintf "%s : val %s (external)@." (String.concat "." (List.rev rev_path)) name;
+            vals := (rev_path, name, typ) :: !vals 
+        | <:sig_item< val $name$ : $typ$ >> -> 
+            Format.eprintf "%s : val %s@." (String.concat "." (List.rev rev_path)) name;
+            vals := (rev_path, name, typ) :: !vals 
+        | <:sig_item< module $name$ : $ MtSig(_, sig_item) $ >> ->
+            visit (name :: rev_path) sig_item
+        | _ -> ())
+    in
+    visit [] sig_item;
+    
+    let modules = Hashtbl.create 107 in
+    let hashtbl_add_in_list tbl k v =
+      let vs = try Hashtbl.find tbl k with Not_found -> [] in
+      Hashtbl.replace tbl k (v::vs)
+    in
+    List.iter (fun (rev_path, name, typ) -> 
+      hashtbl_add_in_list modules rev_path (name, typ)) !vals;
+    modules
+
+  module A = struct (* Dirty part *)
+
+    let class_name s = "o" ^ s
+
+    let mk_id pos = Printf.sprintf "v%d" pos
+
+    let mk_tyvar pos = TyQuo(_loc, Printf.sprintf "a%d" pos) (* No ' required! *)
+
+    (* [> _Cls ] t -> ...   =>    _Cls -> ... *)
+    let wrap_in pos v ty =
+      match ty with
+      | <:ctyp< [ > Type.$lid:clsname$ ] Type.t >> -> 
+          let tv = mk_tyvar pos in
+          (* Strange, but < $ctyp$ : $ctyp$; ..> *)
+          let oty = TyAli(_loc, <:ctyp< < $lid:clsname$ : $lid:clsname$ t ; .. > >>, tv) in
+          <:expr< $v$ # $clsname$ >>,
+          Some tv,
+          oty
+
+      | <:ctyp< [ > Type.$lid:clsname$ ] Type.t option >> -> 
+          let tv = mk_tyvar pos in
+          (* Strange, but < $ctyp$ : $ctyp$; ..> *)
+          let oty = TyAli(_loc, <:ctyp< < $lid:clsname$ : $lid:clsname$ t ; .. > >>, tv) in
+          <:expr< option_bind $v$ (fun x -> x# $clsname$) >>,
+          Some tv,
+          <:ctyp< $oty$ option >>
+            
+      | _ -> v, None, ty
+    ;;
+
+    (* ... -> _Cls t   =>   ... -> _Cls *)
+    let wrap_out ty =
+      match ty with
+      | <:ctyp@tyloc< Type.$lid:clsname$ Type.t >> ->
+          (fun e -> <:expr< new $lid: class_name clsname$ $e$ >>), 
+          <:ctyp@tyloc< $lid: class_name clsname$ >>
+      | <:ctyp@tyloc< Type.$lid:clsname$ Type.t option >> ->
+          (fun e -> <:expr< option_bind $e$ (new $lid: class_name clsname$) >>), 
+          <:ctyp@tyloc< $lid: class_name clsname$ option >>
+      | _ -> (fun e -> e), ty
+    ;;
+
+    let wrap_oo base ty =
+
+      let rec args pos = function
+        | <:ctyp< $argty$ -> $ty$ >> ->
+
+            let qvars, mty, absts, args, mk_return = args (pos+1) ty in
+            
+            let v = <:expr<$lid:mk_id pos$>> in
+            let pat = mk_id pos in
+            let e, qv_opt, oty = wrap_in pos v argty in
+
+            let absts = pat :: absts in
+            let args = e :: args in
+
+            let qvars = 
+              match qv_opt with 
+              | None -> qvars
+              | Some qv -> qv :: qvars
+            in
+
+            let mty = <:ctyp< $oty$ -> $mty$ >> in
+
+            qvars, mty, absts, args, mk_return
+
+        | mty ->
+            let mk_return, mty = wrap_out mty in
+            [], mty, [], [], mk_return
+      in
+      let qvars, mty, absts, args, mk_return = args 0 ty in (* X *)
+      let q mty = function
+        | [] -> mty
+        | qvs ->
+            let rec qapp = function
+              | [] -> assert false
+              | [qv] -> qv
+              | qv::qvs -> TyApp(_loc, qv, qapp qvs) (* strange but it is as an app *)
+            in
+            TyPol (_loc, qapp qvs, mty)
+      in
+      let rec mk_app b = function
+        | [] -> b
+        | e::es -> mk_app <:expr< $b$ $e$ >> es
+      in
+      let rec mk_abst b = function
+        | [] -> b
+        | v::vs -> <:expr< fun $lid:v$ -> $mk_abst b vs$ >>
+      in
+      q mty qvars, mk_abst (mk_return (mk_app base args)) absts
+
+  end
+  (*  open A *)
+
+  let build class_dep_graph modules =
+    Hashtbl.fold (fun revpath name_typ_list (clses, st) ->
+      match List.rev revpath with
+      | [ "Py"; modname ] ->
+          let tyname = "_" ^ modname in
+          let clsname = "o" ^ tyname in
+          let sitems, methods = 
+            List.fold_left (fun (st, methods) (name, typ) -> 
+              match typ with
+              | <:ctyp<  $arg$ -> $typ'$  >> ->
+                  begin match class_type arg with
+                  | Some (`Bigger, tyname') when tyname' = tyname -> 
+                      let polytype, exp = A.wrap_oo <:expr< $lid:name$ t >> typ' in
+                      st, <:class_str_item< method $name$ : $polytype$ = $exp$ >> :: methods
+                  | _ -> 
+                      let polytype, exp = A.wrap_oo <:expr< $lid:name$ >> typ in
+                      <:str_item<  let $lid:name$ : $polytype$ = $exp$ ;; $st$ >>, methods
+                  end
+              | _ -> st, methods
+            ) (<:str_item<>>, [])  name_typ_list
+          in
+          begin 
+            let init = 
+              let inherits = try Hashtbl.find class_dep_graph tyname with _ -> [] in
+              List.fold_left (fun st x ->
+                let ox = "o" ^ x in
+                CrSem(_loc, <:class_str_item< inherit $lid:ox$ >>, st))
+                <:class_str_item< method $tyname$ = (t :> $lid:tyname$ t) >> inherits
+            in
+            let methods = List.fold_left (fun st x -> CrSem(_loc, st, x)) init methods in
+            let sitem = <:str_item< class $lid:clsname$ t = object $methods$ end >> in
+            (tyname, sitem) :: clses
+          end,
+          <:str_item< $st$ module $modname$ = struct $sitems$ end >>
+
+      | _ -> clses, st) modules ([], <:str_item<>>)
+
+  let build class_dep_graph modules =
+    let clses, st = build class_dep_graph modules in
+
+    (* create structure of classes in the order of dependency *)
+
+    let tbl = Hashtbl.create 107 in
+    List.iter (fun (tyname, sitem) -> Hashtbl.add tbl tyname sitem) clses;
+
+    let sitem = ref <:str_item< >> in
+
+    let print_class tyname = 
+      try
+        let i = Hashtbl.find tbl tyname in
+        sitem := <:str_item< $!sitem$ $i$ >>;
+        Hashtbl.remove tbl tyname (* done *)
+      with
+      | Not_found -> () (* already done *)
+    in
+    
+    List.iter (fun (tyname, _sitem) ->
+      let parents = try Hashtbl.find class_dep_graph tyname with _ -> [] in
+      List.iter print_class parents;
+      print_class tyname) clses;
+
+    <:str_item< $!sitem$ $st$ >>
+      
+  let wrap_sig_item sig_item = 
+    let class_dep_graph = get_class_dep_graph sig_item in
+    let modules = extract_vals sig_item in
+    build class_dep_graph modules
+
+  let wrap = object
+    inherit Ast.map as super
+
+    method !sig_item sig_item = 
+      let str_item = wrap_sig_item sig_item in
+      (* A hack to print out implementation, in an intf filter *)
+      print_str_item str_item;
+      <:sig_item< >>
+  end
+
+  let _ = AstFilters.register_sig_item_filter wrap#sig_item
+end
+
+let module M = Register.AstFilter(Id)(Make) in ()
+
+

oowrap/pa_opycaml.ml

-module Id = struct
-  let name = "pa_oowrap"
-  let version = "1.0"
-end
-
-open Camlp4
-open PreCast
-
-(* See P4 filter tutorial at
-   http://ambassadortothecomputers.blogspot.com/2010/03/reading-camlp4-part-5-filters.html
-   http://brion.inria.fr/gallium/index.php/Camlp4MapGenerator
-*)
-
-module Make (AstFilters : Sig.AstFilters) = struct
-  open AstFilters
-  open Ast
-
-  (* Actually the AST is the same type, but the fact is not known to the type system.... *)
-  let print_str_item (sitem : str_item) = Register.CurrentPrinter.print_implem (Obj.magic sitem)
-
-  let _loc = Loc.ghost
-
-  let rec iter_sig_item ~f = function
-    | SgNil _ -> ()
-    | SgSem (_, sig_item1, sig_item2) -> iter_sig_item ~f sig_item1; iter_sig_item ~f sig_item2
-    | sig_item -> f <:sig_item< $sig_item$ >>
-
-  let rec fold_sig_item ~f ~init = function
-    | SgNil _ -> init
-    | SgSem (_, sig_item1, sig_item2) -> 
-        let st = fold_sig_item ~f ~init sig_item1 in
-        fold_sig_item ~f ~init:st sig_item2
-    | sig_item -> f init <:sig_item< $sig_item$ >>
-
-  let rec scan_tyors = function
-    | <:ctyp< $t1$ | $t2$ >> -> scan_tyors t1 @ scan_tyors t2
-    | <:ctyp< `$v$ >> -> [v]
-    | _ -> []
-
-  let class_type = 
-    let extract k varpath typath =
-      let normalize_path = function
-        | <:ident< Type.$lid:name$ >>
-        | <:ident< $lid:name$ >> -> Some name
-        | _ -> None
-      in
-      match normalize_path varpath, normalize_path typath with
-      | Some varpath, Some "t" -> Some (k, varpath)
-      | _ -> None
-    in
-    function
-    | <:ctyp< [> $id:varpath$ ] $id:typath$ >> -> extract `Bigger varpath typath
-    | <:ctyp< $id:varpath$ $id:typath$ >> -> extract `Equal varpath typath
-    | _ -> None
-
-  let _ = 
-    assert (class_type <:ctyp< [> _Object ] t >> = Some (`Bigger, "_Object"));
-    assert (class_type <:ctyp< _Object Type.t >> = Some (`Equal, "_Object"))
-    assert (class_type <:ctyp< Type._Object Type.t >> = Some (`Equal, "_Object"))
-  ;;
-
-  (* Obtain class dependencies encoded as poly-variant type definitions in the top sig *)
-  let get_class_dep_graph sig_item = 
-    let ancestors = 
-      let tbl = Hashtbl.create 107 in
-      iter_sig_item sig_item ~f:(function
-        | <:sig_item< type $lid:name$ = [ $tyors$ ] >> ->
-              prerr_endline ("found class dependency " ^ name);
-              let variants = scan_tyors tyors in
-              (* remove self to create ancestors *)
-              let ancestors = List.filter (fun x -> x <> name) variants in
-              Hashtbl.add tbl name ancestors
-        | _ -> ());
-      tbl
-    in
-    let is_ancestor_of a k = List.mem a (try Hashtbl.find ancestors k with Not_found -> assert false) in
-
-    (* create direct parent relationship from [ancestors] *)
-    let tbl = Hashtbl.create 107 in
-    Hashtbl.iter (fun k ancs ->
-      (* direct parents are ancestors which are not ancestors of other ancestors *)
-      let parents = List.filter (fun anc ->
-        List.for_all (fun anc' -> not (is_ancestor_of anc anc')) ancs)
-        ancs
-      in
-      Format.eprintf "class dependency %s : %s@." k (String.concat " " parents);
-      Hashtbl.add tbl k parents
-    ) ancestors;
-    tbl
-
-  let rec extract_vals sig_item = 
-    let vals = ref [] in
-    let rec visit rev_path sig_item = 
-      iter_sig_item sig_item ~f:(function
-        | <:sig_item< external $name$ : $typ$ = $_$ >> -> 
-            Format.eprintf "%s : val %s (external)@." (String.concat "." (List.rev rev_path)) name;
-            vals := (rev_path, name, typ) :: !vals 
-        | <:sig_item< val $name$ : $typ$ >> -> 
-            Format.eprintf "%s : val %s@." (String.concat "." (List.rev rev_path)) name;
-            vals := (rev_path, name, typ) :: !vals 
-        | <:sig_item< module $name$ : $ MtSig(_, sig_item) $ >> ->
-            visit (name :: rev_path) sig_item
-        | _ -> ())
-    in
-    visit [] sig_item;
-    
-    let modules = Hashtbl.create 107 in
-    let hashtbl_add_in_list tbl k v =
-      let vs = try Hashtbl.find tbl k with Not_found -> [] in
-      Hashtbl.replace tbl k (v::vs)
-    in
-    List.iter (fun (rev_path, name, typ) -> 
-      hashtbl_add_in_list modules rev_path (name, typ)) !vals;
-    modules
-
-  module A = struct (* Dirty part *)
-
-    let class_name s = "o" ^ s
-
-    let mk_id pos = Printf.sprintf "v%d" pos
-
-    let mk_tyvar pos = TyQuo(_loc, Printf.sprintf "a%d" pos) (* No ' required! *)
-
-    (* [> _Cls ] t -> ...   =>    _Cls -> ... *)
-    let wrap_in pos v ty =
-      match ty with
-      | <:ctyp< [ > Type.$lid:clsname$ ] Type.t >> -> 
-          let tv = mk_tyvar pos in
-          (* Strange, but < $ctyp$ : $ctyp$; ..> *)
-          let oty = TyAli(_loc, <:ctyp< < $lid:clsname$ : $lid:clsname$ t ; .. > >>, tv) in
-          <:expr< $v$ # $clsname$ >>,
-          Some tv,
-          oty
-
-      | <:ctyp< [ > Type.$lid:clsname$ ] Type.t option >> -> 
-          let tv = mk_tyvar pos in
-          (* Strange, but < $ctyp$ : $ctyp$; ..> *)
-          let oty = TyAli(_loc, <:ctyp< < $lid:clsname$ : $lid:clsname$ t ; .. > >>, tv) in
-          <:expr< option_bind $v$ (fun x -> x# $clsname$) >>,
-          Some tv,
-          <:ctyp< $oty$ option >>
-            
-      | _ -> v, None, ty
-    ;;
-
-    (* ... -> _Cls t   =>   ... -> _Cls *)
-    let wrap_out ty =
-      match ty with
-      | <:ctyp@tyloc< Type.$lid:clsname$ Type.t >> ->
-          (fun e -> <:expr< new $lid: class_name clsname$ $e$ >>), 
-          <:ctyp@tyloc< $lid: class_name clsname$ >>
-      | <:ctyp@tyloc< Type.$lid:clsname$ Type.t option >> ->
-          (fun e -> <:expr< option_bind $e$ (new $lid: class_name clsname$) >>), 
-          <:ctyp@tyloc< $lid: class_name clsname$ option >>
-      | _ -> (fun e -> e), ty
-    ;;
-
-    let wrap_oo base ty =
-
-      let rec args pos = function
-        | <:ctyp< $argty$ -> $ty$ >> ->
-
-            let qvars, mty, absts, args, mk_return = args (pos+1) ty in
-            
-            let v = <:expr<$lid:mk_id pos$>> in
-            let pat = mk_id pos in
-            let e, qv_opt, oty = wrap_in pos v argty in
-
-            let absts = pat :: absts in
-            let args = e :: args in
-
-            let qvars = 
-              match qv_opt with 
-              | None -> qvars
-              | Some qv -> qv :: qvars
-            in
-
-            let mty = <:ctyp< $oty$ -> $mty$ >> in
-
-            qvars, mty, absts, args, mk_return
-
-        | mty ->
-            let mk_return, mty = wrap_out mty in
-            [], mty, [], [], mk_return
-      in
-      let qvars, mty, absts, args, mk_return = args 0 ty in (* X *)
-      let q mty = function
-        | [] -> mty
-        | qvs ->
-            let rec qapp = function
-              | [] -> assert false
-              | [qv] -> qv
-              | qv::qvs -> TyApp(_loc, qv, qapp qvs) (* strange but it is as an app *)
-            in
-            TyPol (_loc, qapp qvs, mty)
-      in
-      let rec mk_app b = function
-        | [] -> b
-        | e::es -> mk_app <:expr< $b$ $e$ >> es
-      in
-      let rec mk_abst b = function
-        | [] -> b
-        | v::vs -> <:expr< fun $lid:v$ -> $mk_abst b vs$ >>
-      in
-      q mty qvars, mk_abst (mk_return (mk_app base args)) absts
-
-  end
-  (*  open A *)
-
-  let build class_dep_graph modules =
-    Hashtbl.fold (fun revpath name_typ_list (clses, st) ->
-      match List.rev revpath with
-      | [ "Py"; modname ] ->
-          let tyname = "_" ^ modname in
-          let clsname = "o" ^ tyname in
-          let sitems, methods = 
-            List.fold_left (fun (st, methods) (name, typ) -> 
-              match typ with
-              | <:ctyp<  $arg$ -> $typ'$  >> ->
-                  begin match class_type arg with
-                  | Some (`Bigger, tyname') when tyname' = tyname -> 
-                      let polytype, exp = A.wrap_oo <:expr< $lid:name$ t >> typ' in
-                      st, <:class_str_item< method $name$ : $polytype$ = $exp$ >> :: methods
-                  | _ -> 
-                      let polytype, exp = A.wrap_oo <:expr< $lid:name$ >> typ in
-                      <:str_item<  let $lid:name$ : $polytype$ = $exp$ ;; $st$ >>, methods
-                  end
-              | _ -> st, methods
-            ) (<:str_item<>>, [])  name_typ_list
-          in
-          begin 
-            let init = 
-              let inherits = try Hashtbl.find class_dep_graph tyname with _ -> [] in
-              List.fold_left (fun st x ->
-                let ox = "o" ^ x in
-                CrSem(_loc, <:class_str_item< inherit $lid:ox$ >>, st))
-                <:class_str_item< method $tyname$ = (t :> $lid:tyname$ t) >> inherits
-            in
-            let methods = List.fold_left (fun st x -> CrSem(_loc, st, x)) init methods in
-            let sitem = <:str_item< class $lid:clsname$ t = object $methods$ end >> in
-            (tyname, sitem) :: clses
-          end,
-          <:str_item< $st$ module $modname$ = struct $sitems$ end >>
-
-      | _ -> clses, st) modules ([], <:str_item<>>)
-
-  let build class_dep_graph modules =
-    let clses, st = build class_dep_graph modules in
-
-    (* create structure of classes in the order of dependency *)
-
-    let tbl = Hashtbl.create 107 in
-    List.iter (fun (tyname, sitem) -> Hashtbl.add tbl tyname sitem) clses;
-
-    let sitem = ref <:str_item< >> in
-
-    let print_class tyname = 
-      try
-        let i = Hashtbl.find tbl tyname in
-        sitem := <:str_item< $!sitem$ $i$ >>;
-        Hashtbl.remove tbl tyname (* done *)
-      with
-      | Not_found -> () (* already done *)
-    in
-    
-    List.iter (fun (tyname, _sitem) ->
-      let parents = try Hashtbl.find class_dep_graph tyname with _ -> [] in
-      List.iter print_class parents;
-      print_class tyname) clses;
-
-    <:str_item< $!sitem$ $st$ >>
-      
-  let wrap_sig_item sig_item = 
-    let class_dep_graph = get_class_dep_graph sig_item in
-    let modules = extract_vals sig_item in
-    build class_dep_graph modules
-
-  let wrap = object
-    inherit Ast.map as super
-
-    method !sig_item sig_item = 
-      let str_item = wrap_sig_item sig_item in
-      (* A hack to print out implementation, in an intf filter *)
-      print_str_item str_item;
-      <:sig_item< >>
-  end
-
-  let _ = AstFilters.register_sig_item_filter wrap#sig_item
-end
-
-let module M = Register.AstFilter(Id)(Make) in ()
-
-
-camlp4o pa_opycaml.cmo ../api.auto.mli
+camlp4o oowrap.cmo ../api.auto.mli
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.