I'm wanting to play around with creating an LR parser generators. Does anyone know of a good (free) resource describing how to create a state machine table from a grammar?
+3
A:
For a free resource, consider the Python source code for PLY - a full implementation of Lex and Yacc in Python.
I would recommend a book, however, and you can hardly do better than get The Dragon Book.
Eli Bendersky
2008-11-21 06:59:14
I really should just break down and buy a copy (and looking at the used prices I might just do that) but I'm often to stingy. Besides, it's sort of a sacrilege to spend money on "totally useless but cool code hacks"
BCS
2008-11-21 07:12:51
Absolutely not "totally useless". Reading the dragon book can teach you a lot about programming. Armed with a good understanding of LR parsers you'll be better able to grasp new languages and design others, such as DSLs for specific tasks.
Eli Bendersky
2008-11-21 07:53:28
I've already written a parser generator (recursive descent) and played with languages on a number of projects. The "totally useless" part is that fact that the implementation language is going to be MySQL!
BCS
2008-11-21 23:03:52
I've ordered a copy.
BCS
2008-11-21 23:07:14
There's a first edition available as a PDF from that website. It doesn't get close to the Dragon, though.
Eli Bendersky
2008-11-22 06:34:05
A:
Maybe you find Grammatica useful. It's a free Parser generator for .NET. I have some experience with it and it was good. You can try it and study its code. http://grammatica.percederberg.net/
Rafa G. Argente
2008-11-21 09:47:33
+1
A:
The obvious answer is the standard compiler text by Aho/Ullman/Ravi, Compilers: Principles, Techniques, and Tools
It has complete chapters on parsing. It isn't free, but it is worth every last penny, and if you are going to build parsers or other compiler-like tools, you are simply crazy if you don't have this book.
Ira Baxter
2009-10-03 04:38:07