
Hi all, I am new to Haskell, I need to write a grammar hacker in Haskell; that would find the first set of grammar, follow set of grammar, determine if it is in LL or not and generate a LR table. Can someone help me with the same? Any reply would be much appreciated. -- Sharadha Raghunathan

The algorithms are "common practice" and a web search should provide lecture notes detailing them - you will likely have to translate to Haskell yourself. If you have a university affiliation, I'd go to the library and check books on compiler construction. The classic is the "Dragon Book" - "Compilers: Principles, Techniques, and Tools" by Aho et al. though the presentation in this book is quite formal. I liked "Modern Compiler Design" by Grune et al. myself. Be cautious about buying a book without surveying it first - the presentation of the algorithms varies considerably. Best wishes Stephen

Stephen Tetley
"Compilers: Principles, Techniques, and Tools" by Aho et al. though the presentation in this book is quite formal.
you make that sound like a bad thing ... even the publisher seems to think so, and came up with a slogan that indeed must be the most counter-productive advertisement for a (computer) science textbook: "completely rewritten to be less formal" (for the recent edition of "Introduction to Automata Theory, Languages, and Computation", by an overlapping set of authors) J.W.

On 22 July 2011 16:32, Johannes Waldmann
Stephen Tetley
writes: "Compilers: Principles, Techniques, and Tools" by Aho et al. though the presentation in this book is quite formal.
you make that sound like a bad thing ...
Well - not intentionally, and for the cognoscenti formal presentations can often be translated to a high-level language like Haskell more easily than say pseudo code; but if you don't have much prior experience I'd think something at the Dragon Book's level would be quite demanding. Myself, I bought the Grune et al. book after getting stranded with the Dragon Book. Working through the Grune made reading the Dragon Book a lot more accessible.
participants (3)
-
Johannes Waldmann
-
sharadha Raghunathan
-
Stephen Tetley