   (prn (file-content filename))
   (for [incld (file-includes filename)] (printf "include - %s\n" (.getName incld)))
 
-  (file-ast filename)
-  (ast-visitor)
+  (visit-ast filename)
+  (ast-visitor-proxy)
   (print-tree (translation-unit filename) 1)
   )

  [filename]
  (FileContent/createForExternalFileLocation filename))

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

  [filename]    
    (.getIncludeDirectives (translation-unit filename)))

(defmacro set-all! [obj m]
    `(do ~@(map (fn [e] `(set! (. ~obj ~(key e)) ~(val e))) m) ~obj))

(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 "name1: %s\n" name) true)
    (endVisit [name] (printf "name2: %s\n" name))
    )

    (set-all! {shouldVisitNames        true
               shouldVisitDeclarations false
