Browsable Java (J2SE 5.0 “Tiger”) Grammar

CC-BY

Grammar connected by Vadim Zaytsev, see the Grammar Zoo entry for details: java/java-5/jls/read/connected
Source used for this grammar: James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Java Language Specification, 3rd edition, 2004 [HTML] [PDF]

Summary

Syntax

ClassBodyDeclarations ::=
	ClassBodyDeclaration
ClassBodyDeclarations ::=
	ClassBodyDeclarations ClassBodyDeclaration
NormalClassDeclaration ::=
	ClassModifiers? "class" Identifier TypeParameters? Super? Interfaces? ClassBody
PostDecrementExpression ::=
	PostfixExpression "--"
ReferenceTypeList ::=
	ReferenceType
ReferenceTypeList ::=
	ReferenceTypeList "," ReferenceType
PrimitiveType ::=
	NumericType
PrimitiveType ::=
	"boolean"
InterfaceTypeList ::=
	InterfaceType
InterfaceTypeList ::=
	InterfaceTypeList "," InterfaceType
Statement ::=
	StatementWithoutTrailingSubstatement
Statement ::=
	LabeledStatement
Statement ::=
	IfThenStatement
Statement ::=
	IfThenElseStatement
Statement ::=
	WhileStatement
Statement ::=
	ForStatement
AndExpression ::=
	EqualityExpression
AndExpression ::=
	AndExpression "&" EqualityExpression
Annotations ::=
	Annotation
Annotations ::=
	Annotations Annotation
ConstructorBody ::=
	"{" ExplicitConstructorInvocation? BlockStatements? "}"
TypeParameter ::=
	TypeVariable TypeBound?
ArgumentList ::=
	Expression
ArgumentList ::=
	ArgumentList "," Expression
MethodName ::=
	Identifier
MethodName ::=
	AmbiguousName "." Identifier
ClassMemberDeclaration ::=
	FieldDeclaration
ClassMemberDeclaration ::=
	MethodDeclaration
ClassMemberDeclaration ::=
	ClassDeclaration
ClassMemberDeclaration ::=
	InterfaceDeclaration
ClassMemberDeclaration ::=
	";"
Assignment ::=
	LeftHandSide AssignmentOperator AssignmentExpression
Interfaces ::=
	"implements" InterfaceTypeList
CatchClause ::=
	"catch" "(" FormalParameter ")" Block
AbstractMethodModifiers ::=
	AbstractMethodModifier
AbstractMethodModifiers ::=
	AbstractMethodModifiers AbstractMethodModifier
ClassInstanceCreationExpression ::=
	"new" TypeArguments? ClassOrInterfaceType "(" ArgumentList? ")" ClassBody?
ClassInstanceCreationExpression ::=
	Primary "." "new" TypeArguments? Identifier TypeArguments? "(" ArgumentList? ")" ClassBody?
TypeName ::=
	Identifier
TypeName ::=
	PackageOrTypeName "." Identifier
InterfaceType ::=
	TypeDeclSpecifier TypeArguments?
BlockStatement ::=
	LocalVariableDeclarationStatement
BlockStatement ::=
	ClassDeclaration
BlockStatement ::=
	Statement
IfThenStatement ::=
	"if" "(" Expression ")" Statement
Annotation ::=
	NormalAnnotation
Annotation ::=
	MarkerAnnotation
Annotation ::=
	SingleElementAnnotation
SwitchBlockStatementGroups ::=
	SwitchBlockStatementGroup
SwitchBlockStatementGroups ::=
	SwitchBlockStatementGroups SwitchBlockStatementGroup
EnumConstant ::=
	Annotations Identifier Arguments? ClassBody?
ClassModifier ::=
	Annotation
ClassModifier ::=
	"public"
ClassModifier ::=
	"protected"
ClassModifier ::=
	"private"
ClassModifier ::=
	"abstract"
ClassModifier ::=
	"static"
ClassModifier ::=
	"final"
ClassModifier ::=
	"strictfp"
EnumBodyDeclarations ::=
	";" ClassBodyDeclarations?
SingleTypeImportDeclaration ::=
	"import" TypeName ";"
AnnotationTypeDeclaration ::=
	InterfaceModifiers? "@" "interface" Identifier AnnotationTypeBody
ConstantDeclaration ::=
	ConstantModifiers? Type VariableDeclarators ";"
PreIncrementExpression ::=
	"++" UnaryExpression
ExplicitConstructorInvocation ::=
	NonWildTypeArguments? "this" "(" ArgumentList? ")" ";"
ExplicitConstructorInvocation ::=
	NonWildTypeArguments? "super" "(" ArgumentList? ")" ";"
ExplicitConstructorInvocation ::=
	Primary "." NonWildTypeArguments? "super" "(" ArgumentList? ")" ";"
ActualTypeArgumentList ::=
	ActualTypeArgument
ActualTypeArgumentList ::=
	ActualTypeArgumentList "," ActualTypeArgument
VariableInitializers ::=
	VariableInitializer
VariableInitializers ::=
	VariableInitializers "," VariableInitializer
DimExpr ::=
	"[" Expression "]"
Throws ::=
	"throws" ExceptionTypeList
BlockStatements ::=
	BlockStatement
BlockStatements ::=
	BlockStatements BlockStatement
InterfaceModifiers ::=
	InterfaceModifier
InterfaceModifiers ::=
	InterfaceModifiers InterfaceModifier
PrimaryNoNewArray ::=
	Literal
PrimaryNoNewArray ::=
	Type "." "class"
PrimaryNoNewArray ::=
	"void" "." "class"
PrimaryNoNewArray ::=
	"this"
PrimaryNoNewArray ::=
	ClassName "." "this"
PrimaryNoNewArray ::=
	"(" Expression ")"
PrimaryNoNewArray ::=
	ClassInstanceCreationExpression
PrimaryNoNewArray ::=
	FieldAccess
PrimaryNoNewArray ::=
	MethodInvocation
PrimaryNoNewArray ::=
	ArrayAccess
AssignmentOperator ::=
	"="
AssignmentOperator ::=
	"*="
AssignmentOperator ::=
	"/="
AssignmentOperator ::=
	"%="
AssignmentOperator ::=
	"+="
AssignmentOperator ::=
	"-="
AssignmentOperator ::=
	"<<="
AssignmentOperator ::=
	">>="
AssignmentOperator ::=
	">>>="
AssignmentOperator ::=
	"&="
AssignmentOperator ::=
	"^="
AssignmentOperator ::=
	"|="
AnnotationTypeElementDeclarations ::=
	AnnotationTypeElementDeclaration
AnnotationTypeElementDeclarations ::=
	AnnotationTypeElementDeclarations AnnotationTypeElementDeclaration
StatementWithoutTrailingSubstatement ::=
	Block
StatementWithoutTrailingSubstatement ::=
	EmptyStatement
StatementWithoutTrailingSubstatement ::=
	ExpressionStatement
StatementWithoutTrailingSubstatement ::=
	AssertStatement
StatementWithoutTrailingSubstatement ::=
	SwitchStatement
StatementWithoutTrailingSubstatement ::=
	DoStatement
StatementWithoutTrailingSubstatement ::=
	BreakStatement
StatementWithoutTrailingSubstatement ::=
	ContinueStatement
StatementWithoutTrailingSubstatement ::=
	ReturnStatement
StatementWithoutTrailingSubstatement ::=
	SynchronizedStatement
StatementWithoutTrailingSubstatement ::=
	ThrowStatement
StatementWithoutTrailingSubstatement ::=
	TryStatement
AdditionalBound ::=
	"&" InterfaceType
FieldDeclaration ::=
	FieldModifiers? Type VariableDeclarators ";"
TypeBound ::=
	"extends" ClassOrInterfaceType AdditionalBoundList?
AdditionalBoundList ::=
	AdditionalBound AdditionalBoundList
AdditionalBoundList ::=
	AdditionalBound
VariableDeclarator ::=
	VariableDeclaratorId
VariableDeclarator ::=
	VariableDeclaratorId "=" VariableInitializer
PostfixExpression ::=
	Primary
PostfixExpression ::=
	ExpressionName
PostfixExpression ::=
	PostIncrementExpression
PostfixExpression ::=
	PostDecrementExpression
SwitchLabel ::=
	"case" ConstantExpression ":"
SwitchLabel ::=
	"case" EnumConstantName ":"
SwitchLabel ::=
	"default" ":"
ConstantModifier ::=
	Annotation
ConstantModifier ::=
	"public"
ConstantModifier ::=
	"static"
ConstantModifier ::=
	"final"
FormalParameter ::=
	VariableModifiers? Type VariableDeclaratorId
PackageName ::=
	Identifier
PackageName ::=
	PackageName "." Identifier
VariableModifiers ::=
	VariableModifier
VariableModifiers ::=
	VariableModifiers VariableModifier
ConditionalAndExpression ::=
	InclusiveOrExpression
ConditionalAndExpression ::=
	ConditionalAndExpression "&&" InclusiveOrExpression
MethodModifiers ::=
	MethodModifier
MethodModifiers ::=
	MethodModifiers MethodModifier
Type ::=
	PrimitiveType
Type ::=
	ReferenceType
EqualityExpression ::=
	RelationalExpression
EqualityExpression ::=
	EqualityExpression "==" RelationalExpression
EqualityExpression ::=
	EqualityExpression "!=" RelationalExpression
InterfaceMemberDeclaration ::=
	ConstantDeclaration
InterfaceMemberDeclaration ::=
	AbstractMethodDeclaration
InterfaceMemberDeclaration ::=
	ClassDeclaration
InterfaceMemberDeclaration ::=
	InterfaceDeclaration
InterfaceMemberDeclaration ::=
	";"
MultiplicativeExpression ::=
	UnaryExpression
MultiplicativeExpression ::=
	MultiplicativeExpression "*" UnaryExpression
MultiplicativeExpression ::=
	MultiplicativeExpression "/" UnaryExpression
MultiplicativeExpression ::=
	MultiplicativeExpression "%" UnaryExpression
ActualTypeArgument ::=
	ReferenceType
ActualTypeArgument ::=
	Wildcard
ExceptionType ::=
	ClassType
ExceptionType ::=
	TypeVariable
BreakStatement ::=
	"break" Identifier? ";"
ConstructorModifier ::=
	Annotation
ConstructorModifier ::=
	"public"
ConstructorModifier ::=
	"protected"
ConstructorModifier ::=
	"private"
ElementValuePairs ::=
	ElementValuePair
ElementValuePairs ::=
	ElementValuePairs "," ElementValuePair
SynchronizedStatement ::=
	"synchronized" "(" Expression ")" Block
Literal ::=
	IntegerLiteral
Literal ::=
	FloatingPointLiteral
Literal ::=
	BooleanLiteral
Literal ::=
	CharacterLiteral
Literal ::=
	StringLiteral
Literal ::=
	NullLiteral
ElementValue ::=
	ConditionalExpression
ElementValue ::=
	Annotation
ElementValue ::=
	ElementValueArrayInitializer
Super ::=
	"extends" ClassType
ArrayCreationExpression ::=
	"new" PrimitiveType DimExprs Dims?
ArrayCreationExpression ::=
	"new" ClassOrInterfaceType DimExprs Dims?
ArrayCreationExpression ::=
	"new" PrimitiveType Dims ArrayInitializer
ArrayCreationExpression ::=
	"new" ClassOrInterfaceType Dims ArrayInitializer
ArrayInitializer ::=
	"{" VariableInitializers? ","? "}"
InterfaceModifier ::=
	Annotation
InterfaceModifier ::=
	"public"
InterfaceModifier ::=
	"protected"
InterfaceModifier ::=
	"private"
InterfaceModifier ::=
	"abstract"
InterfaceModifier ::=
	"static"
InterfaceModifier ::=
	"strictfp"
UnaryExpressionNotPlusMinus ::=
	PostfixExpression
UnaryExpressionNotPlusMinus ::=
	"~" UnaryExpression
UnaryExpressionNotPlusMinus ::=
	"!" UnaryExpression
UnaryExpressionNotPlusMinus ::=
	CastExpression
NonWildTypeArguments ::=
	"<" ReferenceTypeList ">"
SwitchBlock ::=
	"{" SwitchBlockStatementGroups? SwitchLabels? "}"
EmptyStatement ::=
	";"
EnumConstants ::=
	EnumConstant
EnumConstants ::=
	EnumConstants "," EnumConstant
LastFormalParameter ::=
	VariableModifiers? Type "..."? VariableDeclaratorId
LastFormalParameter ::=
	FormalParameter
AbstractMethodDeclaration ::=
	AbstractMethodModifiers? TypeParameters? ResultType MethodDeclarator Throws? ";"
IfThenElseStatement ::=
	"if" "(" Expression ")" StatementNoShortIf "else" Statement
EnhancedForStatement ::=
	"for" "(" VariableModifiers? Type Identifier ":" Expression ")" Statement
ReturnStatement ::=
	"return" Expression? ";"
Block ::=
	"{" BlockStatements? "}"
ForUpdate ::=
	StatementExpressionList
ForInit ::=
	StatementExpressionList
ForInit ::=
	LocalVariableDeclaration
EnumDeclaration ::=
	ClassModifiers? "enum" Identifier Interfaces? EnumBody
VariableDeclarators ::=
	VariableDeclarator
VariableDeclarators ::=
	VariableDeclarators "," VariableDeclarator
ThrowStatement ::=
	"throw" Expression ";"
ExclusiveOrExpression ::=
	AndExpression
ExclusiveOrExpression ::=
	ExclusiveOrExpression "^" AndExpression
Primary ::=
	PrimaryNoNewArray
Primary ::=
	ArrayCreationExpression
PackageDeclaration ::=
	Annotations? "package" PackageName ";"
RelationalExpression ::=
	ShiftExpression
RelationalExpression ::=
	RelationalExpression "<" ShiftExpression
RelationalExpression ::=
	RelationalExpression ">" ShiftExpression
RelationalExpression ::=
	RelationalExpression "<=" ShiftExpression
RelationalExpression ::=
	RelationalExpression ">=" ShiftExpression
RelationalExpression ::=
	RelationalExpression "instanceof" ReferenceType
StatementNoShortIf ::=
	StatementWithoutTrailingSubstatement
StatementNoShortIf ::=
	LabeledStatementNoShortIf
StatementNoShortIf ::=
	IfThenElseStatementNoShortIf
StatementNoShortIf ::=
	WhileStatementNoShortIf
StatementNoShortIf ::=
	ForStatementNoShortIf
WhileStatementNoShortIf ::=
	"while" "(" Expression ")" StatementNoShortIf
ExtendsInterfaces ::=
	"extends" InterfaceType
ExtendsInterfaces ::=
	ExtendsInterfaces "," InterfaceType
WildcardBounds ::=
	"extends" ReferenceType
WildcardBounds ::=
	"super" ReferenceType
AbstractMethodModifier ::=
	Annotation
AbstractMethodModifier ::=
	"public"
AbstractMethodModifier ::=
	"abstract"
MethodInvocation ::=
	MethodName "(" ArgumentList? ")"
MethodInvocation ::=
	Primary "." NonWildTypeArguments? Identifier "(" ArgumentList? ")"
MethodInvocation ::=
	"super" "." NonWildTypeArguments? Identifier "(" ArgumentList? ")"
MethodInvocation ::=
	ClassName "." "super" "." NonWildTypeArguments? Identifier "(" ArgumentList? ")"
MethodInvocation ::=
	TypeName "." NonWildTypeArguments Identifier "(" ArgumentList? ")"
ConstantExpression ::=
	Expression
TypeDeclSpecifier ::=
	TypeName
TypeDeclSpecifier ::=
	ClassOrInterfaceType "." Identifier
ExceptionTypeList ::=
	ExceptionType
ExceptionTypeList ::=
	ExceptionTypeList "," ExceptionType
VariableInitializer ::=
	Expression
VariableInitializer ::=
	ArrayInitializer
StaticInitializer ::=
	"static" Block
Finally ::=
	"finally" Block
MarkerAnnotation ::=
	"@" TypeName
ConstructorDeclaration ::=
	ConstructorModifiers? ConstructorDeclarator Throws? ConstructorBody
ElementValuePair ::=
	Identifier "=" ElementValue
TypeImportOnDemandDeclaration ::=
	"import" PackageOrTypeName "." "*" ";"
ArrayAccess ::=
	ExpressionName "[" Expression "]"
ArrayAccess ::=
	PrimaryNoNewArray "[" Expression "]"
InterfaceMemberDeclarations ::=
	InterfaceMemberDeclaration
InterfaceMemberDeclarations ::=
	InterfaceMemberDeclarations InterfaceMemberDeclaration
ForStatement ::=
	BasicForStatement
ForStatement ::=
	EnhancedForStatement
PostIncrementExpression ::=
	PostfixExpression "++"
PackageOrTypeName ::=
	Identifier
PackageOrTypeName ::=
	PackageOrTypeName "." Identifier
AmbiguousName ::=
	Identifier
AmbiguousName ::=
	AmbiguousName "." Identifier
ContinueStatement ::=
	"continue" Identifier? ";"
ImportDeclaration ::=
	SingleTypeImportDeclaration
ImportDeclaration ::=
	TypeImportOnDemandDeclaration
ImportDeclaration ::=
	SingleStaticImportDeclaration
ImportDeclaration ::=
	StaticImportOnDemandDeclaration
CompilationUnit ::=
	PackageDeclaration? ImportDeclarations? TypeDeclarations?
ElementValues ::=
	ElementValue
ElementValues ::=
	ElementValues "," ElementValue
SwitchStatement ::=
	"switch" "(" Expression ")" SwitchBlock
Dims ::=
	"[" "]"
Dims ::=
	Dims "[" "]"
ClassBody ::=
	"{" ClassBodyDeclarations? "}"
AssertStatement ::=
	"assert" Expression ";"
AssertStatement ::=
	"assert" Expression ":" Expression ";"
ClassBodyDeclaration ::=
	ClassMemberDeclaration
ClassBodyDeclaration ::=
	InstanceInitializer
ClassBodyDeclaration ::=
	StaticInitializer
ClassBodyDeclaration ::=
	ConstructorDeclaration
SwitchBlockStatementGroup ::=
	SwitchLabels BlockStatements
MethodDeclaration ::=
	MethodHeader MethodBody
PreDecrementExpression ::=
	"--" UnaryExpression
MethodModifier ::=
	Annotation
MethodModifier ::=
	"public"
MethodModifier ::=
	"protected"
MethodModifier ::=
	"private"
MethodModifier ::=
	"abstract"
MethodModifier ::=
	"static"
MethodModifier ::=
	"final"
MethodModifier ::=
	"synchronized"
MethodModifier ::=
	"native"
MethodModifier ::=
	"strictfp"
DoStatement ::=
	"do" Statement "while" "(" Expression ")" ";"
TypeArguments ::=
	"<" ActualTypeArgumentList ">"
ConditionalExpression ::=
	ConditionalOrExpression
ConditionalExpression ::=
	ConditionalOrExpression "?" Expression ":" ConditionalExpression
ClassOrInterfaceType ::=
	ClassType
ClassOrInterfaceType ::=
	InterfaceType
InstanceInitializer ::=
	Block
TryStatement ::=
	"try" Block Catches
TryStatement ::=
	"try" Block Catches? Finally
SwitchLabels ::=
	SwitchLabel
SwitchLabels ::=
	SwitchLabels SwitchLabel
Wildcard ::=
	"?" WildcardBounds?
FormalParameterList ::=
	LastFormalParameter
FormalParameterList ::=
	FormalParameters "," LastFormalParameter
Expression ::=
	AssignmentExpression
StatementExpressionList ::=
	StatementExpression
StatementExpressionList ::=
	StatementExpressionList "," StatementExpression
AdditiveExpression ::=
	MultiplicativeExpression
AdditiveExpression ::=
	AdditiveExpression "+" MultiplicativeExpression
AdditiveExpression ::=
	AdditiveExpression "-" MultiplicativeExpression
FloatingPointType ::=
	"float"
FloatingPointType ::=
	"double"
ExpressionStatement ::=
	StatementExpression ";"
LocalVariableDeclaration ::=
	VariableModifiers? Type VariableDeclarators
ConstructorDeclarator ::=
	TypeParameters? Identifier "(" FormalParameterList? ")"
InclusiveOrExpression ::=
	ExclusiveOrExpression
InclusiveOrExpression ::=
	InclusiveOrExpression "|" ExclusiveOrExpression
ClassType ::=
	TypeDeclSpecifier TypeArguments?
WhileStatement ::=
	"while" "(" Expression ")" Statement
FormalParameters ::=
	FormalParameter
FormalParameters ::=
	FormalParameters "," FormalParameter
VariableModifier ::=
	"final"
VariableModifier ::=
	Annotation
ClassDeclaration ::=
	NormalClassDeclaration
ClassDeclaration ::=
	EnumDeclaration
FieldAccess ::=
	Primary "." Identifier
FieldAccess ::=
	"super" "." Identifier
FieldAccess ::=
	ClassName "." "super" "." Identifier
AssignmentExpression ::=
	ConditionalExpression
AssignmentExpression ::=
	Assignment
BasicForStatement ::=
	"for" "(" ForInit? ";" Expression? ";" ForUpdate? ")" Statement
ConditionalOrExpression ::=
	ConditionalAndExpression
ConditionalOrExpression ::=
	ConditionalOrExpression "||" ConditionalAndExpression
NormalAnnotation ::=
	"@" TypeName "(" ElementValuePairs? ")"
ImportDeclarations ::=
	ImportDeclaration
ImportDeclarations ::=
	ImportDeclarations ImportDeclaration
TypeDeclaration ::=
	ClassDeclaration
TypeDeclaration ::=
	InterfaceDeclaration
TypeDeclaration ::=
	";"
LabeledStatement ::=
	Identifier ":" Statement
ExpressionName ::=
	Identifier
ExpressionName ::=
	AmbiguousName "." Identifier
ArrayType ::=
	Type "[" "]"
StatementExpression ::=
	Assignment
StatementExpression ::=
	PreIncrementExpression
StatementExpression ::=
	PreDecrementExpression
StatementExpression ::=
	PostIncrementExpression
StatementExpression ::=
	PostDecrementExpression
StatementExpression ::=
	MethodInvocation
StatementExpression ::=
	ClassInstanceCreationExpression
Arguments ::=
	"(" ArgumentList? ")"
MethodDeclarator ::=
	Identifier "(" FormalParameterList? ")"
MethodDeclarator ::=
	MethodDeclarator "[" "]"
VariableDeclaratorId ::=
	Identifier
VariableDeclaratorId ::=
	VariableDeclaratorId "[" "]"
IntegralType ::=
	"byte"
IntegralType ::=
	"short"
IntegralType ::=
	"int"
IntegralType ::=
	"long"
IntegralType ::=
	"char"
UnaryExpression ::=
	PreIncrementExpression
UnaryExpression ::=
	PreDecrementExpression
UnaryExpression ::=
	"+" UnaryExpression
UnaryExpression ::=
	"-" UnaryExpression
UnaryExpression ::=
	UnaryExpressionNotPlusMinus
NumericType ::=
	IntegralType
NumericType ::=
	FloatingPointType
AnnotationTypeBody ::=
	"{" AnnotationTypeElementDeclarations? "}"
LeftHandSide ::=
	ExpressionName
LeftHandSide ::=
	FieldAccess
LeftHandSide ::=
	ArrayAccess
IfThenElseStatementNoShortIf ::=
	"if" "(" Expression ")" StatementNoShortIf "else" StatementNoShortIf
LocalVariableDeclarationStatement ::=
	LocalVariableDeclaration ";"
CastExpression ::=
	"(" PrimitiveType Dims? ")" UnaryExpression
CastExpression ::=
	"(" ReferenceType ")" UnaryExpressionNotPlusMinus
ShiftExpression ::=
	AdditiveExpression
ShiftExpression ::=
	ShiftExpression "<<" AdditiveExpression
ShiftExpression ::=
	ShiftExpression ">>" AdditiveExpression
ShiftExpression ::=
	ShiftExpression ">>>" AdditiveExpression
FieldModifiers ::=
	FieldModifier
FieldModifiers ::=
	FieldModifiers FieldModifier
MethodBody ::=
	Block
MethodBody ::=
	";"
TypeVariable ::=
	Identifier
DefaultValue ::=
	"default" ElementValue
Catches ::=
	CatchClause
Catches ::=
	Catches CatchClause
ResultType ::=
	Type
ResultType ::=
	"void"
ConstructorModifiers ::=
	ConstructorModifier
ConstructorModifiers ::=
	ConstructorModifiers ConstructorModifier
StaticImportOnDemandDeclaration ::=
	"import" "static" TypeName "." "*" ";"
EnumBody ::=
	(EnumConstants? ","? EnumBodyDeclarations?)*
ReferenceType ::=
	ClassOrInterfaceType
ReferenceType ::=
	TypeVariable
ReferenceType ::=
	ArrayType
ClassModifiers ::=
	ClassModifier
ClassModifiers ::=
	ClassModifiers ClassModifier
ForStatementNoShortIf ::=
	"for" "(" ForInit? ";" Expression? ";" ForUpdate? ")" StatementNoShortIf
MethodHeader ::=
	MethodModifiers? TypeParameters? ResultType MethodDeclarator Throws?
LabeledStatementNoShortIf ::=
	Identifier ":" StatementNoShortIf
InterfaceBody ::=
	"{" InterfaceMemberDeclarations? "}"
ConstantModifiers ::=
	ConstantModifier
ConstantModifiers ::=
	ConstantModifier ConstantModifiers
SingleElementAnnotation ::=
	"@" TypeName "(" ElementValue ")"
EnumConstantName ::=
	Identifier
TypeDeclarations ::=
	TypeDeclaration
TypeDeclarations ::=
	TypeDeclarations TypeDeclaration
FieldModifier ::=
	Annotation
FieldModifier ::=
	"public"
FieldModifier ::=
	"protected"
FieldModifier ::=
	"private"
FieldModifier ::=
	"static"
FieldModifier ::=
	"final"
FieldModifier ::=
	"transient"
FieldModifier ::=
	"volatile"
AnnotationTypeElementDeclaration ::=
	AbstractMethodModifiers? Type Identifier "(" ")" Dims? DefaultValue? ";"
AnnotationTypeElementDeclaration ::=
	ConstantDeclaration
AnnotationTypeElementDeclaration ::=
	ClassDeclaration
AnnotationTypeElementDeclaration ::=
	InterfaceDeclaration
AnnotationTypeElementDeclaration ::=
	EnumDeclaration
AnnotationTypeElementDeclaration ::=
	AnnotationTypeDeclaration
AnnotationTypeElementDeclaration ::=
	";"
DimExprs ::=
	DimExpr
DimExprs ::=
	DimExprs DimExpr
SingleStaticImportDeclaration ::=
	"import" "static" TypeName "." Identifier ";"
InterfaceDeclaration ::=
	NormalInterfaceDeclaration
InterfaceDeclaration ::=
	AnnotationTypeDeclaration
NormalInterfaceDeclaration ::=
	InterfaceModifiers? "interface" Identifier ExtendsInterfaces? InterfaceBody
ElementValueArrayInitializer ::=
	"{" ElementValues? ","? "}"
TypeParameters ::=
	"<" TypeParameterList ">"
TypeParameterList ::=
	TypeParameterList "," TypeParameter
TypeParameterList ::=
	TypeParameter
ClassName ::=
	Identifier
ClassName ::=
	AmbiguousName "." Identifier

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []