In the free software world, reading the code written by others is always encouraged. Development is often based on pattern matching: searching for an appropriate piece of code, copying interesting parts, and finally, adapting that code to suit ones needs.
Here are some links to code needed to develop a new front-end to GCC:
a skeleton for a new front-end: http://gcc.gnu.org/ml/gcc-patches/2006-06/msg00648.html
Finally it is also interesting to have a look at a complete toy front-end TreeLang: [gccsource:treelang].