   [filename]    
     (.getIncludeDirectives (translation-unit filename)))
 
-;; (defn ast-visitor []
-;;   (reify ASTVisitor
-;;     (visit [this name]
-;;       (printf "name: %s\n" name))))
-
 (defmacro set-all! [obj m]
     `(do ~@(map (fn [e] `(set! (. ~obj ~(key e)) ~(val e))) m) ~obj))
 
-(defn ast-visitor []
+(gen-class :name atom-finder.core.AtomVisitor
+           :prefix "av-"
+           :extends ASTVisitor)
+
+(defn av-visit [name] (printf "name1: %s\n" name) true)
+
+;;(atom-finder.core.AtomVisitor.)
+
+;; (defn ast-visitor-gen-class []
+;;   
+;;   (atom-finder.core/set-all! (atom-finder.AtomVisitor.) {
+;;             shouldVisitNames        true
+;;             shouldVisitDeclarations false
+;;             shouldVisitDeclarators  true
+;;             shouldVisitAttributes   true
+;;             shouldVisitStatements   false
+;;             shouldVisitTypeIds      true})
+;;   )
+
+(defn ast-visitor-proxy []
   (->
    (proxy [ASTVisitor] []
-    (visit [name]
-      (printf "name: %s\n" name) 3))
+    (visit [name] (printf "name1: %s\n" name) true)
+    (endVisit [name] (printf "name2: %s\n" name))
+    )
 
     (set-all! {shouldVisitNames        true
                shouldVisitDeclarations false

  [filename]
  (FileContent/createForExternalFileLocation filename))

(defn translation-unit
  [filename]
  (let [definedSymbols {}
        includePaths (make-array String 0)
        info (new ScannerInfo definedSymbols includePaths)

  (prn (file-content filename))
  (for [incld (file-includes filename)] (printf "include - %s\n" (.getName incld)))

  (visit-ast filename)
  (ast-visitor-proxy)
  (print-tree (translation-unit filename) 1)
  )
