views:

318

answers:

3

I would like to parse a simple grammar such as wiki markup using state machines. I have never written or played with one. I would like to lean how to implement a simple one. I am thinking of using Clojure for this. My question is can you point me to some good tutorials that are for complete newbies on this topic such as my self?

+1  A: 

Try Miro Samek's Book on State Machines. Practical UML Statecharts in C/C++

simon
A: 

You should look at the state machine compiler, to avoid a lot of boring code. It will produce Jars and Clojure - Java interop is good.

daveb
But he wants to _implement_ one, right, not just have a useable one?
Joren
+1  A: 

Take a look at fnparse. It is a Clojure library for functional parsing and contains a really good example of JSON parsing. Parser is another library that might be helpful also. Even if you don't wish to use them, they provide some great insights into parsing.

Timothy Pratley