Program |
 |
MainClass ClassDecl
 |
{ cout << "PROGRAM" << endl; } |
MainClass |
 |
class id { public static void
main ( String [] id ) |
|
|
|
{ Statement } } |
{ cout << "MAINCLASS" << endl; } |
ClassDecl |
 |
class id { VarDecl
MethodDecl
} |
{ cout << "CLASSDECL1" << endl; } |
|
 |
class id extends id { VarDecl
MethodDecl
} |
{ cout << "CLASSDECL2" << endl; } |
VarDecl |
 |
Type id ; |
{ cout << "VARDECL" << endl; } |
MethodDecl |
 |
public Type id ( FormalList ) |
|
|
|
{ VarDecl
Statement
return
Exp ; } |
{ cout << "METHODDECL" << endl; } |
... |
|
... |
|
Type |
 |
int [] |
{ cout << "TYPE1" << endl; } |
|
 |
boolean |
{ cout << "TYPE2" << endl; } |
|
 |
int |
{ cout << "TYPE3" << endl; } |
|
 |
id |
{ cout << "TYPE4" << endl; } |
Statement |
 |
{ Statement
} |
{ cout << "STATEMENT1" << endl; } |
|
 |
if ( Exp ) Statement else Statement |
{ cout << "STATEMENT2" << endl; } |
|
 |
while ( Exp ) Statement |
{ cout << "STATEMENT3" << endl; } |
|
 |
System.out.println ( Exp ) ; |
{ cout << "STATEMENT4" << endl; } |
|
 |
id = Exp ; |
{ cout << "STATEMENT5" << endl; } |
|
 |
id [ Exp ] = Exp ; |
{ cout << "STATEMENT6" << endl; } |
Exp |
 |
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; } |
|
 |
Exp [ Exp ] |
{ cout << "EXP6" << endl; } |
|
 |
Exp . length |
{ cout << "EXP7" << endl; } |
|
 |
Exp . id ( ExpList ) |
{ cout << "EXP8" << endl; } |
|
 |
INTEGER_LITERAL |
{ cout << "EXP9" << endl; } |
|
 |
true |
{ cout << "EXP10" << endl; } |
|
 |
false |
{ cout << "EXP11" << endl; } |
|
 |
id |
{ cout << "EXP12" << endl; } |
|
 |
this |
{ cout << "EXP13" << endl; } |
|
 |
new int [ Exp ] |
{ cout << "EXP14" << endl; } |
|
 |
new id ( ) |
{ cout << "EXP15" << endl; } |
|
 |
! Exp |
{ cout << "EXP16" << endl; } |
|
 |
( Exp ) |
{ cout << "EXP17" << endl; } |
... |
|
... |
|