is it possible to pass a tree (data structure) to clojure and work on it?
tree structure buil开发者_如何学Pythond by from java code passed to clojure REPL and then using that data structure work on it. this tree is formed by ANTLR after parsing the code.
Clojure's interop with java is very good. Is there some reason you can't call ANTLR from Clojure and simply used the generated tree that way?
http://clojure.org/java_interop
you could include the java class that produces the tree in your project and call it from the REPL to get an Object. then Clojure that Object to your hearts content :)
The only real decision you need to make is should control start in Clojure which then calls java or the other way around. I personally find it easier to start in Clojure because I find leiningen more pleasant to work with than maven.
精彩评论