5

Possible Duplicate:
Learning to Write a Compiler

How to design simple compiler? I want to design compiler for MCA project.

Community
  • 1
  • 1

5 Answers5

9

Read: The Dragon Book

The Matt
  • 6,618
  • 7
  • 44
  • 61
5

You should check out Compilers: Principles, Techniques, and Tools.

Silfverstrom
  • 28,292
  • 6
  • 45
  • 57
3

You don't. 'Compiler' and 'simple' are mutually exclusive terms.

Sam Harwell
  • 97,721
  • 20
  • 209
  • 280
  • By no means. You can easily write a compiler for a small language inside a week. Most websites take much longer than that to implement. –  Jul 15 '09 at 23:01
  • 2
    You can easily write a website for small content inside a week. Most compilers take much longer than that to implement. :) Writing a compiler is one of the most interesting challenges I've attempted, so even though it's "not simple" (IMO), it's a worthwhile experience for someone interested in the subject. – Sam Harwell Jul 15 '09 at 23:06
1

Let's Build a Compiler, by Jack Crenshaw , a little outdated, but could be useful (here is the pdf version).

Also you have to see this post with a lot of resources.

Community
  • 1
  • 1
Eliseo Ocampos
  • 2,473
  • 4
  • 20
  • 32
  • +1 for the PDF - I've referred people to the terrible text docs! –  Jul 15 '09 at 23:23
  • Actually, why don't you update the "lots of resources" main question with the Crenshaw info? It's a Wiki, so you should be able to do that (I think). –  Jul 15 '09 at 23:29
  • Noup, I can't, rep stuff :P, besides, that answer was already posted (it's the last one). – Eliseo Ocampos Jul 16 '09 at 00:40
1

Here is the definitive list of compiler building resources on SO:

Learning to write a compiler

Community
  • 1
  • 1