To build a compiler, I'd highly recommend standing on the shoulders of giants. There is a lot of good stuff out there that can be put together to make compilers. I've been working on a compiler part time for C/C++. It uses GLR for parsing, builds an AST, uses SSA as its intermediate form, does inter procedural optimizations, and generates code for X86, ARM, MIPS, PowerPC, Sparc, and others.
The secret? I borrowed code from several sources.
- The preprocessor and error reporting from clang
- The Elkhound and Elsa compiler generator and C/C++ compiler
- The LLVM system for optimization and code generation
Working part time I've been able to put together quite a useful system of tools. If I had tried to start from scratch, I'd barely have the parser finished by now. ;-)
http://ellcc.org