Writing a compiler for academic course.