Tuesday, February 21, 2012

The Java JLS3 Grammar

This is the formal syntax of Java (JLS3 2005). The grammar is written in ISO/IEC 14977 EBNF notation (ISO/IEC 1996).

Grammar | The goal symbol Input | The goal symbol CompilationUnit | Index

Grammar

UnicodeInputCharacter =
UnicodeEscape | RawInputCharacter ;

UnicodeEscape =
'\', UnicodeMarker, HexDigit, HexDigit, HexDigit, HexDigit ;

UnicodeMarker =
'u' | UnicodeMarker, 'u' ;

RawInputCharacter =
? any Unicode character ? ;

HexDigit =
'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' ;

LineTerminator =
? the ASCII LF character, also known as "newline" ? | ? the ASCII CR character, also known as "return" ? | ? the ASCII CR character followed by the ASCII LF character ? ;

InputCharacter =
UnicodeInputCharacter - (? CR ? | ? LF ?) ;

Input =
[InputElements], [Sub] ;

InputElements =
InputElement | InputElements, InputElement ;

InputElement =
WhiteSpace | Comment | Token ;

Token =
Identifier | Keyword | Literal | Separator | Operator ;

Sub =
? the ASCII SUB character, also known as "control-Z" ? ;

WhiteSpace =
? the ASCII SP character, also known as "space" ? | ? the ASCII HT character, also known as "horizontal tab" ? | ? the ASCII FF character, also known as "form feed" ? | LineTerminator ;

Comment =
TraditionalComment | EndOfLineComment ;

TraditionalComment =
'/', '*', CommentTail ;

EndOfLineComment =
'/', '/', [CharactersInLine] ;

CommentTail =
'*', CommentTailStar | NotStar, CommentTail ;

CommentTailStar =
'/' | '*', CommentTailStar | NotStarNotSlash, CommentTail ;

NotStar =
InputCharacter - '*' | LineTerminator ;

NotStarNotSlash =
InputCharacter - ('*' | '/') | LineTerminator ;

CharactersInLine =
InputCharacter | CharactersInLine, InputCharacter ;

Identifier =
IdentifierChars - (Keyword | BooleanLiteral | NullLiteral) ;

IdentifierChars =
JavaLetter | IdentifierChars, JavaLetterOrDigit ;

JavaLetter =
? any Unicode character that is a Java letter ? ;

JavaLetterOrDigit =
? any Unicode character that is a Java letter-or-digit ? ;

Keyword =
'abstract' | 'assert' | 'boolean' | 'break' | 'byte' | 'case' | 'catch' | 'char' | 'class' | 'const' | 'continue' | 'default' | 'do' | 'double' | 'else' | 'enum' | 'extends' | 'final' | 'finally' | 'float' | 'for' | 'goto' | 'if' | 'implements' | 'import' | 'instanceof' | 'int' | 'interface' | 'long' | 'native' | 'new' | 'package' | 'private' | 'protected' | 'public' | 'return' | 'short' | 'static' | 'strictfp' | 'super' | 'switch' | 'synchronized' | 'this' | 'throw' | 'throws' | 'transient' | 'try' | 'void' | 'volatile' | 'while' ;

Literal =
IntegerLiteral | FloatingPointLiteral | BooleanLiteral | CharacterLiteral | StringLiteral | NullLiteral ;

IntegerLiteral =
DecimalIntegerLiteral | HexIntegerLiteral | OctalIntegerLiteral ;

DecimalIntegerLiteral =
DecimalNumeral, [IntegerTypeSuffix] ;

HexIntegerLiteral =
HexNumeral, [IntegerTypeSuffix] ;

OctalIntegerLiteral =
OctalNumeral, [IntegerTypeSuffix] ;

IntegerTypeSuffix =
'l' | 'L' ;

DecimalNumeral =
'0' | NonZeroDigit, [Digits] ;

Digits =
Digit | Digits, Digit ;

Digit =
'0' | NonZeroDigit ;

NonZeroDigit =
'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ;

HexNumeral =
'0', 'x', HexDigits | '0', 'X', HexDigits ;

HexDigits =
HexDigit | HexDigit, HexDigits ;

OctalNumeral =
'0', OctalDigits ;

OctalDigits =
OctalDigit | OctalDigit, OctalDigits ;

OctalDigit =
'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' ;

FloatingPointLiteral =
DecimalFloatingPointLiteral | HexadecimalFloatingPointLiteral ;

DecimalFloatingPointLiteral =
Digits, '.', [Digits], [ExponentPart], [FloatTypeSuffix] | '.', Digits, [ExponentPart], [FloatTypeSuffix] | Digits, ExponentPart, [FloatTypeSuffix] | Digits, [ExponentPart], FloatTypeSuffix ;

ExponentPart =
ExponentIndicator, SignedInteger ;

ExponentIndicator =
'e' | 'E' ;

SignedInteger =
[Sign], Digits ;

Sign =
'+' | '-' ;

FloatTypeSuffix =
'f' | 'F' | 'd' | 'D' ;

HexadecimalFloatingPointLiteral =
HexSignificand, BinaryExponent, [FloatTypeSuffix] ;

HexSignificand =
HexNumeral | HexNumeral, '.' | '0x', [HexDigits], '.', HexDigits | '0X', [HexDigits], '.', HexDigits ;

BinaryExponent =
BinaryExponentIndicator, SignedInteger ;

BinaryExponentIndicator =
'p' | 'P' ;

BooleanLiteral =
'true' | 'false' ;

CharacterLiteral =
"'", SingleCharacter, "'" | "'", EscapeSequence, "'" ;

SingleCharacter =
InputCharacter - ("'" | '\') ;

StringLiteral =
'"', [StringCharacters], '"' ;

StringCharacters =
StringCharacter | StringCharacters, StringCharacter ;

StringCharacter =
InputCharacter - ('"' | '\') | EscapeSequence ;

EscapeSequence =
'\', 'b' | '\', 't' | '\', 'n' | '\', 'f' | '\', 'r' | '\', '"' | '\', "'" | '\', '\' | OctalEscape ;

OctalEscape =
'\', OctalDigit | '\', OctalDigit, OctalDigit | '\', ZeroToThree, OctalDigit, OctalDigit ;

ZeroToThree =
'0' | '1' | '2' | '3' ;

NullLiteral =
'null' ;

Separator =
'(' | ')' | '{' | '}' | '[' | ']' | ';' | ',' | '.' ;

Operator =
'=' | '>' | '<' | '!' | '~' | '?' | ':' | '==' | '<=' | '>=' | '!=' | '&&' | '||' | '++' | '--' | '+' | '-' | '*' | '/' | '&' | '|' | '^' | '%' | '<<' | '>>' | '>>>' | '+=' | '-=' | '*=' | '/=' | '&=' | '|=' | '^=' | '%=' | '<<=' | '>>=' | '>>>=' ;

Type =
PrimitiveType | ReferenceType ;

PrimitiveType =
NumericType | 'boolean' ;

NumericType =
IntegralType | FloatingPointType ;

IntegralType =
'byte' | 'short' | 'int' | 'long' | 'char' ;

FloatingPointType =
'float' | 'double' ;

ReferenceType =
ClassOrInterfaceType | TypeVariable | ArrayType ;

ClassOrInterfaceType =
ClassType | InterfaceType ;

ClassType =
TypeDeclSpecifier, [TypeArguments] ;

InterfaceType =
TypeDeclSpecifier, [TypeArguments] ;

TypeDeclSpecifier =
TypeName | ClassOrInterfaceType, '.', Identifier ;

TypeName =
Identifier | (TypeName | PackageOrTypeName), '.', Identifier ;

TypeVariable =
Identifier ;

ArrayType =
Type, '[', ']' ;

TypeParameter =
TypeVariable, [TypeBound] ;

TypeBound =
'extends', ClassOrInterfaceType, [AdditionalBoundList] ;

AdditionalBoundList =
AdditionalBound, AdditionalBoundList | AdditionalBound ;

AdditionalBound =
'&', InterfaceType ;

TypeArguments =
'<', ActualTypeArgumentList, '>' ;

ActualTypeArgumentList =
ActualTypeArgument | ActualTypeArgumentList, ',', ActualTypeArgument ;

ActualTypeArgument =
ReferenceType | Wildcard ;

Wildcard =
'?', [WildcardBounds] ;

WildcardBounds =
'extends', ReferenceType | 'super', ReferenceType ;

PackageName =
Identifier | PackageName, '.', Identifier ;

ExpressionName =
Identifier | AmbiguousName, '.', Identifier ;

MethodName =
Identifier | AmbiguousName, '.', Identifier ;

PackageOrTypeName =
Identifier | PackageOrTypeName, '.', Identifier ;

AmbiguousName =
Identifier | AmbiguousName, '.', Identifier ;

CompilationUnit =
[PackageDeclaration], [ImportDeclarations], [TypeDeclarations] ;

ImportDeclarations =
ImportDeclaration | ImportDeclarations, ImportDeclaration ;

TypeDeclarations =
TypeDeclaration | TypeDeclarations, TypeDeclaration ;

PackageDeclaration =
[Annotations], 'package', PackageName, ';' ;

ImportDeclaration =
SingleTypeImportDeclaration | TypeImportOnDemandDeclaration | SingleStaticImportDeclaration | StaticImportOnDemandDeclaration ;

SingleTypeImportDeclaration =
'import', TypeName, ';' ;

TypeImportOnDemandDeclaration =
'import', PackageOrTypeName, '.', '*', ';' ;

SingleStaticImportDeclaration =
'import', 'static', TypeName, '.', Identifier, ';' ;

StaticImportOnDemandDeclaration =
'import', 'static', TypeName, '.', '*', ';' ;

TypeDeclaration =
ClassDeclaration | InterfaceDeclaration | ';' ;

ClassDeclaration =
NormalClassDeclaration | EnumDeclaration ;

NormalClassDeclaration =
[ClassModifiers], 'class', Identifier, [TypeParameters], [Super], [Interfaces], ClassBody ;

ClassModifiers =
ClassModifier | ClassModifiers, ClassModifier ;

ClassModifier =
Annotation | 'public' | 'protected' | 'private' | 'abstract' | 'static' | 'final' | 'strictfp' ;

TypeParameters =
'<', TypeParameterList, '>' ;

TypeParameterList =
TypeParameterList, ',', TypeParameter | TypeParameter ;

Super =
'extends', ClassType ;

Interfaces =
'implements', InterfaceTypeList ;

InterfaceTypeList =
InterfaceType | InterfaceTypeList, ',', InterfaceType ;

ClassBody =
'{', [ClassBodyDeclarations], '}' ;

ClassBodyDeclarations =
ClassBodyDeclaration | ClassBodyDeclarations, ClassBodyDeclaration ;

ClassBodyDeclaration =
ClassMemberDeclaration | InstanceInitializer | StaticInitializer | ConstructorDeclaration ;

ClassMemberDeclaration =
FieldDeclaration | MethodDeclaration | ClassDeclaration | InterfaceDeclaration | ';' ;

FieldDeclaration =
[FieldModifiers], Type, VariableDeclarators, ';' ;

VariableDeclarators =
VariableDeclarator | VariableDeclarators, ',', VariableDeclarator ;

VariableDeclarator =
VariableDeclaratorId | VariableDeclaratorId, '=', VariableInitializer ;

VariableDeclaratorId =
Identifier | VariableDeclaratorId, '[', ']' ;

VariableInitializer =
Expression | ArrayInitializer ;

FieldModifiers =
FieldModifier | FieldModifiers, FieldModifier ;

FieldModifier =
Annotation | 'public' | 'protected' | 'private' | 'static' | 'final' | 'transient' | 'volatile' ;

MethodDeclaration =
MethodHeader, MethodBody ;

MethodHeader =
[MethodModifiers], [TypeParameters], ResultType, MethodDeclarator, [Throws] ;

ResultType =
Type | 'void' ;

MethodDeclarator =
Identifier, '(', [FormalParameterList], ')' | MethodDeclarator, '[', ']' ;

FormalParameterList =
LastFormalParameter | FormalParameters, ',', LastFormalParameter ;

FormalParameters =
FormalParameter | FormalParameters, ',', FormalParameter ;

FormalParameter =
VariableModifiers, Type, VariableDeclaratorId ;

VariableModifiers =
VariableModifier | VariableModifiers, VariableModifier ;

VariableModifier =
'final' | Annotation ;

LastFormalParameter =
VariableModifiers, Type, ['...'], VariableDeclaratorId ;

MethodModifiers =
MethodModifier | MethodModifiers, MethodModifier ;

MethodModifier =
Annotation | 'public' | 'protected' | 'private' | 'abstract' | 'static' | 'final' | 'synchronized' | 'native' | 'strictfp' ;

Throws =
'throws', ExceptionTypeList ;

ExceptionTypeList =
ExceptionType | ExceptionTypeList, ',', ExceptionType ;

ExceptionType =
ClassType | TypeVariable ;

MethodBody =
Block | ';' ;

InstanceInitializer =
Block ;

StaticInitializer =
'static', Block ;

ConstructorDeclaration =
[ConstructorModifiers], ConstructorDeclarator, [Throws], ConstructorBody ;

ConstructorDeclarator =
[TypeParameters], Identifier, '(', [FormalParameterList], ')' ;

ConstructorModifiers =
ConstructorModifier | ConstructorModifiers, ConstructorModifier ;

ConstructorModifier =
Annotation | 'public' | 'protected' | 'private' ;

ConstructorBody =
'{', [ExplicitConstructorInvocation], [BlockStatements], '}' ;

ExplicitConstructorInvocation =
[NonWildTypeArguments], 'this', '(', [ArgumentList], ')', ';' | [NonWildTypeArguments], 'super', '(', [ArgumentList], ')', ';' | Primary, '.', [NonWildTypeArguments], 'super', '(', [ArgumentList], ')', ';' ;

NonWildTypeArguments =
'<', ReferenceTypeList, '>' ;

ReferenceTypeList =
ReferenceType | ReferenceTypeList, ',', ReferenceType ;

EnumDeclaration =
[ClassModifiers], 'enum', Identifier, [Interfaces], EnumBody ;

EnumBody =
'{', [EnumConstants], [','], [EnumBodyDeclarations], '}' ;

EnumConstants =
EnumConstant | EnumConstants, ',', EnumConstant ;

EnumConstant =
Annotations, Identifier, [Arguments], [ClassBody] ;

Arguments =
'(', [ArgumentList], ')' ;

EnumBodyDeclarations =
';', [ClassBodyDeclarations] ;

InterfaceDeclaration =
NormalInterfaceDeclaration | AnnotationTypeDeclaration ;

NormalInterfaceDeclaration =
[InterfaceModifiers], 'interface', Identifier, [TypeParameters], [ExtendsInterfaces], InterfaceBody ;

InterfaceModifiers =
InterfaceModifier | InterfaceModifiers, InterfaceModifier ;

InterfaceModifier =
Annotation | 'public' | 'protected' | 'private' | 'abstract' | 'static' | 'strictfp' ;

ExtendsInterfaces =
'extends', InterfaceType | ExtendsInterfaces, ',', InterfaceType ;

InterfaceBody =
'{', [InterfaceMemberDeclarations], '}' ;

InterfaceMemberDeclarations =
InterfaceMemberDeclaration | InterfaceMemberDeclarations, InterfaceMemberDeclaration ;

InterfaceMemberDeclaration =
ConstantDeclaration | AbstractMethodDeclaration | ClassDeclaration | InterfaceDeclaration | ';' ;

ConstantDeclaration =
[ConstantModifiers], Type, VariableDeclarators, ';' ;

ConstantModifiers =
ConstantModifier | ConstantModifier, ConstantModifiers ;

ConstantModifier =
Annotation | 'public' | 'static' | 'final' ;

AbstractMethodDeclaration =
[AbstractMethodModifiers], [TypeParameters], ResultType, MethodDeclarator, [Throws], ';' ;

AbstractMethodModifiers =
AbstractMethodModifier | AbstractMethodModifiers, AbstractMethodModifier ;

AbstractMethodModifier =
Annotation, 'public', 'abstract' ;

AnnotationTypeDeclaration =
[InterfaceModifiers], '@', 'interface', Identifier, AnnotationTypeBody ;

AnnotationTypeBody =
'{', [AnnotationTypeElementDeclarations], '}' ;

AnnotationTypeElementDeclarations =
AnnotationTypeElementDeclaration | AnnotationTypeElementDeclarations, AnnotationTypeElementDeclaration ;

AnnotationTypeElementDeclaration =
[AbstractMethodModifiers], Type, Identifier, '(', ')', [DefaultValue], ';' | ConstantDeclaration | ClassDeclaration | InterfaceDeclaration | EnumDeclaration | AnnotationTypeDeclaration | ';' ;

DefaultValue =
'default', ElementValue ;

Annotations =
Annotation | Annotations, Annotation ;

Annotation =
NormalAnnotation | MarkerAnnotation | SingleElementAnnotation ;

NormalAnnotation =
'@', TypeName, '(', [ElementValuePairs], ')' ;

ElementValuePairs =
ElementValuePair | ElementValuePairs, ',', ElementValuePair ;

ElementValuePair =
Identifier, '=', ElementValue ;

ElementValue =
ConditionalExpression | Annotation | ElementValueArrayInitializer ;

ElementValueArrayInitializer =
'{', [ElementValues], [','], '}' ;

ElementValues =
ElementValue | ElementValues, ',', ElementValue ;

MarkerAnnotation =
'@', TypeName ;

SingleElementAnnotation =
'@', TypeName, '(', ElementValue, ')' ;

ArrayInitializer =
'{', [VariableInitializers], [','], '}' ;

VariableInitializers =
VariableInitializer | VariableInitializers, ',', VariableInitializer ;

Block =
'{', [BlockStatements], '}' ;

BlockStatements =
BlockStatement | BlockStatements, BlockStatement ;

BlockStatement =
LocalVariableDeclarationStatement | ClassDeclaration | Statement ;

LocalVariableDeclarationStatement =
LocalVariableDeclaration, ';' ;

LocalVariableDeclaration =
VariableModifiers, Type, VariableDeclarators ;

Statement =
StatementWithoutTrailingSubstatement | LabeledStatement | IfThenStatement | IfThenElseStatement | WhileStatement | ForStatement ;

StatementWithoutTrailingSubstatement =
Block | EmptyStatement | ExpressionStatement | AssertStatement | SwitchStatement | DoStatement | BreakStatement | ContinueStatement | ReturnStatement | SynchronizedStatement | ThrowStatement | TryStatement ;

StatementNoShortIf =
StatementWithoutTrailingSubstatement | LabeledStatementNoShortIf | IfThenElseStatementNoShortIf | WhileStatementNoShortIf | ForStatementNoShortIf ;

EmptyStatement =
';' ;

LabeledStatement =
Identifier, ':', Statement ;

LabeledStatementNoShortIf =
Identifier, ':', StatementNoShortIf ;

ExpressionStatement =
StatementExpression, ';' ;

StatementExpression =
Assignment | PreIncrementExpression | PreDecrementExpression | PostIncrementExpression | PostDecrementExpression | MethodInvocation | ClassInstanceCreationExpression ;

IfThenStatement =
'if', '(', Expression, ')', Statement ;

IfThenElseStatement =
'if', '(', Expression, ')', StatementNoShortIf, 'else', Statement ;

IfThenElseStatementNoShortIf =
'if', '(', Expression, ')', StatementNoShortIf, 'else', StatementNoShortIf ;

AssertStatement =
'assert', Expression, ';' | 'assert', Expression, ':', Expression, ';' ;

SwitchStatement =
'switch', '(', Expression, ')', SwitchBlock ;

SwitchBlock =
'{', [SwitchBlockStatementGroups], [SwitchLabels], '}' ;

SwitchBlockStatementGroups =
SwitchBlockStatementGroup | SwitchBlockStatementGroups, SwitchBlockStatementGroup ;

SwitchBlockStatementGroup =
SwitchLabels, BlockStatements ;

SwitchLabels =
SwitchLabel | SwitchLabels, SwitchLabel ;

SwitchLabel =
'case', ConstantExpression, ':' | 'case', EnumConstantName, ':' | 'default', ':' ;

EnumConstantName =
Identifier ;

WhileStatement =
'while', '(', Expression, ')', Statement ;

WhileStatementNoShortIf =
'while', '(', Expression, ')', StatementNoShortIf ;

DoStatement =
'do', Statement, 'while', '(', Expression, ')', ';' ;

ForStatement =
BasicForStatement | EnhancedForStatement ;

BasicForStatement =
'for', '(', [ForInit], ';', [Expression], ';', [ForUpdate], ')', Statement ;

ForStatementNoShortIf =
'for', '(', [ForInit], ';', [Expression], ';', [ForUpdate], ')', StatementNoShortIf ;

ForInit =
StatementExpressionList | LocalVariableDeclaration ;

ForUpdate =
StatementExpressionList ;

StatementExpressionList =
StatementExpression | StatementExpressionList, ',', StatementExpression ;

EnhancedForStatement =
'for', '(', [VariableModifiers], Type, Identifier, ':', Expression, ')', Statement ;

BreakStatement =
'break', [Identifier], ';' ;

ContinueStatement =
'continue', [Identifier], ';' ;

ReturnStatement =
'return', [Expression], ';' ;

ThrowStatement =
'throw', Expression, ';' ;

SynchronizedStatement =
'synchronized', '(', Expression, ')', Block ;

TryStatement =
'try', Block, Catches | 'try', Block, [Catches], Finally ;

Catches =
CatchClause | Catches, CatchClause ;

CatchClause =
'catch', '(', FormalParameter, ')', Block ;

Finally =
'finally', Block ;

Primary =
PrimaryNoNewArray | ArrayCreationExpression ;

PrimaryNoNewArray =
Literal | Type, '.', 'class' | 'void', '.', 'class' | 'this' | ClassName, '.', 'this' | '(', Expression, ')' | ClassInstanceCreationExpression | FieldAccess | MethodInvocation | ArrayAccess ;

ClassInstanceCreationExpression =
'new', [TypeArguments], ClassOrInterfaceType, '(', [ArgumentList], ')', [ClassBody] | Primary, '.', 'new', [TypeArguments], Identifier, [TypeArguments], '(', [ArgumentList], ')', [ClassBody] ;

ArgumentList =
Expression | ArgumentList, ',', Expression ;

ArrayCreationExpression =
'new', PrimitiveType, DimExprs, [Dims] | 'new', ClassOrInterfaceType, DimExprs, [Dims] | 'new', PrimitiveType, Dims, ArrayInitializer | 'new', ClassOrInterfaceType, Dims, ArrayInitializer ;

DimExprs =
DimExpr | DimExprs, DimExpr ;

DimExpr =
'[', Expression, ']' ;

Dims =
'[', ']' | Dims, '[', ']' ;

FieldAccess =
Primary, '.', Identifier | 'super', '.', Identifier | ClassName, '.', 'super', '.', Identifier ;

MethodInvocation =
MethodName, '(', [ArgumentList], ')' | Primary, '.', [NonWildTypeArguments], Identifier, '(', [ArgumentList], ')' | 'super', '.', [NonWildTypeArguments], Identifier, '(', [ArgumentList], ')' | ClassName, '.', 'super', '.', [NonWildTypeArguments], Identifier, '(', [ArgumentList], ')' | TypeName, '.', [NonWildTypeArguments], Identifier, '(', [ArgumentList], ')' ;

ArrayAccess =
ExpressionName, '[', Expression, ']' | PrimaryNoNewArray, '[', Expression, ']' ;

PostfixExpression =
Primary | ExpressionName | PostIncrementExpression | PostDecrementExpression ;

PostIncrementExpression =
PostfixExpression, '++' ;

PostDecrementExpression =
PostfixExpression, '--' ;

UnaryExpression =
PreIncrementExpression | PreDecrementExpression | '+', UnaryExpression | '-', UnaryExpression | UnaryExpressionNotPlusMinus ;

PreIncrementExpression =
'++', UnaryExpression ;

PreDecrementExpression =
'--', UnaryExpression ;

UnaryExpressionNotPlusMinus =
PostfixExpression | '~', UnaryExpression | '!', UnaryExpression | CastExpression ;

CastExpression =
'(', PrimitiveType, [Dims], ')', UnaryExpression | '(', ReferenceType, ')', UnaryExpressionNotPlusMinus ;

MultiplicativeExpression =
UnaryExpression | MultiplicativeExpression, '*', UnaryExpression | MultiplicativeExpression, '/', UnaryExpression | MultiplicativeExpression, '%', UnaryExpression ;

AdditiveExpression =
MultiplicativeExpression | AdditiveExpression, '+', MultiplicativeExpression | AdditiveExpression, '-', MultiplicativeExpression ;

ShiftExpression =
AdditiveExpression | ShiftExpression, '<<', AdditiveExpression | ShiftExpression, '>>', AdditiveExpression | ShiftExpression, '>>>', AdditiveExpression ;

RelationalExpression =
ShiftExpression | RelationalExpression, '<', ShiftExpression | RelationalExpression, '>', ShiftExpression | RelationalExpression, '<=', ShiftExpression | RelationalExpression, '>=', ShiftExpression | RelationalExpression, 'instanceof', ReferenceType ;

EqualityExpression =
RelationalExpression | EqualityExpression, '==', RelationalExpression | EqualityExpression, '!=', RelationalExpression ;

AndExpression =
EqualityExpression | AndExpression, '&', EqualityExpression ;

ExclusiveOrExpression =
AndExpression | ExclusiveOrExpression, '^', AndExpression ;

InclusiveOrExpression =
ExclusiveOrExpression | InclusiveOrExpression, '|', ExclusiveOrExpression ;

ConditionalAndExpression =
InclusiveOrExpression | ConditionalAndExpression, '&&', InclusiveOrExpression ;

ConditionalOrExpression =
ConditionalAndExpression | ConditionalOrExpression, '||', ConditionalAndExpression ;

ConditionalExpression =
ConditionalOrExpression | ConditionalOrExpression, '?', Expression, ':', ConditionalExpression ;

AssignmentExpression =
ConditionalExpression | Assignment ;

Assignment =
LeftHandSide, AssignmentOperator, AssignmentExpression ;

LeftHandSide =
ExpressionName | FieldAccess | ArrayAccess ;

AssignmentOperator =
'=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '>>>=' | '&=' | '^=' | '|=' ;

Expression =
AssignmentExpression ;

ConstantExpression =
Expression ;

Index

'!'
Operator
UnaryExpressionNotPlusMinus

'!='
EqualityExpression
Operator

'%'
MultiplicativeExpression
Operator

'%='
AssignmentOperator
Operator

'&'
AdditionalBound
AndExpression
Operator

'&&'
ConditionalAndExpression
Operator

'&='
AssignmentOperator
Operator

'>'
NonWildTypeArguments
Operator
RelationalExpression
TypeArguments
TypeParameters

'>>'
Operator
ShiftExpression

'>>>'
Operator
ShiftExpression

'>>>='
AssignmentOperator
Operator

'>>='
AssignmentOperator
Operator

'>='
Operator
RelationalExpression

'<'
NonWildTypeArguments
Operator
RelationalExpression
TypeArguments
TypeParameters

'<<'
Operator
ShiftExpression

'<<='
AssignmentOperator
Operator

'<='
Operator
RelationalExpression

"'"
CharacterLiteral
EscapeSequence
SingleCharacter

'('
AnnotationTypeElementDeclaration
Arguments
BasicForStatement
CastExpression
CatchClause
ClassInstanceCreationExpression
ConstructorDeclarator
DoStatement
EnhancedForStatement
ExplicitConstructorInvocation
ForStatementNoShortIf
IfThenElseStatement
IfThenElseStatementNoShortIf
IfThenStatement
MethodDeclarator
MethodInvocation
NormalAnnotation
PrimaryNoNewArray
Separator
SingleElementAnnotation
SwitchStatement
SynchronizedStatement
WhileStatement
WhileStatementNoShortIf

')'
AnnotationTypeElementDeclaration
Arguments
BasicForStatement
CastExpression
CatchClause
ClassInstanceCreationExpression
ConstructorDeclarator
DoStatement
EnhancedForStatement
ExplicitConstructorInvocation
ForStatementNoShortIf
IfThenElseStatement
IfThenElseStatementNoShortIf
IfThenStatement
MethodDeclarator
MethodInvocation
NormalAnnotation
PrimaryNoNewArray
Separator
SingleElementAnnotation
SwitchStatement
SynchronizedStatement
WhileStatement
WhileStatementNoShortIf

'"'
EscapeSequence
StringCharacter
StringLiteral

'*'
CommentTail
CommentTailStar
MultiplicativeExpression
NotStar
NotStarNotSlash
Operator
StaticImportOnDemandDeclaration
TraditionalComment
TypeImportOnDemandDeclaration

'*='
AssignmentOperator
Operator

'+'
AdditiveExpression
Operator
Sign
UnaryExpression

'++'
Operator
PostIncrementExpression
PreIncrementExpression

'+='
AssignmentOperator
Operator

','
ActualTypeArgumentList
ArgumentList
ArrayInitializer
ElementValueArrayInitializer
ElementValuePairs
ElementValues
EnumBody
EnumConstants
ExceptionTypeList
ExtendsInterfaces
FormalParameterList
FormalParameters
InterfaceTypeList
ReferenceTypeList
Separator
StatementExpressionList
TypeParameterList
VariableDeclarators
VariableInitializers

'-'
AdditiveExpression
Operator
Sign
UnaryExpression

'--'
Operator
PostDecrementExpression
PreDecrementExpression

'-='
AssignmentOperator
Operator

'.'
AmbiguousName
ClassInstanceCreationExpression
DecimalFloatingPointLiteral
ExplicitConstructorInvocation
ExpressionName
FieldAccess
HexSignificand
MethodInvocation
MethodName
PackageName
PackageOrTypeName
PrimaryNoNewArray
Separator
SingleStaticImportDeclaration
StaticImportOnDemandDeclaration
TypeDeclSpecifier
TypeImportOnDemandDeclaration
TypeName

'...'
LastFormalParameter

'/'
CommentTailStar
EndOfLineComment
MultiplicativeExpression
NotStarNotSlash
Operator
TraditionalComment

'/='
AssignmentOperator
Operator

'0'
DecimalNumeral
Digit
HexDigit
HexNumeral
OctalDigit
OctalNumeral
ZeroToThree

'0X'
HexSignificand

'0x'
HexSignificand

'1'
HexDigit
NonZeroDigit
OctalDigit
ZeroToThree

'2'
HexDigit
NonZeroDigit
OctalDigit
ZeroToThree

'3'
HexDigit
NonZeroDigit
OctalDigit
ZeroToThree

'4'
HexDigit
NonZeroDigit
OctalDigit

'5'
HexDigit
NonZeroDigit
OctalDigit

'6'
HexDigit
NonZeroDigit
OctalDigit

'7'
HexDigit
NonZeroDigit
OctalDigit

'8'
HexDigit
NonZeroDigit

'9'
HexDigit
NonZeroDigit

':'
AssertStatement
ConditionalExpression
EnhancedForStatement
LabeledStatement
LabeledStatementNoShortIf
Operator
SwitchLabel

';'
AbstractMethodDeclaration
AnnotationTypeElementDeclaration
AssertStatement
BasicForStatement
BreakStatement
ClassMemberDeclaration
ConstantDeclaration
ContinueStatement
DoStatement
EmptyStatement
EnumBodyDeclarations
ExplicitConstructorInvocation
ExpressionStatement
FieldDeclaration
ForStatementNoShortIf
InterfaceMemberDeclaration
LocalVariableDeclarationStatement
MethodBody
PackageDeclaration
ReturnStatement
Separator
SingleStaticImportDeclaration
SingleTypeImportDeclaration
StaticImportOnDemandDeclaration
ThrowStatement
TypeDeclaration
TypeImportOnDemandDeclaration

'='
AssignmentOperator
ElementValuePair
Operator
VariableDeclarator

'=='
EqualityExpression
Operator

'?'
ConditionalExpression
Operator
Wildcard

'@'
AnnotationTypeDeclaration
MarkerAnnotation
NormalAnnotation
SingleElementAnnotation

'A'
HexDigit

AbstractMethodDeclaration
AbstractMethodDeclaration
InterfaceMemberDeclaration

AbstractMethodModifier
AbstractMethodModifier
AbstractMethodModifiers

AbstractMethodModifiers
AbstractMethodDeclaration
AbstractMethodModifiers
AnnotationTypeElementDeclaration

ActualTypeArgument
ActualTypeArgument
ActualTypeArgumentList

ActualTypeArgumentList
ActualTypeArgumentList
TypeArguments

AdditionalBound
AdditionalBound
AdditionalBoundList

AdditionalBoundList
AdditionalBoundList
TypeBound

AdditiveExpression
AdditiveExpression
ShiftExpression

AmbiguousName
AmbiguousName
ExpressionName
MethodName

AndExpression
AndExpression
ExclusiveOrExpression

Annotation
AbstractMethodModifier
Annotation
Annotations
ClassModifier
ConstantModifier
ConstructorModifier
ElementValue
FieldModifier
InterfaceModifier
MethodModifier
VariableModifier

AnnotationTypeBody
AnnotationTypeBody
AnnotationTypeDeclaration

AnnotationTypeDeclaration
AnnotationTypeDeclaration
AnnotationTypeElementDeclaration
InterfaceDeclaration

AnnotationTypeElementDeclaration
AnnotationTypeElementDeclaration
AnnotationTypeElementDeclarations

AnnotationTypeElementDeclarations
AnnotationTypeBody
AnnotationTypeElementDeclarations

Annotations
Annotations
EnumConstant
PackageDeclaration

ArgumentList
ArgumentList
Arguments
ClassInstanceCreationExpression
ExplicitConstructorInvocation
MethodInvocation

Arguments
Arguments
EnumConstant

ArrayAccess
ArrayAccess
LeftHandSide
PrimaryNoNewArray

ArrayCreationExpression
ArrayCreationExpression
Primary

ArrayInitializer
ArrayCreationExpression
ArrayInitializer
VariableInitializer

ArrayType
ArrayType
ReferenceType

AssertStatement
AssertStatement
StatementWithoutTrailingSubstatement

Assignment
Assignment
AssignmentExpression
StatementExpression

AssignmentExpression
Assignment
AssignmentExpression
Expression

AssignmentOperator
Assignment
AssignmentOperator

'B'
HexDigit

BasicForStatement
BasicForStatement
ForStatement

BinaryExponent
BinaryExponent
HexadecimalFloatingPointLiteral

BinaryExponentIndicator
BinaryExponent
BinaryExponentIndicator

Block
Block
CatchClause
Finally
InstanceInitializer
MethodBody
StatementWithoutTrailingSubstatement
StaticInitializer
SynchronizedStatement
TryStatement

BlockStatement
BlockStatement
BlockStatements

BlockStatements
Block
BlockStatements
ConstructorBody
SwitchBlockStatementGroup

BooleanLiteral
BooleanLiteral
Identifier
Literal

BreakStatement
BreakStatement
StatementWithoutTrailingSubstatement

'C'
HexDigit

? CR ?
InputCharacter

CastExpression
CastExpression
UnaryExpressionNotPlusMinus

CatchClause
CatchClause
Catches

Catches
Catches
TryStatement

CharacterLiteral
CharacterLiteral
Literal

CharactersInLine
CharactersInLine
EndOfLineComment

ClassBody
ClassBody
ClassInstanceCreationExpression
EnumConstant
NormalClassDeclaration

ClassBodyDeclaration
ClassBodyDeclaration
ClassBodyDeclarations

ClassBodyDeclarations
ClassBody
ClassBodyDeclarations
EnumBodyDeclarations

ClassDeclaration
AnnotationTypeElementDeclaration
BlockStatement
ClassDeclaration
ClassMemberDeclaration
InterfaceMemberDeclaration
TypeDeclaration

ClassInstanceCreationExpression
ClassInstanceCreationExpression
PrimaryNoNewArray
StatementExpression

ClassMemberDeclaration
ClassBodyDeclaration
ClassMemberDeclaration

ClassModifier
ClassModifier
ClassModifiers

ClassModifiers
ClassModifiers
EnumDeclaration
NormalClassDeclaration

ClassName
FieldAccess
MethodInvocation
PrimaryNoNewArray

ClassOrInterfaceType
ArrayCreationExpression
ClassInstanceCreationExpression
ClassOrInterfaceType
ReferenceType
TypeBound
TypeDeclSpecifier

ClassType
ClassOrInterfaceType
ClassType
ExceptionType
Super

Comment
Comment
InputElement

CommentTail
CommentTail
CommentTailStar
TraditionalComment

CommentTailStar
CommentTail
CommentTailStar

CompilationUnit
CompilationUnit

ConditionalAndExpression
ConditionalAndExpression
ConditionalOrExpression

ConditionalExpression
AssignmentExpression
ConditionalExpression
ElementValue

ConditionalOrExpression
ConditionalExpression
ConditionalOrExpression

ConstantDeclaration
AnnotationTypeElementDeclaration
ConstantDeclaration
InterfaceMemberDeclaration

ConstantExpression
ConstantExpression
SwitchLabel

ConstantModifier
ConstantModifier
ConstantModifiers

ConstantModifiers
ConstantDeclaration
ConstantModifiers

ConstructorBody
ConstructorBody
ConstructorDeclaration

ConstructorDeclaration
ClassBodyDeclaration
ConstructorDeclaration

ConstructorDeclarator
ConstructorDeclaration
ConstructorDeclarator

ConstructorModifier
ConstructorModifier
ConstructorModifiers

ConstructorModifiers
ConstructorDeclaration
ConstructorModifiers

ContinueStatement
ContinueStatement
StatementWithoutTrailingSubstatement

'D'
FloatTypeSuffix
HexDigit

DecimalFloatingPointLiteral
DecimalFloatingPointLiteral
FloatingPointLiteral

DecimalIntegerLiteral
DecimalIntegerLiteral
IntegerLiteral

DecimalNumeral
DecimalIntegerLiteral
DecimalNumeral

DefaultValue
AnnotationTypeElementDeclaration
DefaultValue

Digit
Digit
Digits

Digits
DecimalFloatingPointLiteral
DecimalNumeral
Digits
SignedInteger

DimExpr
DimExpr
DimExprs

DimExprs
ArrayCreationExpression
DimExprs

Dims
ArrayCreationExpression
CastExpression
Dims

DoStatement
DoStatement
StatementWithoutTrailingSubstatement

'E'
ExponentIndicator
HexDigit

ElementValue
DefaultValue
ElementValue
ElementValuePair
ElementValues
SingleElementAnnotation

ElementValueArrayInitializer
ElementValue
ElementValueArrayInitializer

ElementValuePair
ElementValuePair
ElementValuePairs

ElementValuePairs
ElementValuePairs
NormalAnnotation

ElementValues
ElementValueArrayInitializer
ElementValues

EmptyStatement
EmptyStatement
StatementWithoutTrailingSubstatement

EndOfLineComment
Comment
EndOfLineComment

EnhancedForStatement
EnhancedForStatement
ForStatement

EnumBody
EnumBody
EnumDeclaration

EnumBodyDeclarations
EnumBody
EnumBodyDeclarations

EnumConstant
EnumConstant
EnumConstants

EnumConstantName
EnumConstantName
SwitchLabel

EnumConstants
EnumBody
EnumConstants

EnumDeclaration
AnnotationTypeElementDeclaration
ClassDeclaration
EnumDeclaration

EqualityExpression
AndExpression
EqualityExpression

EscapeSequence
CharacterLiteral
EscapeSequence
StringCharacter

ExceptionType
ExceptionType
ExceptionTypeList

ExceptionTypeList
ExceptionTypeList
Throws

ExclusiveOrExpression
ExclusiveOrExpression
InclusiveOrExpression

ExplicitConstructorInvocation
ConstructorBody
ExplicitConstructorInvocation

ExponentIndicator
ExponentIndicator
ExponentPart

ExponentPart
DecimalFloatingPointLiteral
ExponentPart

Expression
ArgumentList
ArrayAccess
AssertStatement
BasicForStatement
ConditionalExpression
ConstantExpression
DimExpr
DoStatement
EnhancedForStatement
Expression
ForStatementNoShortIf
IfThenElseStatement
IfThenElseStatementNoShortIf
IfThenStatement
PrimaryNoNewArray
ReturnStatement
SwitchStatement
SynchronizedStatement
ThrowStatement
VariableInitializer
WhileStatement
WhileStatementNoShortIf

ExpressionName
ArrayAccess
ExpressionName
LeftHandSide
PostfixExpression

ExpressionStatement
ExpressionStatement
StatementWithoutTrailingSubstatement

ExtendsInterfaces
ExtendsInterfaces
NormalInterfaceDeclaration

'F'
FloatTypeSuffix
HexDigit

FieldAccess
FieldAccess
LeftHandSide
PrimaryNoNewArray

FieldDeclaration
ClassMemberDeclaration
FieldDeclaration

FieldModifier
FieldModifier
FieldModifiers

FieldModifiers
FieldDeclaration
FieldModifiers

Finally
Finally
TryStatement

FloatTypeSuffix
DecimalFloatingPointLiteral
FloatTypeSuffix
HexadecimalFloatingPointLiteral

FloatingPointLiteral
FloatingPointLiteral
Literal

FloatingPointType
FloatingPointType
NumericType

ForInit
BasicForStatement
ForInit
ForStatementNoShortIf

ForStatement
ForStatement
Statement

ForStatementNoShortIf
ForStatementNoShortIf
StatementNoShortIf

ForUpdate
BasicForStatement
ForStatementNoShortIf
ForUpdate

FormalParameter
CatchClause
FormalParameter
FormalParameters

FormalParameterList
ConstructorDeclarator
FormalParameterList
MethodDeclarator

FormalParameters
FormalParameterList
FormalParameters

HexDigit
HexDigit
HexDigits
UnicodeEscape

HexDigits
HexDigits
HexNumeral
HexSignificand

HexIntegerLiteral
HexIntegerLiteral
IntegerLiteral

HexNumeral
HexIntegerLiteral
HexNumeral
HexSignificand

HexSignificand
HexSignificand
HexadecimalFloatingPointLiteral

HexadecimalFloatingPointLiteral
FloatingPointLiteral
HexadecimalFloatingPointLiteral

Identifier
AmbiguousName
AnnotationTypeDeclaration
AnnotationTypeElementDeclaration
BreakStatement
ClassInstanceCreationExpression
ConstructorDeclarator
ContinueStatement
ElementValuePair
EnhancedForStatement
EnumConstant
EnumConstantName
EnumDeclaration
ExpressionName
FieldAccess
Identifier
LabeledStatement
LabeledStatementNoShortIf
MethodDeclarator
MethodInvocation
MethodName
NormalClassDeclaration
NormalInterfaceDeclaration
PackageName
PackageOrTypeName
SingleStaticImportDeclaration
Token
TypeDeclSpecifier
TypeName
TypeVariable
VariableDeclaratorId

IdentifierChars
Identifier
IdentifierChars

IfThenElseStatement
IfThenElseStatement
Statement

IfThenElseStatementNoShortIf
IfThenElseStatementNoShortIf
StatementNoShortIf

IfThenStatement
IfThenStatement
Statement

ImportDeclaration
ImportDeclaration
ImportDeclarations

ImportDeclarations
CompilationUnit
ImportDeclarations

InclusiveOrExpression
ConditionalAndExpression
InclusiveOrExpression

Input
Input

InputCharacter
CharactersInLine
InputCharacter
NotStar
NotStarNotSlash
SingleCharacter
StringCharacter

InputElement
InputElement
InputElements

InputElements
Input
InputElements

InstanceInitializer
ClassBodyDeclaration
InstanceInitializer

IntegerLiteral
IntegerLiteral
Literal

IntegerTypeSuffix
DecimalIntegerLiteral
HexIntegerLiteral
IntegerTypeSuffix
OctalIntegerLiteral

IntegralType
IntegralType
NumericType

InterfaceBody
InterfaceBody
NormalInterfaceDeclaration

InterfaceDeclaration
AnnotationTypeElementDeclaration
ClassMemberDeclaration
InterfaceDeclaration
InterfaceMemberDeclaration
TypeDeclaration

InterfaceMemberDeclaration
InterfaceMemberDeclaration
InterfaceMemberDeclarations

InterfaceMemberDeclarations
InterfaceBody
InterfaceMemberDeclarations

InterfaceModifier
InterfaceModifier
InterfaceModifiers

InterfaceModifiers
AnnotationTypeDeclaration
InterfaceModifiers
NormalInterfaceDeclaration

InterfaceType
AdditionalBound
ClassOrInterfaceType
ExtendsInterfaces
InterfaceType
InterfaceTypeList

InterfaceTypeList
InterfaceTypeList
Interfaces

Interfaces
EnumDeclaration
Interfaces
NormalClassDeclaration

JavaLetter
IdentifierChars
JavaLetter

JavaLetterOrDigit
IdentifierChars
JavaLetterOrDigit

Keyword
Identifier
Keyword
Token

'L'
IntegerTypeSuffix

? LF ?
InputCharacter

LabeledStatement
LabeledStatement
Statement

LabeledStatementNoShortIf
LabeledStatementNoShortIf
StatementNoShortIf

LastFormalParameter
FormalParameterList
LastFormalParameter

LeftHandSide
Assignment
LeftHandSide

LineTerminator
LineTerminator
NotStar
NotStarNotSlash
WhiteSpace

Literal
Literal
PrimaryNoNewArray
Token

LocalVariableDeclaration
ForInit
LocalVariableDeclaration
LocalVariableDeclarationStatement

LocalVariableDeclarationStatement
BlockStatement
LocalVariableDeclarationStatement

MarkerAnnotation
Annotation
MarkerAnnotation

MethodBody
MethodBody
MethodDeclaration

MethodDeclaration
ClassMemberDeclaration
MethodDeclaration

MethodDeclarator
AbstractMethodDeclaration
MethodDeclarator
MethodHeader

MethodHeader
MethodDeclaration
MethodHeader

MethodInvocation
MethodInvocation
PrimaryNoNewArray
StatementExpression

MethodModifier
MethodModifier
MethodModifiers

MethodModifiers
MethodHeader
MethodModifiers

MethodName
MethodInvocation
MethodName

MultiplicativeExpression
AdditiveExpression
MultiplicativeExpression

NonWildTypeArguments
ExplicitConstructorInvocation
MethodInvocation
NonWildTypeArguments

NonZeroDigit
DecimalNumeral
Digit
NonZeroDigit

NormalAnnotation
Annotation
NormalAnnotation

NormalClassDeclaration
ClassDeclaration
NormalClassDeclaration

NormalInterfaceDeclaration
InterfaceDeclaration
NormalInterfaceDeclaration

NotStar
CommentTail
NotStar

NotStarNotSlash
CommentTailStar
NotStarNotSlash

NullLiteral
Identifier
Literal
NullLiteral

NumericType
NumericType
PrimitiveType

OctalDigit
OctalDigit
OctalDigits
OctalEscape

OctalDigits
OctalDigits
OctalNumeral

OctalEscape
EscapeSequence
OctalEscape

OctalIntegerLiteral
IntegerLiteral
OctalIntegerLiteral

OctalNumeral
OctalIntegerLiteral
OctalNumeral

Operator
Operator
Token

'P'
BinaryExponentIndicator

PackageDeclaration
CompilationUnit
PackageDeclaration

PackageName
PackageDeclaration
PackageName

PackageOrTypeName
PackageOrTypeName
TypeImportOnDemandDeclaration
TypeName

PostDecrementExpression
PostDecrementExpression
PostfixExpression
StatementExpression

PostIncrementExpression
PostIncrementExpression
PostfixExpression
StatementExpression

PostfixExpression
PostDecrementExpression
PostIncrementExpression
PostfixExpression
UnaryExpressionNotPlusMinus

PreDecrementExpression
PreDecrementExpression
StatementExpression
UnaryExpression

PreIncrementExpression
PreIncrementExpression
StatementExpression
UnaryExpression

Primary
ClassInstanceCreationExpression
ExplicitConstructorInvocation
FieldAccess
MethodInvocation
PostfixExpression
Primary

PrimaryNoNewArray
ArrayAccess
Primary
PrimaryNoNewArray

PrimitiveType
ArrayCreationExpression
CastExpression
PrimitiveType
Type

RawInputCharacter
RawInputCharacter
UnicodeInputCharacter

ReferenceType
ActualTypeArgument
CastExpression
ReferenceType
ReferenceTypeList
RelationalExpression
Type
WildcardBounds

ReferenceTypeList
NonWildTypeArguments
ReferenceTypeList

RelationalExpression
EqualityExpression
RelationalExpression

ResultType
AbstractMethodDeclaration
MethodHeader
ResultType

ReturnStatement
ReturnStatement
StatementWithoutTrailingSubstatement

Separator
Separator
Token

ShiftExpression
RelationalExpression
ShiftExpression

Sign
Sign
SignedInteger

SignedInteger
BinaryExponent
ExponentPart
SignedInteger

SingleCharacter
CharacterLiteral
SingleCharacter

SingleElementAnnotation
Annotation
SingleElementAnnotation

SingleStaticImportDeclaration
ImportDeclaration
SingleStaticImportDeclaration

SingleTypeImportDeclaration
ImportDeclaration
SingleTypeImportDeclaration

Statement
BasicForStatement
BlockStatement
DoStatement
EnhancedForStatement
IfThenElseStatement
IfThenStatement
LabeledStatement
Statement
WhileStatement

StatementExpression
ExpressionStatement
StatementExpression
StatementExpressionList

StatementExpressionList
ForInit
ForUpdate
StatementExpressionList

StatementNoShortIf
ForStatementNoShortIf
IfThenElseStatement
IfThenElseStatementNoShortIf
LabeledStatementNoShortIf
StatementNoShortIf
WhileStatementNoShortIf

StatementWithoutTrailingSubstatement
Statement
StatementNoShortIf
StatementWithoutTrailingSubstatement

StaticImportOnDemandDeclaration
ImportDeclaration
StaticImportOnDemandDeclaration

StaticInitializer
ClassBodyDeclaration
StaticInitializer

StringCharacter
StringCharacter
StringCharacters

StringCharacters
StringCharacters
StringLiteral

StringLiteral
Literal
StringLiteral

Sub
Input
Sub

Super
NormalClassDeclaration
Super

SwitchBlock
SwitchBlock
SwitchStatement

SwitchBlockStatementGroup
SwitchBlockStatementGroup
SwitchBlockStatementGroups

SwitchBlockStatementGroups
SwitchBlock
SwitchBlockStatementGroups

SwitchLabel
SwitchLabel
SwitchLabels

SwitchLabels
SwitchBlock
SwitchBlockStatementGroup
SwitchLabels

SwitchStatement
StatementWithoutTrailingSubstatement
SwitchStatement

SynchronizedStatement
StatementWithoutTrailingSubstatement
SynchronizedStatement

ThrowStatement
StatementWithoutTrailingSubstatement
ThrowStatement

Throws
AbstractMethodDeclaration
ConstructorDeclaration
MethodHeader
Throws

Token
InputElement
Token

TraditionalComment
Comment
TraditionalComment

TryStatement
StatementWithoutTrailingSubstatement
TryStatement

Type
AnnotationTypeElementDeclaration
ArrayType
ConstantDeclaration
EnhancedForStatement
FieldDeclaration
FormalParameter
LastFormalParameter
LocalVariableDeclaration
PrimaryNoNewArray
ResultType
Type

TypeArguments
ClassInstanceCreationExpression
ClassType
InterfaceType
TypeArguments

TypeBound
TypeBound
TypeParameter

TypeDeclSpecifier
ClassType
InterfaceType
TypeDeclSpecifier

TypeDeclaration
TypeDeclaration
TypeDeclarations

TypeDeclarations
CompilationUnit
TypeDeclarations

TypeImportOnDemandDeclaration
ImportDeclaration
TypeImportOnDemandDeclaration

TypeName
MarkerAnnotation
MethodInvocation
NormalAnnotation
SingleElementAnnotation
SingleStaticImportDeclaration
SingleTypeImportDeclaration
StaticImportOnDemandDeclaration
TypeDeclSpecifier
TypeName

TypeParameter
TypeParameter
TypeParameterList

TypeParameterList
TypeParameterList
TypeParameters

TypeParameters
AbstractMethodDeclaration
ConstructorDeclarator
MethodHeader
NormalClassDeclaration
NormalInterfaceDeclaration
TypeParameters

TypeVariable
ExceptionType
ReferenceType
TypeParameter
TypeVariable

UnaryExpression
CastExpression
MultiplicativeExpression
PreDecrementExpression
PreIncrementExpression
UnaryExpression
UnaryExpressionNotPlusMinus

UnaryExpressionNotPlusMinus
CastExpression
UnaryExpression
UnaryExpressionNotPlusMinus

UnicodeEscape
UnicodeEscape
UnicodeInputCharacter

UnicodeInputCharacter
InputCharacter
UnicodeInputCharacter

UnicodeMarker
UnicodeEscape
UnicodeMarker

VariableDeclarator
VariableDeclarator
VariableDeclarators

VariableDeclaratorId
FormalParameter
LastFormalParameter
VariableDeclarator
VariableDeclaratorId

VariableDeclarators
ConstantDeclaration
FieldDeclaration
LocalVariableDeclaration
VariableDeclarators

VariableInitializer
VariableDeclarator
VariableInitializer
VariableInitializers

VariableInitializers
ArrayInitializer
VariableInitializers

VariableModifier
VariableModifier
VariableModifiers

VariableModifiers
EnhancedForStatement
FormalParameter
LastFormalParameter
LocalVariableDeclaration
VariableModifiers

WhileStatement
Statement
WhileStatement

WhileStatementNoShortIf
StatementNoShortIf
WhileStatementNoShortIf

WhiteSpace
InputElement
WhiteSpace

Wildcard
ActualTypeArgument
Wildcard

WildcardBounds
Wildcard
WildcardBounds

'X'
HexNumeral

ZeroToThree
OctalEscape
ZeroToThree

'['
ArrayAccess
ArrayType
DimExpr
Dims
MethodDeclarator
Separator
VariableDeclaratorId

'\'
EscapeSequence
OctalEscape
SingleCharacter
StringCharacter
UnicodeEscape

']'
ArrayAccess
ArrayType
DimExpr
Dims
MethodDeclarator
Separator
VariableDeclaratorId

'^'
ExclusiveOrExpression
Operator

'^='
AssignmentOperator
Operator

'a'
HexDigit

'abstract'
AbstractMethodModifier
ClassModifier
InterfaceModifier
Keyword
MethodModifier

? any Unicode character that is a Java letter ?
JavaLetter

? any Unicode character that is a Java letter-or-digit ?
JavaLetterOrDigit

? any Unicode character ?
RawInputCharacter

'assert'
AssertStatement
Keyword

'b'
EscapeSequence
HexDigit

'boolean'
Keyword
PrimitiveType

'break'
BreakStatement
Keyword

'byte'
IntegralType
Keyword

'c'
HexDigit

'case'
Keyword
SwitchLabel

'catch'
CatchClause
Keyword

'char'
IntegralType
Keyword

'class'
Keyword
NormalClassDeclaration
PrimaryNoNewArray

'const'
Keyword

'continue'
ContinueStatement
Keyword

'd'
FloatTypeSuffix
HexDigit

'default'
DefaultValue
Keyword
SwitchLabel

'do'
DoStatement
Keyword

'double'
FloatingPointType
Keyword

'e'
ExponentIndicator
HexDigit

'else'
IfThenElseStatement
IfThenElseStatementNoShortIf
Keyword

'enum'
EnumDeclaration
Keyword

'extends'
ExtendsInterfaces
Keyword
Super
TypeBound
WildcardBounds

'f'
EscapeSequence
FloatTypeSuffix
HexDigit

'false'
BooleanLiteral

'final'
ClassModifier
ConstantModifier
FieldModifier
Keyword
MethodModifier
VariableModifier

'finally'
Finally
Keyword

'float'
FloatingPointType
Keyword

'for'
BasicForStatement
EnhancedForStatement
ForStatementNoShortIf
Keyword

'goto'
Keyword

'if'
IfThenElseStatement
IfThenElseStatementNoShortIf
IfThenStatement
Keyword

'implements'
Interfaces
Keyword

'import'
Keyword
SingleStaticImportDeclaration
SingleTypeImportDeclaration
StaticImportOnDemandDeclaration
TypeImportOnDemandDeclaration

'instanceof'
Keyword
RelationalExpression

'int'
IntegralType
Keyword

'interface'
AnnotationTypeDeclaration
Keyword
NormalInterfaceDeclaration

'l'
IntegerTypeSuffix

'long'
IntegralType
Keyword

'n'
EscapeSequence

'native'
Keyword
MethodModifier

'new'
ArrayCreationExpression
ClassInstanceCreationExpression
Keyword

'null'
NullLiteral

'p'
BinaryExponentIndicator

'package'
Keyword
PackageDeclaration

'private'
ClassModifier
ConstructorModifier
FieldModifier
InterfaceModifier
Keyword
MethodModifier

'protected'
ClassModifier
ConstructorModifier
FieldModifier
InterfaceModifier
Keyword
MethodModifier

'public'
AbstractMethodModifier
ClassModifier
ConstantModifier
ConstructorModifier
FieldModifier
InterfaceModifier
Keyword
MethodModifier

'r'
EscapeSequence

'return'
Keyword
ReturnStatement

'short'
IntegralType
Keyword

'static'
ClassModifier
ConstantModifier
FieldModifier
InterfaceModifier
Keyword
MethodModifier
SingleStaticImportDeclaration
StaticImportOnDemandDeclaration
StaticInitializer

'strictfp'
ClassModifier
InterfaceModifier
Keyword
MethodModifier

'super'
ExplicitConstructorInvocation
FieldAccess
Keyword
MethodInvocation
WildcardBounds

'switch'
Keyword
SwitchStatement

'synchronized'
Keyword
MethodModifier
SynchronizedStatement

't'
EscapeSequence

? the ASCII CR character followed by the ASCII LF character ?
LineTerminator

? the ASCII CR character, also known as "return" ?
LineTerminator

? the ASCII FF character, also known as "form feed" ?
WhiteSpace

? the ASCII HT character, also known as "horizontal tab" ?
WhiteSpace

? the ASCII LF character, also known as "newline" ?
LineTerminator

? the ASCII SP character, also known as "space" ?
WhiteSpace

? the ASCII SUB character, also known as "control-Z" ?
Sub

'this'
ExplicitConstructorInvocation
Keyword
PrimaryNoNewArray

'throw'
Keyword
ThrowStatement

'throws'
Keyword
Throws

'transient'
FieldModifier
Keyword

'true'
BooleanLiteral

'try'
Keyword
TryStatement

'u'
UnicodeMarker

'void'
Keyword
PrimaryNoNewArray
ResultType

'volatile'
FieldModifier
Keyword

'while'
DoStatement
Keyword
WhileStatement
WhileStatementNoShortIf

'x'
HexNumeral

'{'
AnnotationTypeBody
ArrayInitializer
Block
ClassBody
ConstructorBody
ElementValueArrayInitializer
EnumBody
InterfaceBody
Separator
SwitchBlock

'|'
InclusiveOrExpression
Operator

'|='
AssignmentOperator
Operator

'||'
ConditionalOrExpression
Operator

'}'
AnnotationTypeBody
ArrayInitializer
Block
ClassBody
ConstructorBody
ElementValueArrayInitializer
EnumBody
InterfaceBody
Separator
SwitchBlock

'~'
Operator
UnaryExpressionNotPlusMinus

References

No comments: