Write the lexical-analysis part of a JavaCC or SableCC specification for MiniJava. The Grammar link describes the syntax of MiniJava. The directory chap2/javacc contains a test-scaffolding file Main.java that calls the lexer generated by javacc. Similar files for sablecc can be found in chap2/sablecc.