Re: Lexer and parser generator in Clojure

2012-05-22 Thread Lukas Domagala
you could try https://github.com/Cyrik/clparsec . i´m still working on an alpha release, but it already has all the basic parsec operators -- 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 No

Re: Lexer and parser generator in Clojure

2012-05-20 Thread Jason Jackson
This is a really great project. If you add LR1, you may want to retain ~LR0 as an option. My understanding is most grammars today are designed for LALR1. On Sun, May 20, 2012 at 4:26 AM, Christophe Grand wrote: > On Sat, May 19, 2012 at 9:44 PM, Jason Jackson wrote: > >> In retrospect, I would ha

Re: Lexer and parser generator in Clojure

2012-05-20 Thread Christophe Grand
On Sat, May 19, 2012 at 9:44 PM, Jason Jackson wrote: > In retrospect, I would have tried > https://github.com/cgrand/**parsley afaik > it has ~LR1 performance characteristics. > Parsley is closer to LR(0) (but I'd like to make it LR(1) using Pager's lane trac

Re: Lexer and parser generator in Clojure

2012-05-19 Thread Brent Millare
I wrote a library on parsing expression grammars (PEGs). Its not completely independent from clojurescript since I use java's regular expressions for the token component, but technically it works on sequences and its easy to rewrite this for js's regexps. Performance hasn't been measured but the

Re: Lexer and parser generator in Clojure

2012-05-19 Thread Jason Jackson
I didn't read the part about clojure/clojurescript interop. Also, you could write a parser by hand in clojure[script], which takes a parse table as input. The parse table can be generated with from any language. On Saturday, 19 May 2012 15:44:28 UTC-4, Jason Jackson wrote: > > I wrote a com

Re: Lexer and parser generator in Clojure

2012-05-19 Thread Jason Jackson
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 w

Re: Lexer and parser generator in Clojure

2012-05-19 Thread John Szakmeister
On Fri, May 18, 2012 at 8:46 AM, 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 (

Re: Lexer and parser generator in Clojure

2012-05-19 Thread Matt Mitchell
Here's a parser: https://github.com/joshua-choi/fnparse Doesn't look like it's active, but could be a starting point? - Matt On Friday, May 18, 2012 8:46:19 AM UTC-4, Alexsandro Soares wrote: > > Hi, > > I'm trying to build a compiler using Clojure. Is there any tools > like flex and bison

Lexer and parser generator in Clojure

2012-05-18 Thread Alexsandro Soares
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 too