Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 145655 Details for
Bug 287648
[1.8][compiler] Add support for JSR 308 - Type Annotations Specification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Grammar changes for JSR308 v0.1
patch.txt (text/plain), 17.35 KB, created by
Srikanth Sankaran
on 2009-08-26 06:08:30 EDT
(
hide
)
Description:
Grammar changes for JSR308 v0.1
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2009-08-26 06:08:30 EDT
Size:
17.35 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: grammar/java.g >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/grammar/java.g,v >retrieving revision 1.10 >diff -u -r1.10 java.g >--- grammar/java.g 7 May 2009 08:49:43 -0000 1.10 >+++ grammar/java.g 26 Aug 2009 09:41:08 -0000 >@@ -178,8 +178,8 @@ > Goal ::= '>>' Initializer > -- error recovery > -- Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method >-Goal ::= '>>>' Header1 Modifiersopt >-Goal ::= '!' Header2 Modifiersopt >+Goal ::= '>>>' Header1 >+Goal ::= '!' Header2 > Goal ::= '*' BlockStatements > Goal ::= '*' CatchHeader > -- JDOM >@@ -213,9 +213,12 @@ > BooleanLiteral -> false > /:$readableName BooleanLiteral:/ > >-Type ::= PrimitiveType >+Type ::= UnannotatedType >+Type ::= OneOrMoreAnnotations UnannotatedType >+ >+UnannotatedType ::= PrimitiveType > /.$putCase consumePrimitiveType(); $break ./ >-Type -> ReferenceType >+UnannotatedType -> ReferenceType > /:$readableName Type:/ > > PrimitiveType -> NumericType >@@ -282,6 +285,7 @@ > /:$readableName ArrayType:/ > > ClassType -> ClassOrInterfaceType >+ClassType ::= OneOrMoreAnnotations ClassOrInterfaceType > /:$readableName ClassType:/ > > -------------------------------------------------------------- >@@ -483,7 +487,7 @@ > /.$putCase consumeInterfaceTypeList(); $break ./ > /:$readableName InterfaceTypeList:/ > >-InterfaceType ::= ClassOrInterfaceType >+InterfaceType ::= Annotationsopt ClassOrInterfaceType > /.$putCase consumeInterfaceType(); $break ./ > /:$readableName InterfaceType:/ > >@@ -548,7 +552,7 @@ > -- | 'transient' > -- | 'volatile' > >-FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';' >+FieldDeclaration ::= Modifiersopt UnannotatedType VariableDeclarators ';' > /.$putCase consumeFieldDeclaration(); $break ./ > /:$readableName FieldDeclaration:/ > >@@ -619,7 +623,7 @@ > > MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' > /.$putCase consumeMethodHeaderNameWithTypeParameters(false); $break ./ >-MethodHeaderName ::= Modifiersopt Type 'Identifier' '(' >+MethodHeaderName ::= Modifiersopt UnannotatedType 'Identifier' '(' > /.$putCase consumeMethodHeaderName(false); $break ./ > /:$readableName MethodHeaderName:/ > >@@ -628,7 +632,7 @@ > /:$readableName ):/ > /:$recovery_template ):/ > >-MethodHeaderExtendedDims ::= Dimsopt >+MethodHeaderExtendedDims ::= DimsoptAnnotsopt > /.$putCase consumeMethodHeaderExtendedDims(); $break ./ > /:$readableName MethodHeaderExtendedDims:/ > >@@ -636,7 +640,7 @@ > /.$putCase consumeMethodHeaderThrowsClause(); $break ./ > /:$readableName MethodHeaderThrowsClause:/ > >-ConstructorHeader ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderThrowsClauseopt >+ConstructorHeader ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen Annotationsopt MethodHeaderThrowsClauseopt > /.$putCase consumeConstructorHeader(); $break ./ > /:$readableName ConstructorDeclaration:/ > >@@ -652,9 +656,25 @@ > /:$readableName FormalParameterList:/ > > --1.1 feature >-FormalParameter ::= Modifiersopt Type VariableDeclaratorId >+--FormalParameter ::= Modifiersopt Type VariableDeclaratorId >+--FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId >+--The above rules have been rewritten along the lines of CastExpression >+--to avoid the conflicts resulting from jsr308 changes. >+FormalParameter ::= Modifiersopt PrimitiveType DimsoptAnnotsopt VariableDeclaratorId >+/.$putCase consumeFormalParameter(false); $break ./ >+FormalParameter ::= Modifiersopt PrimitiveType DimsoptAnnotsopt '...' VariableDeclaratorId >+/.$putCase consumeFormalParameter(true); $break ./ >+FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt VariableDeclaratorId >+/.$putCase consumeFormalParameter(false); $break ./ >+FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt '...' VariableDeclaratorId >+/.$putCase consumeFormalParameter(true); $break ./ >+FormalParameter ::= Modifiersopt Name TypeArguments DimsoptAnnotsopt VariableDeclaratorId > /.$putCase consumeFormalParameter(false); $break ./ >-FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId >+FormalParameter ::= Modifiersopt Name TypeArguments DimsoptAnnotsopt '...' VariableDeclaratorId >+/.$putCase consumeFormalParameter(true); $break ./ >+FormalParameter ::= Modifiersopt Name TypeArguments '.' ClassOrInterfaceType DimsoptAnnotsopt VariableDeclaratorId >+/.$putCase consumeFormalParameter(false); $break ./ >+FormalParameter ::= Modifiersopt Name TypeArguments '.' ClassOrInterfaceType DimsoptAnnotsopt '...' VariableDeclaratorId > /.$putCase consumeFormalParameter(true); $break ./ > /:$readableName FormalParameter:/ > /:$compliance 1.5:/ >@@ -865,13 +885,13 @@ > /.$putCase consumeLocalVariableDeclarationStatement(); $break ./ > /:$readableName LocalVariableDeclarationStatement:/ > >-LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators >+LocalVariableDeclaration ::= UnannotatedType PushModifiers VariableDeclarators > /.$putCase consumeLocalVariableDeclaration(); $break ./ > -- 1.1 feature > -- The modifiers part of this rule makes the grammar more permissive. > -- The only modifier here is final. We put Modifiers to allow multiple modifiers > -- This will require to check the validity of the modifier >-LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators >+LocalVariableDeclaration ::= Modifiers UnannotatedType PushRealModifiers VariableDeclarators > /.$putCase consumeLocalVariableDeclaration(); $break ./ > /:$readableName LocalVariableDeclaration:/ > >@@ -1217,26 +1237,36 @@ > /.$putCase consumeArgumentList(); $break ./ > /:$readableName ArgumentList:/ > >-ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs >+ArrayCreationHeader ::= 'new' Annotationsopt PrimitiveType DimWithOrWithOutExprs > /.$putCase consumeArrayCreationHeader(); $break ./ > > ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs > /.$putCase consumeArrayCreationHeader(); $break ./ >+ArrayCreationHeader ::= 'new' OneOrMoreAnnotations ClassOrInterfaceType DimWithOrWithOutExprs >+/.$putCase consumeArrayCreationHeader(); $break ./ > /:$readableName ArrayCreationHeader:/ > > ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs > /.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ >+ArrayCreationWithoutArrayInitializer ::= 'new' OneOrMoreAnnotations PrimitiveType DimWithOrWithOutExprs >+/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ > /:$readableName ArrayCreationWithoutArrayInitializer:/ > > ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer > /.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ >+ArrayCreationWithArrayInitializer ::= 'new' OneOrMoreAnnotations PrimitiveType DimWithOrWithOutExprs ArrayInitializer >+/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ > /:$readableName ArrayCreationWithArrayInitializer:/ > > ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs > /.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ >+ArrayCreationWithoutArrayInitializer ::= 'new' OneOrMoreAnnotations ClassOrInterfaceType DimWithOrWithOutExprs >+/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./ > > ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer > /.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ >+ArrayCreationWithArrayInitializer ::= 'new' OneOrMoreAnnotations ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer >+/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./ > > DimWithOrWithOutExprs ::= DimWithOrWithOutExpr > DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr >@@ -1249,6 +1279,21 @@ > /:$readableName Dimension:/ > -- ----------------------------------------------- > >+-- jsr 308 >+ >+DimsoptAnnotsopt -> $empty >+DimsoptAnnotsopt -> DimsAnnotLoop >+DimsAnnotLoop ::= OneDimOrAnnot >+DimsAnnotLoop ::= DimsAnnotLoop OneDimOrAnnot >+ >+OneDimOrAnnot -> Annotation >+OneDimOrAnnot -> '[' ']' >+ >+Annotationsopt ::= $empty >+Annotationsopt -> OneOrMoreAnnotations >+OneOrMoreAnnotations -> Annotation >+OneOrMoreAnnotations ::= OneOrMoreAnnotations Annotation >+ > Dims ::= DimsLoop > /. $putCase consumeDims(); $break ./ > /:$readableName Dimensions:/ >@@ -1258,6 +1303,7 @@ > OneDimLoop ::= '[' ']' > /. $putCase consumeOneDimLoop(); $break ./ > /:$readableName Dimension:/ >+OneDimLoop ::= OneOrMoreAnnotations '[' ']' > > FieldAccess ::= Primary '.' 'Identifier' > /.$putCase consumeFieldAccess(false); $break ./ >@@ -1340,14 +1386,24 @@ > > CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression > /.$putCase consumeCastExpressionWithPrimitiveType(); $break ./ >+CastExpression ::= PushLPAREN OneOrMoreAnnotations PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression >+/.$putCase consumeCastExpressionWithPrimitiveType(); $break ./ > CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionWithGenericsArray(); $break ./ >+CastExpression ::= PushLPAREN OneOrMoreAnnotations Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus >+/.$putCase consumeCastExpressionWithGenericsArray(); $break ./ > CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./ >+CastExpression ::= PushLPAREN OneOrMoreAnnotations Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus >+/.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./ > CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionLL1(); $break ./ >+CastExpression ::= PushLPAREN OneOrMoreAnnotations Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus >+/.$putCase consumeCastExpressionLL1(); $break ./ > CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus > /.$putCase consumeCastExpressionWithNameArray(); $break ./ >+CastExpression ::= PushLPAREN OneOrMoreAnnotations Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus >+/.$putCase consumeCastExpressionWithNameArray(); $break ./ > /:$readableName CastExpression:/ > > OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments >@@ -1401,7 +1457,7 @@ > /:$readableName Expression:/ > > InstanceofExpression -> RelationalExpression >-InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType >+InstanceofExpression ::= InstanceofExpression 'instanceof' Annotationsopt ReferenceType > /.$putCase consumeInstanceOfExpression(); $break ./ > /:$readableName Expression:/ > >@@ -1666,11 +1722,11 @@ > /.$putCase consumeEnhancedForStatement(); $break ./ > /:$readableName EnhancedForStatementNoShortIf:/ > >-EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt >+EnhancedForStatementHeaderInit ::= 'for' '(' UnannotatedType PushModifiers Identifier Dimsopt > /.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./ > /:$readableName EnhancedForStatementHeaderInit:/ > >-EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt >+EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers UnannotatedType PushRealModifiers Identifier Dimsopt > /.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./ > /:$readableName EnhancedForStatementHeaderInit:/ > >@@ -1730,6 +1786,9 @@ > TypeArgument ::= ReferenceType > /.$putCase consumeTypeArgument(); $break ./ > /:$compliance 1.5:/ >+TypeArgument ::= OneOrMoreAnnotations ReferenceType >+/.$putCase consumeTypeArgument(); $break ./ >+/:$compliance 1.5:/ > TypeArgument -> Wildcard > /:$readableName TypeArgument:/ > /:$compliance 1.5:/ >@@ -1743,8 +1802,13 @@ > ReferenceType1 ::= ReferenceType '>' > /.$putCase consumeReferenceType1(); $break ./ > /:$compliance 1.5:/ >+ReferenceType1 ::= OneOrMoreAnnotations ReferenceType '>' >+/.$putCase consumeReferenceType1(); $break ./ >+/:$compliance 1.5:/ > ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2 > /.$putCase consumeTypeArgumentReferenceType1(); $break ./ >+ReferenceType1 ::= OneOrMoreAnnotations ClassOrInterface '<' TypeArgumentList2 >+/.$putCase consumeTypeArgumentReferenceType1(); $break ./ > /:$readableName ReferenceType1:/ > /:$compliance 1.5:/ > >@@ -1764,8 +1828,13 @@ > ReferenceType2 ::= ReferenceType '>>' > /.$putCase consumeReferenceType2(); $break ./ > /:$compliance 1.5:/ >+ReferenceType2 ::= OneOrMoreAnnotations ReferenceType '>>' >+/.$putCase consumeReferenceType2(); $break ./ >+/:$compliance 1.5:/ > ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3 > /.$putCase consumeTypeArgumentReferenceType2(); $break ./ >+ReferenceType2 ::= OneOrMoreAnnotations ClassOrInterface '<' TypeArgumentList3 >+/.$putCase consumeTypeArgumentReferenceType2(); $break ./ > /:$readableName ReferenceType2:/ > /:$compliance 1.5:/ > >@@ -1782,6 +1851,8 @@ > > ReferenceType3 ::= ReferenceType '>>>' > /.$putCase consumeReferenceType3(); $break ./ >+ReferenceType3 ::= OneOrMoreAnnotations ReferenceType '>>>' >+/.$putCase consumeReferenceType3(); $break ./ > /:$readableName ReferenceType3:/ > /:$compliance 1.5:/ > >@@ -1796,8 +1867,13 @@ > WildcardBounds ::= 'extends' ReferenceType > /.$putCase consumeWildcardBoundsExtends(); $break ./ > /:$compliance 1.5:/ >+WildcardBounds ::= 'extends' OneOrMoreAnnotations ReferenceType >+/.$putCase consumeWildcardBoundsExtends(); $break ./ >+/:$compliance 1.5:/ > WildcardBounds ::= 'super' ReferenceType > /.$putCase consumeWildcardBoundsSuper(); $break ./ >+WildcardBounds ::= 'super' OneOrMoreAnnotations ReferenceType >+/.$putCase consumeWildcardBoundsSuper(); $break ./ > /:$readableName WildcardBounds:/ > /:$compliance 1.5:/ > >@@ -1849,7 +1925,7 @@ > /:$readableName WildcardBound3:/ > /:$compliance 1.5:/ > >-TypeParameterHeader ::= Identifier >+TypeParameterHeader ::= Annotationsopt Identifier > /.$putCase consumeTypeParameterHeader(); $break ./ > /:$readableName TypeParameter:/ > /:$compliance 1.5:/ >@@ -1871,8 +1947,13 @@ > TypeParameter ::= TypeParameterHeader 'extends' ReferenceType > /.$putCase consumeTypeParameterWithExtends(); $break ./ > /:$compliance 1.5:/ >+TypeParameter ::= TypeParameterHeader 'extends' OneOrMoreAnnotations ReferenceType >+/.$putCase consumeTypeParameterWithExtends(); $break ./ >+/:$compliance 1.5:/ > TypeParameter ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList > /.$putCase consumeTypeParameterWithExtendsAndBounds(); $break ./ >+TypeParameter ::= TypeParameterHeader 'extends' OneOrMoreAnnotations ReferenceType AdditionalBoundList >+/.$putCase consumeTypeParameterWithExtendsAndBounds(); $break ./ > /:$readableName TypeParameter:/ > /:$compliance 1.5:/ > >@@ -1884,6 +1965,8 @@ > > AdditionalBound ::= '&' ReferenceType > /.$putCase consumeAdditionalBound(); $break ./ >+AdditionalBound ::= '&' OneOrMoreAnnotations ReferenceType >+/.$putCase consumeAdditionalBound(); $break ./ > /:$readableName AdditionalBound:/ > /:$compliance 1.5:/ > >@@ -1902,6 +1985,8 @@ > /:$compliance 1.5:/ > TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList1 > /.$putCase consumeTypeParameter1WithExtendsAndBounds(); $break ./ >+TypeParameter1 ::= TypeParameterHeader 'extends' OneOrMoreAnnotations ReferenceType AdditionalBoundList1 >+/.$putCase consumeTypeParameter1WithExtendsAndBounds(); $break ./ > /:$readableName TypeParameter1:/ > /:$compliance 1.5:/ > >@@ -2003,9 +2088,9 @@ > /:$readableName Expression:/ > > InstanceofExpression_NotName -> RelationalExpression_NotName >-InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType >+InstanceofExpression_NotName ::= Name 'instanceof' Annotationsopt ReferenceType > /.$putCase consumeInstanceOfExpressionWithName(); $break ./ >-InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType >+InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' Annotationsopt ReferenceType > /.$putCase consumeInstanceOfExpression(); $break ./ > /:$readableName Expression:/ > >@@ -2119,7 +2204,7 @@ > > AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' > /.$putCase consumeMethodHeaderNameWithTypeParameters(true); $break ./ >-AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '(' >+AnnotationMethodHeaderName ::= Modifiersopt UnannotatedType 'Identifier' '(' > /.$putCase consumeMethodHeaderName(true); $break ./ > /:$readableName MethodHeaderName:/ > /:$compliance 1.5:/ >@@ -2262,7 +2347,7 @@ > RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '(' > /.$putCase consumeRecoveryMethodHeaderNameWithTypeParameters(); $break ./ > /:$compliance 1.5:/ >-RecoveryMethodHeaderName ::= Modifiersopt Type 'Identifier' '(' >+RecoveryMethodHeaderName ::= Modifiersopt UnannotatedType 'Identifier' '(' > /.$putCase consumeRecoveryMethodHeaderName(); $break ./ > /:$readableName MethodHeaderName:/ > >@@ -2331,3 +2416,4 @@ > > $end > -- need a carriage return after the $end >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 287648
:
145655
|
145779
|
145880
|
146186
|
146401
|
146602
|
148041
|
148087
|
149501
|
149970
|
150486
|
187248
|
217341
|
217581
|
217668
|
217685
|
217786