Are there any implementations already?
If the task is to actually practice writing it, I would recommend using a parser generator such as JavaCUP or ANTLR . (I used JavaCUP in one of my compiler courses, but maybe you have different features in your course.)
source
share