Permalink
Browse files

* lang_java/parsing/test_parsing_java.ml: put back visitor test

  • Loading branch information...
1 parent 68895d5 commit 4f81297753090ab1e9cae3b6ed2b8aa6bbf096fb @aryx aryx committed Dec 15, 2012
Showing with 12 additions and 16 deletions.
  1. +1 −0 lang_java/analyze/graph_code_java.ml
  2. +11 −16 lang_java/parsing/test_parsing_java.ml
@@ -19,6 +19,7 @@ module G = Graph_code
open Ast_java
module Ast = Ast_java
+module PI = Parse_info
(*****************************************************************************)
(* Prelude *)
@@ -11,8 +11,9 @@
*)
open Common
-open Parser_java
+open Ast_java
module PI = Parse_info
+module V = Visitor_java
(*****************************************************************************)
(* Subsystem testing *)
@@ -78,28 +79,22 @@ let test_dump file =
pr str
let test_visitor file =
-(*
-
- let _bigf = { Visitor_java.default_visitor_s with
- Visitor_java.kexpr_s = (fun (k, bigf) e ->
- match Ast_java.unwrap e with
- | Ast_java.Literal s ->
+ let visitor = V.mk_visitor { V.default_visitor with
+ V.kexpr = (fun (k, bigf) e ->
+ match e with
+ | Ast_java.Literal (s,_) ->
pr2 ("lit:" ^ s);
k e
- | Ast_java.Dot (e, s) ->
+ | Ast_java.Dot (e, (s,_)) ->
pr2 "dot: s";
k e
| _ -> k e
);
} in
-*)
- (*
- let ((xs,info_item), stat) = Parse_java.parse file in
- match xs with
- | Left cu -> Visitor_java.compilation_unit bigf cu +> ignore
- | Right _ -> pr2 "error parsing"
- *)
- raise Todo
+
+ let ast = Parse_java.parse_program file in
+ visitor (Program ast);
+ ()
(*****************************************************************************)
(* Main entry for Arg *)

0 comments on commit 4f81297

Please sign in to comment.