4

This question already has an answer here:

I want to write my own compiler for my own language. Yes, it's going to be hard, and it will take long, but I think it will be worth it.

I have looked into OSDev.org, and read about executable formats there, but they aren't much help. I am looking for information beyond what they have there.

So, anything will help. Books, websites, PDFs, anything.

I am looking into 32-bit, not 64- or 16-bit.

marked as duplicate by World Engineer Feb 28 '14 at 21:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • meta.stackexchange.com/questions/25840/…. He gives a list of stackoverflow posts that will answer this question. He's not downvoted because of the list (the list of posts are useful). – jmq Mar 2 '12 at 23:27
  • Hello Marcus Szanto and welcome to Programmers! This is an extremely broad question, and can not be reasonably answered. Please do some research of your own, and when you start building your compiler feel free to ask specific questions. – yannis Mar 2 '12 at 23:54
2

I would think the best place to start in practical terms would be a solid foundation in using lex and yacc (or flex and bison), since these are likely the tools you'll use to actually build the compiler. There's a tutorial here, and O'Reilly has a great book about them.

From a theoretical standpoint, you'll want to study compiler design. Google turns up plenty of quality resources, but the the classic book on the subject is Compilers: principles, techniques, and tools by Alfred V. Aho. I can't recommend it highly enough.

Not the answer you're looking for? Browse other questions tagged or ask your own question.