Guys what are the best Online resources for learning Compiler Design ?
Would Perl be a viable language to write a Compiler ?
Guys what are the best Online resources for learning Compiler Design ?
Would Perl be a viable language to write a Compiler ?
Some things are not best learned on-line, and something of the complexity of compiler design is one of them. For a list of books on the subject, take a look at this question. I selected it more or less at random from a lot of similar questions - to get a list of them all, Google for
site:stackoverflow.com compiler design books
As for perl as a suitable language - yes, you can write a compiler in Perl, but I personally wouldn't like to try it. If I were you I'd take a look at something a bit cleaner, like Python.
Did you look at the answers to this question: http://stackoverflow.com/questions/1669/learning-to-write-a-compiler
Rather than online, as mentioned in the above answer, grab yourself a copy of the Dragon book Compilers: Principles, Techniques, and Tools. A copy of the first edition shouldn't set you back too much.
Not sure about Perl as a language of choice for implementing a compiler though.
Jack Crenshaw wrote a great series on compiler construction - find it at http://compilers.iecc.com/crenshaw/ (examples are in Pascal, but still very useful).
There is also a c version floating around somewhere, but I can't find the link to it atm (someone else ported all the code in the articles into ANSI-C).
I originally learned perl because I thought it might have a yacc in it.
It doesn't.
While I'm sure there are modules to add this sort of behaviour, and Perl 6 looks like it might be better in this regard, you would do well to study lex and yacc (or bison) instead.
I'm still glad I learned perl, though.