Are you doing this for part of the class? If so, there should be recommendations for parsing and lexing. If not, you have a lot of work!
Writing the actual compiler is much more complicated than just looking at a lot of if statements because you need to keep track of the environment. You need to think about how you resolve classes, functions, function calls, class instances, recursive functions ... the list goes on.
Take a look at UC Berkeley's lecture course on this subject, such as parsing, lexing, code generation, and the tools you need:
http://www-inst.eecs.berkeley.edu/~cs164/fa13/
Note that this course, in particular, used C ++ to write the Python2.5 compiler for assembly, but the concepts in lectures and readings and some tools are not limited to languages.
source share