Just ran into this while searching. I myself have never tried making a compiler,but I may try and follow this tutor.
http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/
Not sure if this only pertains to linux, or if it could be used in a Windows environment.
Looks like it might work using Mingw to work in Windows...
Hm. Great article. Thank you for sharing. This can also be used for other things. :bdg
This helps get an idea of how a compiler works. Using tokens and parsing and generating code. Very nice indeed.