File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Designing Compilers

 
Ayan Biswas
Ranch Hand
Posts: 104
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to read a subject on compiler design in my b-tech course.Although I find the subject interesting(i.e the theoritical aspects of it) i would like to know how to design a compiler for a very basic programming language?Where should I start?
P.S. Please don't crack jokes(I have a pretty bad experience about it when I asked a question about genetic algorithm here!).
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want jokes, then don't post in Meaningless Drivel.

There are tons of books on compilers. Pick one.
 
Karthik Shiraly
Bartender
Pie
Posts: 1059
24
Android C++ Java Linux PHP Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ayan Biswas wrote:I have to read a subject on compiler design in my b-tech course.Although I find the subject interesting(i.e the theoritical aspects of it) i would like to know how to design a compiler for a very basic programming language?Where should I start?
P.S. Please don't crack jokes(I have a pretty bad experience about it when I asked a question about genetic algorithm here!).

I had a similar interest (but not the required education) couple of years ago.
This non-technical tutorial helped me understand fundamental concepts like tokenization, lexical analysis, expression evaluation, symbol tables, BNF, railroad diagrams, etc:
"Let's Build a Compiler, by Jack Crenshaw"

Once those basics are understood and you have a working compiler, perhaps you can move to understanding and implementing more sophisticated concepts like FSA (finite state automata) which most textbooks explain.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compilers: Principles, Techniques, and Tools by Aho, Sethi, Lam, Ullman is the gold standard.
 
Pat Farrell
Rancher
Posts: 4660
5
Linux Mac OS X VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Compilers: Principles, Techniques, and Tools by Aho, Sethi, Lam, Ullman is the gold standard.

Aka the dragon book. Used in senior level courses and grad schools all over the world for decades.
 
Ryan Beckett
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, I'd a buy book on compilers. I recommend Modern Compiler Implementation in Java or Compilers: Principles, Techniques, and Tools. Then, I'd check out JLex, JavaCC and CUP, because it's probably not the best idea to try and create a compiler from scratch. There's a lot of formal language theory, automaton theory, and assembly language used in building compilers from the ground up.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic