I wrote a C++ compiler back in 2000. It took me couple of years to polish that. And it was not even the full compiler: parser and semantic analysis, but no code generation in the usual sense. It did, however, support several idiosyncratic compiler dialects.<p>C++ is an ugly, ugly, _ugly_ language. Even C language, the base of C++, is context-dependent, which in practice means that you need to intermix parsing and semantic analysis. Consider for example this code 'T*t'. If 'T' is a type, then this is declaration of variable 't' that is pointer to 'T'. If it is identifier, then it is non-assigned multiplication of 'T' and 't'.<p>C++ added its own quirks on top of that. You have, for example, parse class definitions two times. First, just the declarations and only then inline method bodies. There is no other way to do it correctly.<p>And don't even get me started on semantics.