Liam <liam.ga...@gmail.com> writes: > Could someone educate me about what developers normally do when faced > with having to create a lexer / parser / analyzer, say for clojure?
For parsing something like Clojure I would probably do it by hand, as the syntax is regular-enough that it's pretty easy to do. For parsing anything more complex or if I was trying to match a formally specified grammar [1] I'd probably use a generator. [1] http://python.org/doc/2.5.4/ref/grammar.txt > Why would people go with a canned solution, i.e. ready-made like soup > out of a can, instead of by hand? Because parsing complex languages is rather hard to get perfect. It becomes vary easy to misinterpret something or accept something which should be rejected. This can lead to strange bugs and sometimes security problems. When your parser is just a direct translation of the grammar you can be a lot more confident you got everything right. -- 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