I am assuming this is a homework assignment you have and not a real compiler
-- it would take a lifetime
My best suggestion would be to read a good online tutorial
There is an O'Reilly book available as well.
Btw, m not into compilers at present , so doubt can help you any more than this.