import java_cup.runtime.*; import java.io.Reader; import java.io.FileReader; parser code {: public static void main(String[] args){ try{ Parser p = new Parser(new Lexer(new FileReader(args[0]))); Object result = p.parse().value; }catch(Exception e ){} } public void syntax_error(Symbol cur_token){ String errorMsg ; // Your code goes here report_error(errorMsg, null); } :}; /* Terminals (tokens returned by the scanner). */ terminal CLASS; terminal PUBLIC, STATIC, VOID, MAIN; terminal String IDENTIFIER; terminal Integer INTEGER_LITERAL; /* Non terminals */ non terminal program; non terminal mainClass; non terminal classDecs; /* Precedences */ precedence left PLUS, MINUS; precedence left TIMES; start with program; /* The grammar */ program ::= mainClass classDecs ; /* Your tokens should fill in the ... below */ mainClass ::= CLASS IDENTIFIER ... LBRACE statement RBRACE RBRACE ; classDecs ::= | classDec classDecs ;