The last two weeks I was involved in writing a lexical and syntax analyzer for a university assignment using flex and bison.
It seems you want to do a similar assignment using JavaCC. Let me know if you need any help in this regard.
Sincerely,
Atul Rajdhar