Output Specification

For the purpose of automated grading, please follow the stand output defined here.

Program $\!\!\!\!\rightarrow\!\!\!\!$ MainClass ClassDecl $^{\textstyle *}$ { cout << "PROGRAM" << endl; }
MainClass $\!\!\!\!\rightarrow\!\!\!\!$ class id { public static void main ( String [] id )
         { Statement } } { cout << "MAINCLASS" << endl; }
ClassDecl $\!\!\!\!\rightarrow\!\!\!\!$ class id { VarDecl $^{\textstyle *}$ MethodDecl $^{\textstyle *}$ } { cout << "CLASSDECL1" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ class id extends id { VarDecl $^{\textstyle *}$ MethodDecl $^{\textstyle *}$ } { cout << "CLASSDECL2" << endl; }
VarDecl $\!\!\!\!\rightarrow\!\!\!\!$ Type id ; { cout << "VARDECL" << endl; }
MethodDecl $\!\!\!\!\rightarrow\!\!\!\!$ public Type id ( FormalList )
         { VarDecl $^{\textstyle *}$ Statement $^{\textstyle *}$ return Exp ; } { cout << "METHODDECL" << endl; }
... ...
Type $\!\!\!\!\rightarrow\!\!\!\!$ int [] { cout << "TYPE1" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ boolean { cout << "TYPE2" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ int { cout << "TYPE3" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ id { cout << "TYPE4" << endl; }
Statement $\!\!\!\!\rightarrow\!\!\!\!$ { Statement $^{\textstyle *}$ } { cout << "STATEMENT1" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ if ( Exp ) Statement else Statement { cout << "STATEMENT2" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ while ( Exp ) Statement { cout << "STATEMENT3" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ System.out.println ( Exp ) ; { cout << "STATEMENT4" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ id = Exp ; { cout << "STATEMENT5" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ id [ Exp ] = Exp ; { cout << "STATEMENT6" << endl; }
Exp $\!\!\!\!\rightarrow\!\!\!\!$ Exp AND Exp { cout << "EXP1" << endl; }
Exp '<' Exp { cout << "EXP2" << endl; }
Exp '+' Exp { cout << "EXP3" << endl; }
Exp '-' Exp { cout << "EXP4" << endl; }
Exp '*' Exp { cout << "EXP5" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ Exp [ Exp ] { cout << "EXP6" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ Exp . length { cout << "EXP7" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ Exp . id ( ExpList ) { cout << "EXP8" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ INTEGER_LITERAL { cout << "EXP9" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ true { cout << "EXP10" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ false { cout << "EXP11" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ id { cout << "EXP12" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ this { cout << "EXP13" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ new int [ Exp ] { cout << "EXP14" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ new id ( ) { cout << "EXP15" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ ! Exp { cout << "EXP16" << endl; }
  $\!\!\!\!\rightarrow\!\!\!\!$ ( Exp ) { cout << "EXP17" << endl; }
... ...