I wrote a compiler in Clojure for a 4th year course. For parsing I used this combinator parser library: https://github.com/jasonjckn/clarsec which is modeled after haskell's parsec. However the performance was kind of bad, combinator parsers in general can be pretty slow.
In retrospect, I would have tried https://github.com/cgrand/parsley afaik it has ~LR1 performance characteristics. Beyond the above options, there's many LR1/LL1 parsers written in Java that are perfectly fine options. If you're parsing with a grammar file, you don't gain anything if the parser was written in Clojure versus Java. For lexing, I just used clojure's regular expression implementation. Not sure what libraries exist. -Jason On Friday, 18 May 2012 08:46:19 UTC-4, Alexsandro Soares wrote: > > Hi, > > I'm trying to build a compiler using Clojure. Is there any tools > like flex and bison generating Clojure code? > I'm interested in a lexer/parser in pure Clojure because I think > in use the same code with Javascript (via ClojureScript) and Java (via > Clojure). > I already know isolated tools like Jflex, JavaCup and Bison generating > Java and > Jison, JS/CC and friends for Javascript, but I am just interested in a > pure Clojure solution. > > Thanks in advance for any answer. > > Cheers, > Alex > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en