Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: java/eclipse/jdt/extracted
Source used for this grammar: Mikaël Barbero, JavaAbstractSyntax 1.0, a metamodel describing a full abstract syntax of the code, based on the Eclipse JDT API Specification, JavaAbstractSyntax.ecore
, 2006/10/24 [Atlantic]
String
, Boolean
, Integer
, AST
, ASTNode
, AnonymousClassDeclaration
, BodyDeclaration
, CatchClause
, Comment
, CompilationUnit
, Expression
, ImportDeclaration
, MemberRef
, MemberValuePair
, MethodRef
, MethodRefParameter
, ExtendedModifier
, Modifier
, PackageDeclaration
, Statement
, TagElement
, TextElement
, Type
, TypeParameter
, VariableDeclaration
, AbstractTypeDeclaration
, AnnotationTypeMemberDeclaration
, EnumConstantDeclaration
, FieldDeclaration
, Initializer
, MethodDeclaration
, AnnotationTypeDeclaration
, EnumDeclaration
, TypeDeclaration
, BlockComment
, Javadoc
, LineComment
, Annotation
, ArrayAccess
, ArrayCreation
, ArrayInitializer
, Assignment
, AssignementOperatorKind
, BooleanLiteral
, CastExpression
, CharacterLiteral
, ClassInstanceCreation
, ConditionalExpression
, FieldAccess
, InfixExpression
, InfixExpressionOperatorKind
, InstanceofExpression
, MethodInvocation
, Name
, NullLiteral
, NumberLiteral
, ParenthesizedExpression
, PostfixExpression
, PostfixExpresssionOperatorKind
, PrefixExpression
, PrefixExpresssionOperatorKind
, StringLiteral
, SuperFieldAccess
, SuperMethodInvocation
, ThisExpression
, TypeLiteral
, VariableDeclarationExpression
, AssertStatement
, Block
, BreakStatement
, ConstructorInvocation
, ContinueStatement
, DoStatement
, EmptyStatement
, EnhancedForStatement
, ExpressionStatement
, ForStatement
, IfStatement
, LabeledStatement
, ReturnStatement
, SuperConstructorInvocation
, SwitchCase
, SwitchStatement
, SynchronizedStatement
, ThrowStatement
, TryStatement
, TypeDeclarationStatement
, VariableDeclarationStatement
, WhileStatement
, ArrayType
, ParameterizedType
, PrimitiveType
, QualifiedType
, SimpleType
, WildcardType
, SingleVariableDeclaration
, VariableDeclarationFragment
, QualifiedName
, SimpleName
, MarkerAnnotation
, NormalAnnotation
, SingleMemberAnnotation
), 0 root (—), 10 top (String
, Boolean
, Integer
, AST
, ASTNode
, ExtendedModifier
, AssignementOperatorKind
, InfixExpressionOperatorKind
, PostfixExpresssionOperatorKind
, PrefixExpresssionOperatorKind
), 0 bottom (—).[root]
, [bodyDeclarations]
2, [body]
10, [exception]
, [comments]
, [package]
, [imports]
, [types]
, [onDemand]
, [static]
2, [name]
19, [qualifier]
7, [value]
2, [parameters]
2, [type]
11, [varargs]
3, [abstract]
, [final]
, [native]
, [none]
, [private]
, [protected]
, [public]
, [strictfp]
, [synchronized]
, [transient]
, [volatile]
, [annotations]
, [javadoc]
, [fragments]
4, [tagName]
, [nested]
, [text]
, [typeBounds]
, [default]
2, [arguments]
6, [anonymousClassDeclaration]
2, [extraDimensions]
2, [returnType]
, [constructor]
, [thrownExceptions]
, [typeParameters]
2, [localTypeDeclaration]
, [memberTypeDeclaration]
, [packageMemberTypeDeclaration]
, [superInterfaceTypes]
2, [enumConstants]
, [superclassType]
, [interface]
, [alternateRoot]
2, [tags]
, [array]
, [index]
, [dimensions]
2, [initializer]
2, [expressions]
, [leftHandSide]
, [operator]
4, [rightHandSide]
, [RIGHT_SHIFT_SIGNED_ASSIGN]
, [BIT_XOR_ASSIGN]
, [TIMES_ASSIGN]
, [LEFT_SHIFT_ASSIGN]
, [MINUS_ASSIGN]
, [BIT_OR_ASSIGN]
, [PLUS_ASSIGN]
, [ASSIGN]
, [RIGHT_SHIFT_UNSIGNED_ASSIGN]
, [REMAINDER_ASSIGN]
, [DIVIDE_ASSIGN]
, [BIT_AND_ASSIGN]
, [booleanValue]
, [expression]
19, [charValue]
, [escapedValue]
2, [typeArguments]
6, [elseExpression]
, [thenExpression]
, [extendedOperands]
, [leftOperand]
2, [rightOperand]
2, [GREATER_EQUALS]
, [OR]
, [RIGHT_SHIFT_SIGNED]
, [MINUS]
2, [XOR]
, [LESS_EQUALS]
, [EQUALS]
, [NOT_EQUALS]
, [AND]
, [PLUS]
2, [GREATER]
, [CONDITIONAL_OR]
, [REMAINDER]
, [LESS]
, [LEFT_SHIFT]
, [RIGHT_SHIFT_UNSIGNED]
, [CONDITIONAL_AND]
, [TIMES]
, [DIVIDE]
, [resolveBoxing]
, [resolveUnboxing]
, [token]
, [operand]
2, [INCREMENT]
2, [DECREMENT]
2, [NOT]
, [COMPLEMENT]
, [literalValue]
, [modifiers]
3, [message]
, [statements]
2, [label]
3, [parameter]
, [initializers]
, [updaters]
, [elseStatement]
, [thenStatement]
, [catchClauses]
, [finally]
, [declaration]
2, [componentType]
, [elementType]
, [code]
, [bound]
, [upperBound]
, [identifier]
, [typeName]
, [values]
.String ::= string
Boolean ::= "true" "false"
Integer ::= integer
AST ::= [root]::α
ASTNode ::= AnonymousClassDeclaration
ASTNode ::= BodyDeclaration
ASTNode ::= CatchClause
ASTNode ::= Comment
ASTNode ::= CompilationUnit
ASTNode ::= Expression
ASTNode ::= ImportDeclaration
ASTNode ::= MemberRef
ASTNode ::= MemberValuePair
ASTNode ::= MethodRef
ASTNode ::= MethodRefParameter
ASTNode ::= PackageDeclaration
ASTNode ::= Statement
ASTNode ::= TagElement
ASTNode ::= TextElement
ASTNode ::= Type
ASTNode ::= TypeParameter
ASTNode ::= VariableDeclaration
ASTNode ::= Modifier
AnonymousClassDeclaration ::=
[bodyDeclarations]::α
BodyDeclaration ::= AbstractTypeDeclaration
BodyDeclaration ::= AnnotationTypeMemberDeclaration
BodyDeclaration ::= EnumConstantDeclaration
BodyDeclaration ::= FieldDeclaration
BodyDeclaration ::= Initializer
BodyDeclaration ::= MethodDeclaration
CatchClause ::= [body]::α [exception]::α
Comment ::= BlockComment
Comment ::= Javadoc
Comment ::= LineComment
CompilationUnit ::= [comments]::α[package]::α [imports]::α [types]::α
Expression ::= ArrayAccess
Expression ::= ArrayCreation
Expression ::= ArrayInitializer
Expression ::= Assignment
Expression ::= BooleanLiteral
Expression ::= CastExpression
Expression ::= CharacterLiteral
Expression ::= ClassInstanceCreation
Expression ::= ConditionalExpression
Expression ::= FieldAccess
Expression ::= InfixExpression
Expression ::= InstanceofExpression
Expression ::= MethodInvocation
Expression ::= Name
Expression ::= NullLiteral
Expression ::= NumberLiteral
Expression ::= ParenthesizedExpression
Expression ::= PostfixExpression
Expression ::= PrefixExpression
Expression ::= StringLiteral
Expression ::= SuperFieldAccess
Expression ::= SuperMethodInvocation
Expression ::= ThisExpression
Expression ::= TypeLiteral
Expression ::= VariableDeclarationExpression
Expression ::= Annotation
ImportDeclaration ::= [onDemand]::α [static]::α [name]::α
MemberRef ::= [name]::α [qualifier]::α
MemberValuePair ::= [name]::α [value]::α
MethodRef ::=
[name]::α [qualifier]::α [parameters]::α
MethodRefParameter ::= [name]::α [type]::α [varargs]::α
ExtendedModifier ::= Modifier
ExtendedModifier ::= Annotation
Modifier ::= [abstract]::α [final]::α [native]::α [none]::α [private]::α [protected]::α [public]::α [static]::α [strictfp]::α [synchronized]::α [transient]::α [volatile]::α
PackageDeclaration ::=
[annotations]::α
[javadoc]::α [name]::αStatement ::= AssertStatement
Statement ::= Block
Statement ::= BreakStatement
Statement ::= ConstructorInvocation
Statement ::= ContinueStatement
Statement ::= DoStatement
Statement ::= EmptyStatement
Statement ::= EnhancedForStatement
Statement ::= ExpressionStatement
Statement ::= ForStatement
Statement ::= IfStatement
Statement ::= LabeledStatement
Statement ::= ReturnStatement
Statement ::= SuperConstructorInvocation
Statement ::= SwitchCase
Statement ::= SwitchStatement
Statement ::= SynchronizedStatement
Statement ::= ThrowStatement
Statement ::= TryStatement
Statement ::= TypeDeclarationStatement
Statement ::= VariableDeclarationStatement
Statement ::= WhileStatement
TagElement ::=
[fragments]::α
[tagName]::α [nested]::αTextElement ::= [text]::α
Type ::= ArrayType
Type ::= ParameterizedType
Type ::= PrimitiveType
Type ::= QualifiedType
Type ::= SimpleType
Type ::= WildcardType
TypeParameter ::=
[name]::α [typeBounds]::α
VariableDeclaration ::= SingleVariableDeclaration
VariableDeclaration ::= VariableDeclarationFragment
AbstractTypeDeclaration ::= AnnotationTypeDeclaration
AbstractTypeDeclaration ::= EnumDeclaration
AbstractTypeDeclaration ::= TypeDeclaration
AnnotationTypeMemberDeclaration ::= [default]::α [name]::α [type]::α
EnumConstantDeclaration ::=
[arguments]::α
[anonymousClassDeclaration]::α [name]::αFieldDeclaration ::=
[fragments]::α
[type]::αInitializer ::= [body]::α
MethodDeclaration ::= [body]::α [extraDimensions]::α [name]::α [returnType]::α [constructor]::α [varargs]::α [parameters]::α[thrownExceptions]::α [typeParameters]::α
AnnotationTypeDeclaration ::=
[bodyDeclarations]::α
[name]::α [localTypeDeclaration]::α [memberTypeDeclaration]::α [packageMemberTypeDeclaration]::αEnumDeclaration ::= [superInterfaceTypes]::α[enumConstants]::α
TypeDeclaration ::= [superclassType]::α [interface]::α [superInterfaceTypes]::α[typeParameters]::α
BlockComment ::= [alternateRoot]::α
Javadoc ::=
[tags]::α
LineComment ::= [alternateRoot]::α
Annotation ::= MarkerAnnotation
Annotation ::= NormalAnnotation
Annotation ::= SingleMemberAnnotation
ArrayAccess ::= [array]::α [index]::α
ArrayCreation ::=
[dimensions]::α
[initializer]::α [type]::αArrayInitializer ::=
[expressions]::α
Assignment ::= [leftHandSide]::α [operator]::α [rightHandSide]::α
AssignementOperatorKind ::= [RIGHT_SHIFT_SIGNED_ASSIGN]::ε [BIT_XOR_ASSIGN]::ε [TIMES_ASSIGN]::ε [LEFT_SHIFT_ASSIGN]::ε [MINUS_ASSIGN]::ε [BIT_OR_ASSIGN]::ε [PLUS_ASSIGN]::ε [ASSIGN]::ε [RIGHT_SHIFT_UNSIGNED_ASSIGN]::ε [REMAINDER_ASSIGN]::ε [DIVIDE_ASSIGN]::ε [BIT_AND_ASSIGN]::ε
BooleanLiteral ::= [booleanValue]::α
CastExpression ::= [expression]::α [type]::α
CharacterLiteral ::= [charValue]::α [escapedValue]::α
ClassInstanceCreation ::= [arguments]::α[anonymousClassDeclaration]::α [expression]::α [type]::α [typeArguments]::α
ConditionalExpression ::= [elseExpression]::α [expression]::α [thenExpression]::α
FieldAccess ::= [expression]::α [name]::α
InfixExpression ::=
[extendedOperands]::α
[leftOperand]::α [operator]::α [rightOperand]::αInfixExpressionOperatorKind ::= [GREATER_EQUALS]::ε [OR]::ε [RIGHT_SHIFT_SIGNED]::ε [MINUS]::ε [XOR]::ε [LESS_EQUALS]::ε [EQUALS]::ε [NOT_EQUALS]::ε [AND]::ε [PLUS]::ε [GREATER]::ε [CONDITIONAL_OR]::ε [REMAINDER]::ε [LESS]::ε [LEFT_SHIFT]::ε [RIGHT_SHIFT_UNSIGNED]::ε [CONDITIONAL_AND]::ε [TIMES]::ε [DIVIDE]::ε
InstanceofExpression ::= [leftOperand]::α [rightOperand]::α
MethodInvocation ::= [arguments]::α[expression]::α [name]::α [typeArguments]::α
Name ::= QualifiedName
Name ::= SimpleName
NullLiteral ::= [resolveBoxing]::α [resolveUnboxing]::α
NumberLiteral ::= [token]::α
ParenthesizedExpression ::= [expression]::α
PostfixExpression ::= [operand]::α [operator]::α
PostfixExpresssionOperatorKind ::= [INCREMENT]::ε [DECREMENT]::ε
PrefixExpression ::= [operand]::α [operator]::α
PrefixExpresssionOperatorKind ::= [MINUS]::ε [NOT]::ε [DECREMENT]::ε [COMPLEMENT]::ε [INCREMENT]::ε [PLUS]::ε
StringLiteral ::= [escapedValue]::α [literalValue]::α
SuperFieldAccess ::= [name]::α [qualifier]::α
SuperMethodInvocation ::= [arguments]::α[name]::α [qualifier]::α [typeArguments]::α
ThisExpression ::= [qualifier]::α
TypeLiteral ::= [type]::α
VariableDeclarationExpression ::= [fragments]::α[modifiers]::α [type]::α
AssertStatement ::= [expression]::α [message]::α
Block ::=
[statements]::α
BreakStatement ::= [label]::α
ConstructorInvocation ::= [arguments]::α[typeArguments]::α
ContinueStatement ::= [label]::α
DoStatement ::= [body]::α [expression]::α
EmptyStatement ::= ε
EnhancedForStatement ::= [body]::α [expression]::α [parameter]::α
ExpressionStatement ::= [expression]::α
ForStatement ::= [body]::α [expression]::α [initializers]::α[updaters]::α
IfStatement ::= [elseStatement]::α [expression]::α [thenStatement]::α
LabeledStatement ::= [body]::α [label]::α
ReturnStatement ::= [expression]::α
SuperConstructorInvocation ::= [arguments]::α[expression]::α [typeArguments]::α
SwitchCase ::= [expression]::α [default]::α
SwitchStatement ::=
[expression]::α [statements]::α
SynchronizedStatement ::= [body]::α [expression]::α
ThrowStatement ::= [expression]::α
TryStatement ::=
[catchClauses]::α
[body]::α [finally]::αTypeDeclarationStatement ::= [declaration]::α
VariableDeclarationStatement ::= [fragments]::α[modifiers]::α [type]::α
WhileStatement ::= [body]::α [expression]::α
ArrayType ::= [componentType]::α [dimensions]::α [elementType]::α
ParameterizedType ::=
[type]::α [typeArguments]::α
PrimitiveType ::= [code]::α
QualifiedType ::= [name]::α [qualifier]::α
SimpleType ::= [name]::α
WildcardType ::= [bound]::α [upperBound]::α
SingleVariableDeclaration ::=
[type]::α [varargs]::α [modifiers]::α
VariableDeclarationFragment ::= [extraDimensions]::α [initializer]::α [name]::α
QualifiedName ::= [name]::α [qualifier]::α
SimpleName ::= [identifier]::α [declaration]::α
MarkerAnnotation ::= [typeName]::α
NormalAnnotation ::=
[values]::α
SingleMemberAnnotation ::= [value]::α