Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: java/java-5/giquel/extracted
Source used for this grammar: Fabien Giquel, J2SE5, all the structural concepts of Java 5 source code, J2SE5.ecore
, 2007/10/03 [Atlantic]
AbstractTypeDeclaration
, Annotation
, AnnotationMemberValuePair
, AnnotationTypeDeclaration
, AnnotationTypeMemberDeclaration
, AnonymousClassDeclaration
, ArrayAccess
, ArrayCreation
, ArrayInitializer
, ArrayLengthAccess
, AssertStatement
, Assignment
, ASTNode
, BodyDeclaration
, Block
, BlockComment
, BreakStatement
, CastExpression
, CatchClause
, ClassInstanceCreation
, Comment
, ConditionalExpression
, ContinueStatement
, ConstructorInvocation
, DoStatement
, EmptyStatement
, EnhancedForStatement
, EnumConstantDeclaration
, EnumDeclaration
, Expression
, ExpressionStatement
, FieldAccess
, FieldDeclaration
, ForStatement
, InfixExpression
, IfStatement
, ImportDeclaration
, Initializer
, InstanceofExpression
, Javadoc
, LabeledStatement
, LineComment
, MemberRef
, MethodDeclaration
, MethodInvocation
, MethodRef
, MethodRefParameter
, Model
, MultipleValuedNamedElement
, NamedElement
, NamedElementRef
, OrphanType
, PackageDeclaration
, ParameterizedType
, ParenthesizedExpression
, PostfixExpression
, PrefixExpression
, PrimitiveType
, ReturnStatement
, ThrowStatement
, SingleVariableDeclaration
, Statement
, SuperConstructorInvocation
, SuperFieldAccess
, SuperMethodInvocation
, SwitchCase
, SwitchStatement
, SynchronizedStatement
, TagElement
, TextElement
, ThisExpression
, TryStatement
, TypeDeclaration
, TypeDeclarationStatement
, TypeLiteral
, TypeParameter
, UnresolvedItem
, ValuedNamedElement
, VariableDeclarationExpression
, VariableDeclarationStatement
, WildCardType
, WhileStatement
, String
, Boolean
, Integer
), 0 root (—), 0 top (—), 0 bottom (—).[type]
12, [values]
, [member]
2, [value]
, [originalFileContent]
, [package]
, [bodyDeclarations]
2, [superInterfaces]
, [commentsAfterBody]
, [imports]
, [commentsBeforeBody]
, [default]
, [index]
, [array]
2, [dimensions]
, [initializer]
, [expressions]
, [message]
, [expression]
19, [operator]
4, [rightHandSide]
, [leftHandSide]
, [statements]
2, [content]
2, [isEnclosedByParent]
2, [isPrefixOfParent]
2, [label]
2, [exception]
, [body]
10, [arguments]
6, [anonymousClassDeclaration]
2, [elseExpression]
, [thenExpression]
, [parameter]
, [enumConstants]
, [field]
2, [initializers]
, [updaters]
, [extendedOperands]
, [rightOperand]
2, [leftOperand]
2, [elseStatement]
, [thenStatement]
, [static]
, [importedElement]
, [tags]
, [qualifier]
6, [extraArrayDimensions]
2, [constructor]
, [varargs]
, [parameters]
2, [typeParameters]
2, [thrownExceptions]
, [returnType]
, [method]
3, [name]
4, [isVarargs]
2, [ownedElements]
2, [orphanTypes]
, [element]
, [proxy]
2, [model]
, [typeArguments]
, [operand]
2, [comments]
2, [modifiers]
3, [expressionInitialized]
, [tagName]
, [fragments]
, [text]
, [finally]
, [catchClauses]
, [isInterface]
, [superclass]
, [declaration]
, [bounds]
, [isUpperBound]
, [bound]
.AbstractTypeDeclaration ::= AnnotationTypeDeclaration
AbstractTypeDeclaration ::= EnumDeclaration
AbstractTypeDeclaration ::= TypeDeclaration
Annotation ::=
[type]::NamedElementRef [values]::AnnotationMemberValuePair
AnnotationMemberValuePair ::= [member]::NamedElementRef [value]::Expression
AnnotationTypeDeclaration ::= [originalFileContent]::String [package]::PackageDeclaration [bodyDeclarations]::BodyDeclaration[superInterfaces]::NamedElementRef [commentsAfterBody]::Comment [imports]::ImportDeclaration [commentsBeforeBody]::Comment
AnnotationTypeMemberDeclaration ::= [type]::NamedElementRef [default]::Expression
AnonymousClassDeclaration ::=
[bodyDeclarations]::BodyDeclaration
ArrayAccess ::= [index]::Expression [array]::Expression
ArrayCreation ::=
[dimensions]::Expression
[initializer]::ArrayInitializer [type]::NamedElementRefArrayInitializer ::=
[expressions]::Expression
ArrayLengthAccess ::= [array]::Expression
AssertStatement ::= [message]::Expression [expression]::Expression
Assignment ::= [operator]::String [rightHandSide]::Expression [leftHandSide]::Expression
ASTNode ::= AnnotationMemberValuePair
ASTNode ::= AnonymousClassDeclaration
ASTNode ::= BodyDeclaration
ASTNode ::= CatchClause
ASTNode ::= Comment
ASTNode ::= Expression
ASTNode ::= ImportDeclaration
ASTNode ::= MemberRef
ASTNode ::= MethodRef
ASTNode ::= MethodRefParameter
ASTNode ::= Statement
ASTNode ::= TagElement
ASTNode ::= TextElement
ASTNode ::= PackageDeclaration
ASTNode ::= ParameterizedType
ASTNode ::= PrimitiveType
ASTNode ::= SingleVariableDeclaration
ASTNode ::= TypeParameter
ASTNode ::= UnresolvedItem
ASTNode ::= WildCardType
BodyDeclaration ::= Initializer
BodyDeclaration ::= EnumConstantDeclaration
BodyDeclaration ::= FieldDeclaration
BodyDeclaration ::= AbstractTypeDeclaration
BodyDeclaration ::= AnnotationTypeMemberDeclaration
BodyDeclaration ::= MethodDeclaration
Block ::=
[statements]::Statement
BlockComment ::= [content]::String [isEnclosedByParent]::Boolean [isPrefixOfParent]::Boolean
BreakStatement ::= [label]::NamedElementRef
CastExpression ::= [type]::NamedElementRef [expression]::Expression
CatchClause ::= [exception]::SingleVariableDeclaration [body]::Block
ClassInstanceCreation ::=
[arguments]::Expression
[type]::NamedElementRef [expression]::Expression [anonymousClassDeclaration]::AnonymousClassDeclarationComment ::= BlockComment
Comment ::= Javadoc
Comment ::= LineComment
ConditionalExpression ::= [elseExpression]::Expression [thenExpression]::Expression [expression]::Expression
ContinueStatement ::= [label]::NamedElementRef
ConstructorInvocation ::=
[arguments]::Expression
DoStatement ::= [expression]::Expression [body]::Statement
EmptyStatement ::= ε
EnhancedForStatement ::= [parameter]::SingleVariableDeclaration [expression]::Expression [body]::Statement
EnumConstantDeclaration ::=
[arguments]::Expression
[anonymousClassDeclaration]::AnonymousClassDeclarationEnumDeclaration ::=
[enumConstants]::EnumConstantDeclaration
Expression ::= Annotation
Expression ::= ArrayAccess
Expression ::= ArrayCreation
Expression ::= ArrayInitializer
Expression ::= ArrayLengthAccess
Expression ::= Assignment
Expression ::= CastExpression
Expression ::= ClassInstanceCreation
Expression ::= ConditionalExpression
Expression ::= FieldAccess
Expression ::= InfixExpression
Expression ::= InstanceofExpression
Expression ::= MethodInvocation
Expression ::= NamedElementRef
Expression ::= ParenthesizedExpression
Expression ::= PostfixExpression
Expression ::= PrefixExpression
Expression ::= SuperFieldAccess
Expression ::= SuperMethodInvocation
Expression ::= ThisExpression
Expression ::= TypeLiteral
Expression ::= VariableDeclarationExpression
ExpressionStatement ::= [expression]::Expression
FieldAccess ::= [field]::NamedElementRef [expression]::Expression
FieldDeclaration ::= [type]::NamedElementRef
ForStatement ::= [body]::Statement [expression]::Expression [initializers]::Expression[updaters]::Expression
InfixExpression ::=
[operator]::String [extendedOperands]::Expression
[rightOperand]::Expression [leftOperand]::ExpressionIfStatement ::= [expression]::Expression [elseStatement]::Statement [thenStatement]::Statement
ImportDeclaration ::= [static]::Boolean [importedElement]::NamedElementRef
Initializer ::= [body]::Block
InstanceofExpression ::= [leftOperand]::Expression [rightOperand]::NamedElementRef
Javadoc ::=
[tags]::TagElement
LabeledStatement ::= [body]::Statement
LineComment ::= [content]::String [isEnclosedByParent]::Boolean [isPrefixOfParent]::Boolean
MemberRef ::= [qualifier]::NamedElementRef [member]::NamedElementRef
MethodDeclaration ::= [extraArrayDimensions]::Integer [constructor]::Boolean [varargs]::Boolean [body]::Block [parameters]::SingleVariableDeclaration[typeParameters]::TypeParameter [thrownExceptions]::NamedElementRef [returnType]::NamedElementRef
MethodInvocation ::=
[method]::NamedElementRef [arguments]::Expression
[expression]::ExpressionMethodRef ::=
[qualifier]::NamedElementRef [parameters]::MethodRefParameter
[method]::NamedElementRefMethodRefParameter ::= [name]::String [isVarargs]::Boolean [type]::NamedElementRef
Model ::= [name]::String [ownedElements]::PackageDeclaration[orphanTypes]::OrphanType
MultipleValuedNamedElement ::= FieldDeclaration
NamedElement ::= OrphanType
NamedElement ::= ValuedNamedElement
NamedElement ::= AbstractTypeDeclaration
NamedElement ::= AnnotationTypeMemberDeclaration
NamedElement ::= MethodDeclaration
NamedElement ::= UnresolvedItem
NamedElement ::= EnumConstantDeclaration
NamedElement ::= LabeledStatement
NamedElement ::= PackageDeclaration
NamedElement ::= TypeParameter
NamedElementRef ::= [extraArrayDimensions]::Integer [element]::NamedElement [qualifier]::NamedElementRef
OrphanType ::= WildCardType
OrphanType ::= ParameterizedType
OrphanType ::= PrimitiveType
OrphanType ::= [name]::String [proxy]::Boolean
PackageDeclaration ::=
[model]::Model [ownedElements]::AbstractTypeDeclaration
ParameterizedType ::=
[typeArguments]::NamedElementRef
[type]::NamedElementRefParenthesizedExpression ::= [expression]::Expression
PostfixExpression ::= [operator]::String [operand]::Expression
PrefixExpression ::= [operator]::String [operand]::Expression
PrimitiveType ::=
[comments]::Comment
ReturnStatement ::= [expression]::Expression
ThrowStatement ::= [expression]::Expression
SingleVariableDeclaration ::= [modifiers]::String [isVarargs]::Boolean [type]::NamedElementRef
Statement ::= AssertStatement
Statement ::= Block
Statement ::= BreakStatement
Statement ::= ContinueStatement
Statement ::= ConstructorInvocation
Statement ::= DoStatement
Statement ::= EmptyStatement
Statement ::= EnhancedForStatement
Statement ::= ExpressionStatement
Statement ::= ForStatement
Statement ::= IfStatement
Statement ::= ReturnStatement
Statement ::= ThrowStatement
Statement ::= SuperConstructorInvocation
Statement ::= SwitchCase
Statement ::= SwitchStatement
Statement ::= SynchronizedStatement
Statement ::= TryStatement
Statement ::= TypeDeclarationStatement
Statement ::= WhileStatement
Statement ::= LabeledStatement
Statement ::= VariableDeclarationStatement
SuperConstructorInvocation ::=
[arguments]::Expression
[expression]::ExpressionSuperFieldAccess ::= [qualifier]::NamedElementRef [field]::NamedElementRef
SuperMethodInvocation ::=
[arguments]::Expression
[qualifier]::NamedElementRef [method]::NamedElementRefSwitchCase ::= [expressionInitialized]::Boolean [expression]::Expression
SwitchStatement ::=
[statements]::Statement
[expression]::ExpressionSynchronizedStatement ::= [body]::Block [expression]::Expression
TagElement ::=
[tagName]::String [fragments]::ASTNode
TextElement ::= [text]::String
ThisExpression ::= [qualifier]::NamedElementRef
TryStatement ::=
[finally]::Block [body]::Block [catchClauses]::CatchClause
TypeDeclaration ::=
[isInterface]::Boolean [typeParameters]::TypeParameter
[superclass]::NamedElementRefTypeDeclarationStatement ::= [declaration]::AbstractTypeDeclaration
TypeLiteral ::= [type]::NamedElementRef
TypeParameter ::=
[bounds]::NamedElementRef
UnresolvedItem ::=
[name]::String [proxy]::Boolean [comments]::Comment
ValuedNamedElement ::= MultipleValuedNamedElement
ValuedNamedElement ::= SingleVariableDeclaration
VariableDeclarationExpression ::= [modifiers]::String [type]::NamedElementRef
VariableDeclarationStatement ::= [modifiers]::String [type]::NamedElementRef
WildCardType ::= [isUpperBound]::Boolean [bound]::NamedElementRef
WhileStatement ::= [expression]::Expression [body]::Statement
String ::= string
Boolean ::= "true" "false"
Integer ::= integer