Hello,

2010/1/29 Liam <liam.ga...@gmail.com>:
> Could someone educate me about what developers normally do when faced
> with having to create a lexer / parser / analyzer, say for clojure?
>
> Why would people go with a canned solution, i.e. ready-made like soup
> out of a can, instead of by hand?
>
> E.g. why did the Counterclockwise Eclipse plug-in for Clojure use
> ANTLR ,

Concerning Counterclockwise, it's simple: a combination of reasons
 * I wanted to play with ANTLR since we were also using it at work
 * Not much of Counterclockwise was written in clojure at that time

Note that currently, there's a joint effort to provide clojure-based
parsing for Counterclockwise : I'm working to create a port of paredit
during my spare time, currently using a hand-written clojure parser
(YAHWCP Yet Another Hand Written Clojure Parser - not a reader, a
parser which produces a parsetree), and Christophe Grand is working on
the general solution of providing a parser generator.

> or why did in the Enclojure NetBeans plug-in for clojure use
> JFLEX? Why in clojure itself is there a reader made by hand and not
> using a canned generator?
>
> Am I naive in thinking one should do that by hand? Is this archaic
> thinking like those who still prefer building websites in HTML by
> hand?

Note there is the fnparse library, too ( http://github.com/joshua-choi/fnparse )

> What's the advantage of doing that, say for clojure or in general? You
> still have to learn how a given generator works. And you may be
> limited by its design. What if you want fine combed control over how
> things are parsed to get, for example, sophisticated syntax based
> evaluation or inferences from cold code. E.g. like what Eclipse does
> for Java and their “Java Models” and exhaustive “Abstract Syntax Tree”
> nodes?
>
> I hope some of you could be generous enough to enlighten me.

I'm not sufficiently expert in the subject to give you this
enlightenment, sorry.

P.S. : what is a cold node ?
>From the vocabulary you're using, one could infer you're not a
beginner on the subject, so certainly you could do well with any tool.
I guess one of the purposes of such tools is to guide the users by
providing "built-in semantics" for thinking about the problem domain.
Another purpose may be that those tools provide more "declarative"
ways to define their grammars.

-- 
Laurent

-- 
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

Reply via email to