/* JFlex code for MiniJava lexer specification */ import java_cup.runtime.*; /** * This class is a simple example lexer. */ %% %class MJLex %unicode %cup %line %column %function next_token %type java_cup.runtime.Symbol /* define identifiers etc here */ /* this is useful to handle multi-line comments */ %state INSTRING %eofval{ return symbol(MJParse_sym.EOF); %eofval} %% /* map keywords etc to tokens (see MJParse_sym) here */ /* error fallback */ .|\n { throw new Error("Illegal character <"+ yytext()+">"); }