Syntax and Grammar... you should:
i) Complete the TOKEN definitions in MJ.jj.
ii) Complete the grammar in [login to view URL] so that it can parse MiniJava programs.
• In part b) you will need to use the abstract syntax provided and this constrains the way that you build the grammar.
• The grammar avoids left-recursion and ambiguity, but there are still lookahead issues that you will need to resolve. By default, JavaCC assumes that only 1 token of lookahead is required, but this is not sufficient for the MiniJava grammar as specified; for example, consider how far you need to look ahead to know whether you are parsing the last VarDecl or the first Statement in the body of a method declaration.
• In the first instance when writing this grammar you should not include any semantic actions and the return type for each method can be void. Part b asks you to change this. You can test your parser by running: java Parse filename.
Remember that you are required to submit this version as a separate file (MJ- [login to view URL]) so make a copy and put it somewhere safe before moving on to part b.