Bug 384992 - [java8] adopt grammar changes for Java 8 from JDT/Core
2. Full source merge - grammar adjusted to be LALR(1)
JDT tests look good, OTJLD tests: 625 Err, 36 Fail
Notably LiftingTypeReference cannot yet be created by the Parser
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
index f07f838..2a624dd 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -67,6 +71,9 @@
public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) {
// do nothing by default
}
+ public void endVisit(ArrayInitializer arrayInitializer, ClassScope scope) {
+ // do nothing by default
+ }
public void endVisit(
ArrayQualifiedTypeReference arrayQualifiedTypeReference,
BlockScope scope) {
@@ -287,12 +294,26 @@
// do nothing by default
}
/**
+ * @param annotation
+ * @param scope
+ */
+ public void endVisit(MarkerAnnotation annotation, ClassScope scope) {
+ // do nothing by default
+ }
+ /**
* @param pair
* @param scope
*/
public void endVisit(MemberValuePair pair, BlockScope scope) {
// do nothing by default
}
+ /**
+ * @param pair
+ * @param scope
+ */
+ public void endVisit(MemberValuePair pair, ClassScope scope) {
+ // do nothing by default
+ }
public void endVisit(MessageSend messageSend, BlockScope scope) {
// do nothing by default
}
@@ -310,6 +331,9 @@
public void endVisit(NormalAnnotation annotation, BlockScope scope) {
// do nothing by default
}
+ public void endVisit(NormalAnnotation annotation, ClassScope scope) {
+ // do nothing by default
+ }
public void endVisit(NullLiteral nullLiteral, BlockScope scope) {
// do nothing by default
}
@@ -390,6 +414,13 @@
public void endVisit(SingleMemberAnnotation annotation, BlockScope scope) {
// do nothing by default
}
+ /**
+ * @param annotation
+ * @param scope
+ */
+ public void endVisit(SingleMemberAnnotation annotation, ClassScope scope) {
+ // do nothing by default
+ }
public void endVisit(
SingleNameReference singleNameReference,
BlockScope scope) {
@@ -545,6 +576,9 @@
public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
return true; // do nothing by default, keep traversing
}
+ public boolean visit(ArrayInitializer arrayInitializer, ClassScope scope) {
+ return true; // do nothing by default, keep traversing
+ }
public boolean visit(
ArrayQualifiedTypeReference arrayQualifiedTypeReference,
BlockScope scope) {
@@ -765,6 +799,13 @@
return true;
}
/**
+ * @param annotation
+ * @param scope
+ */
+ public boolean visit(MarkerAnnotation annotation, ClassScope scope) {
+ return true;
+ }
+ /**
* @param pair
* @param scope
* @since 3.1
@@ -772,6 +813,13 @@
public boolean visit(MemberValuePair pair, BlockScope scope) {
return true;
}
+ /**
+ * @param pair
+ * @param scope
+ */
+ public boolean visit(MemberValuePair pair, ClassScope scope) {
+ return true;
+ }
public boolean visit(MessageSend messageSend, BlockScope scope) {
return true; // do nothing by default, keep traversing
}
@@ -791,6 +839,13 @@
public boolean visit(NormalAnnotation annotation, BlockScope scope) {
return true;
}
+ /**
+ * @param annotation
+ * @param scope
+ */
+ public boolean visit(NormalAnnotation annotation, ClassScope scope) {
+ return true;
+ }
public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
return true; // do nothing by default, keep traversing
}
@@ -871,6 +926,13 @@
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
return true;
}
+ /**
+ * @param annotation
+ * @param scope
+ */
+ public boolean visit(SingleMemberAnnotation annotation, ClassScope scope) {
+ return true;
+ }
public boolean visit(
SingleNameReference singleNameReference,
BlockScope scope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
index 5a71ec3..5d22c4b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
@@ -4,7 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: ClassFile.java 23404 2010-02-03 14:10:22Z stephan $
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -291,6 +294,11 @@
} else {
this.codeStream = new CodeStream(this);
}
+ if (this.targetJDK == ClassFileConstants.JDK1_8) {
+ //TODO JAVA8: Version number is not yet updated in the java8 beta...
+ //Remove this after it is upgraded
+ this.targetJDK = ClassFileConstants.JDK1_7;
+ }
initByteArrays();
}
@@ -4297,6 +4305,11 @@
this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3
this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP;
}
+ if (this.targetJDK == ClassFileConstants.JDK1_8) {
+ //TODO JAVA8: Version number is not yet updated in the java8 beta...
+ //Remove this after it is upgraded
+ this.targetJDK = ClassFileConstants.JDK1_7;
+ }
this.bytes = null;
this.constantPool.reset();
this.codeStream.reset(this);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index f9b4f3d..b769a69 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Matt McCutchen - partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=122995
@@ -41,8 +45,8 @@
// storage for internal flags (32 bits) BIT USAGE
public final static int Bit1 = 0x1; // return type (operator) | name reference kind (name ref) | add assertion (type decl) | useful empty statement (empty statement)
- public final static int Bit2 = 0x2; // return type (operator) | name reference kind (name ref) | has local type (type, method, field decl)
- public final static int Bit3 = 0x4; // return type (operator) | name reference kind (name ref) | implicit this (this ref)
+ public final static int Bit2 = 0x2; // return type (operator) | name reference kind (name ref) | has local type (type, method, field decl) | if type elided (local)
+ public final static int Bit3 = 0x4; // return type (operator) | name reference kind (name ref) | implicit this (this ref) | is argument(local)
public final static int Bit4 = 0x8; // return type (operator) | first assignment to local (name ref,local decl) | undocumented empty block (block, type and method decl)
public final static int Bit5 = 0x10; // value for return (expression) | has all method bodies (unit) | supertype ref (type ref) | resolved (field decl)
public final static int Bit6 = 0x20; // depth (name ref, msg) | ignore need cast check (cast expression) | error in signature (method declaration/ initializer) | is recovered (annotation reference)
@@ -127,7 +131,9 @@
public static final int RestrictiveFlagMASK = Bit1|Bit2|Bit3;
// for local decls
+ public static final int IsTypeElided = Bit2; // type elided lambda argument.
public static final int IsArgument = Bit3;
+ public static final int IsLocalDeclarationReachable = Bit31;
// for name refs or local decls
public static final int FirstAssignmentToLocal = Bit4;
@@ -148,8 +154,6 @@
public static final int DocumentedFallthrough = Bit30; // switch statement
public static final int DocumentedCasesOmitted = Bit31; // switch statement
- // local decls
- public static final int IsLocalDeclarationReachable = Bit31;
// try statements
public static final int IsSubRoutineEscaping = Bit15;
@@ -278,6 +282,9 @@
public static final int INVOCATION_ARGUMENT_UNCHECKED = 1;
public static final int INVOCATION_ARGUMENT_WILDCARD = 2;
+ // for all declarations that can contain type references that have type annotations
+ public static final int HasTypeAnnotations = Bit21;
+
// for type reference (diamond case) - Java 7
public static final int IsUnionType = Bit30;
// Used to tag ParameterizedSingleTypeReference or ParameterizedQualifiedTypeReference when they are
@@ -578,8 +585,15 @@
public static StringBuffer printAnnotations(Annotation[] annotations, StringBuffer output) {
int length = annotations.length;
for (int i = 0; i < length; i++) {
- annotations[i].print(0, output);
- output.append(" "); //$NON-NLS-1$
+ if (i > 0) {
+ output.append(" "); //$NON-NLS-1$
+ }
+ Annotation annotation2 = annotations[i];
+ if (annotation2 != null) {
+ annotation2.print(0, output);
+ } else {
+ output.append('?');
+ }
}
return output;
}
@@ -691,6 +705,25 @@
local.setAnnotations(annotations, scope);
}
break;
+ case Binding.TYPE_PARAMETER :
+ // jsr308
+ ReferenceBinding typeVariableBinding = (ReferenceBinding) recipient;
+ if ((typeVariableBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
+ typeVariableBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+ if (length > 0) {
+ annotations = new AnnotationBinding[length];
+ typeVariableBinding.setAnnotations(annotations);
+ }
+ break;
+ case Binding.TYPE_USE :
+ ReferenceBinding typeUseBinding = (ReferenceBinding) recipient;
+ if ((typeUseBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
+ typeUseBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+ if (length > 0) {
+ annotations = new AnnotationBinding[length];
+ typeUseBinding.setAnnotations(annotations);
+ }
+ break;
default :
return;
}
@@ -787,6 +820,122 @@
}
}
+ /**
+ * Resolve annotations, and check duplicates, answers combined tagBits
+ * for recognized standard annotations
+ */
+ public static void resolveAnnotations(ClassScope scope, Annotation[] sourceAnnotations, Binding recipient) {
+ AnnotationBinding[] annotations = null;
+ int length = sourceAnnotations == null ? 0 : sourceAnnotations.length;
+ if (recipient != null) {
+ switch (recipient.kind()) {
+ case Binding.PACKAGE :
+ PackageBinding packageBinding = (PackageBinding) recipient;
+ if ((packageBinding.tagBits & TagBits.AnnotationResolved) != 0) return;
+ packageBinding.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+ break;
+ case Binding.TYPE :
+ case Binding.GENERIC_TYPE :
+ ReferenceBinding type = (ReferenceBinding) recipient;
+ if ((type.tagBits & TagBits.AnnotationResolved) != 0) return;
+ type.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+ if (length > 0) {
+ annotations = new AnnotationBinding[length];
+ type.setAnnotations(annotations);
+ }
+ break;
+ case Binding.METHOD :
+ MethodBinding method = (MethodBinding) recipient;
+ if ((method.tagBits & TagBits.AnnotationResolved) != 0) return;
+ method.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+ if (length > 0) {
+ annotations = new AnnotationBinding[length];
+ method.setAnnotations(annotations);
+ }
+ break;
+ case Binding.FIELD :
+ FieldBinding field = (FieldBinding) recipient;
+ if ((field.tagBits & TagBits.AnnotationResolved) != 0) return;
+ field.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+ if (length > 0) {
+ annotations = new AnnotationBinding[length];
+ field.setAnnotations(annotations);
+ }
+ break;
+ case Binding.LOCAL :
+ LocalVariableBinding local = (LocalVariableBinding) recipient;
+ if ((local.tagBits & TagBits.AnnotationResolved) != 0) return;
+ local.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved);
+ if (length > 0) {
+ annotations = new AnnotationBinding[length];
+ local.setAnnotations(annotations, scope);
+ }
+ break;
+ default :
+ return;
+ }
+ }
+ if (sourceAnnotations == null)
+ return;
+ for (int i = 0; i < length; i++) {
+ Annotation annotation = sourceAnnotations[i];
+ final Binding annotationRecipient = annotation.recipient;
+ if (annotationRecipient != null && recipient != null) {
+ // only local and field can share annnotations
+ switch (recipient.kind()) {
+ case Binding.FIELD :
+ FieldBinding field = (FieldBinding) recipient;
+ field.tagBits = ((FieldBinding) annotationRecipient).tagBits;
+ break;
+ case Binding.LOCAL :
+ LocalVariableBinding local = (LocalVariableBinding) recipient;
+ local.tagBits = ((LocalVariableBinding) annotationRecipient).tagBits;
+ break;
+ }
+ if (annotations != null) {
+ // need to fill the instances array
+ annotations[0] = annotation.getCompilerAnnotation();
+ for (int j = 1; j < length; j++) {
+ Annotation annot = sourceAnnotations[j];
+ annotations[j] = annot.getCompilerAnnotation();
+ }
+ }
+ return;
+ } else {
+ annotation.recipient = recipient;
+ annotation.resolveType(scope);
+ // null if receiver is a package binding
+ if (annotations != null) {
+ annotations[i] = annotation.getCompilerAnnotation();
+ }
+ }
+ }
+ // check duplicate annotations
+ if (annotations != null) {
+ AnnotationBinding[] distinctAnnotations = annotations; // only copy after 1st duplicate is detected
+ for (int i = 0; i < length; i++) {
+ AnnotationBinding annotation = distinctAnnotations[i];
+ if (annotation == null) continue;
+ TypeBinding annotationType = annotation.getAnnotationType();
+ boolean foundDuplicate = false;
+ for (int j = i+1; j < length; j++) {
+ AnnotationBinding otherAnnotation = distinctAnnotations[j];
+ if (otherAnnotation == null) continue;
+ if (otherAnnotation.getAnnotationType() == annotationType) {
+ foundDuplicate = true;
+ if (distinctAnnotations == annotations) {
+ System.arraycopy(distinctAnnotations, 0, distinctAnnotations = new AnnotationBinding[length], 0, length);
+ }
+ distinctAnnotations[j] = null; // report it only once
+ scope.problemReporter().duplicateAnnotation(sourceAnnotations[j]);
+ }
+ }
+ if (foundDuplicate) {
+ scope.problemReporter().duplicateAnnotation(sourceAnnotations[i]);
+ }
+ }
+ }
+ }
/**
* Figures if @Deprecated annotation is specified, do not resolve entire annotations.
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
index 0617799..ccaac41 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -14,6 +18,7 @@
* bug 367203 - [compiler][null] detect assigning null to nonnull argument
* bug 365519 - editorial cleanup after bug 186342 and bug 365387
* bug 365531 - [compiler][null] investigate alternative strategy for internally encoding nullness defaults
+ * bug 382353 - [1.8][compiler] Implementation property modifiers should be accepted on default methods.
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
@@ -181,6 +186,8 @@
public int modifiers;
public int modifiersSourceStart;
public Annotation[] annotations;
+ // jsr 308
+ public Annotation[] receiverAnnotations;
public Argument[] arguments;
public TypeReference[] thrownExceptions;
public Statement[] statements;
@@ -571,6 +578,10 @@
}
// SH}
+ public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
+ // do nothing
+ }
+
private void checkArgumentsSize() {
TypeBinding[] parameters = this.binding.parameters;
int size = 1; // an abstract method or a native method cannot be static
@@ -628,6 +639,10 @@
return false;
}
+ public boolean isDefaultMethod() {
+ return false;
+ }
+
public boolean isInitializationMethod() {
return false;
@@ -666,7 +681,10 @@
}
printIndent(tab, output);
printModifiers(this.modifiers, output);
- if (this.annotations != null) printAnnotations(this.annotations, output);
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
TypeParameter[] typeParams = typeParameters();
if (typeParams != null) {
@@ -696,6 +714,10 @@
}
}
output.append(')');
+ if (this.receiverAnnotations != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.receiverAnnotations, output);
+ }
if (this.thrownExceptions != null) {
output.append(" throws "); //$NON-NLS-1$
for (int i = 0; i < this.thrownExceptions.length; i++) {
@@ -753,6 +775,14 @@
// SH}
resolveJavadoc();
resolveAnnotations(this.scope, this.annotations, this.binding);
+ // jsr308
+ if (this.receiverAnnotations != null && this.scope.isStatic) {
+ int last = this.receiverAnnotations.length - 1;
+ this.scope.problemReporter().illegalReceiverAnnotations(this.receiverAnnotations[0],
+ this.receiverAnnotations[last]);
+ }
+ // jsr 308
+ resolveAnnotations(this.scope, this.receiverAnnotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
validateNullAnnotations();
resolveStatements();
// check @Deprecated annotation presence
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
index 8910eb1..15cc54c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
@@ -1,11 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: AbstractVariableDeclaration.java 19881 2009-04-13 23:35:46Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -93,7 +96,10 @@
public StringBuffer printAsExpression(int indent, StringBuffer output) {
printIndent(indent, output);
printModifiers(this.modifiers, output);
- if (this.annotations != null) printAnnotations(this.annotations, output);
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
if (this.type != null) {
this.type.print(0, output).append(' ');
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
index 859ee05..79a0c3b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -15,6 +19,8 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import java.util.Stack;
+
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
@@ -32,6 +38,329 @@
* Annotation
*/
public abstract class Annotation extends Expression {
+
+ /**
+ * Return the location for the corresponding annotation inside the type reference, <code>null</code> if none.
+ */
+ public static int[] getLocations(
+ final TypeReference reference,
+ final Annotation[] primaryAnnotation,
+ final Annotation annotation,
+ final Annotation[][] annotationsOnDimensionsOnExpression) {
+ class LocationCollector extends ASTVisitor {
+ Stack currentIndexes;
+ Annotation currentAnnotation;
+ boolean search = true;
+
+ public LocationCollector(Annotation currentAnnotation) {
+ this.currentIndexes = new Stack();
+ this.currentAnnotation = currentAnnotation;
+ }
+ public boolean visit(ArrayTypeReference typeReference, BlockScope scope) {
+ if (!this.search) return false;
+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ // check if the annotation is located on the first dimension
+ Annotation[] annotations = annotationsOnDimensions[0];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+
+ this.currentIndexes.push(new Integer(0));
+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
+ annotations = annotationsOnDimensions[i];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
+ }
+ }
+ Annotation[] annotations = typeReference.annotations;
+ if (annotations == null) {
+ annotations = primaryAnnotation;
+ }
+ if (annotations != null) {
+ for (int i = 0; i < annotations.length; i++) {
+ Annotation current = annotations[i];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ this.currentIndexes.pop();
+ return true;
+ }
+ public boolean visit(ArrayQualifiedTypeReference typeReference, BlockScope scope) {
+ if (!this.search) return false;
+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ // check if the annotation is located on the first dimension
+ Annotation[] annotations = annotationsOnDimensions[0];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+
+ this.currentIndexes.push(new Integer(0));
+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
+ annotations = annotationsOnDimensions[i];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
+ }
+ }
+ Annotation[] annotations = typeReference.annotations;
+ if (annotations == null) {
+ annotations = primaryAnnotation;
+ }
+ if (annotations != null) {
+ for (int i = 0; i < annotations.length; i++) {
+ Annotation current = annotations[i];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ this.currentIndexes.pop();
+ return true;
+ }
+ public boolean visit(ParameterizedSingleTypeReference typeReference, BlockScope scope) {
+ if (!this.search) return false;
+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ // check if the annotation is located on the first dimension
+ Annotation[] annotations = annotationsOnDimensions[0];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+
+ this.currentIndexes.push(new Integer(0));
+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
+ annotations = annotationsOnDimensions[i];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
+ }
+ }
+ Annotation[] annotations = typeReference.annotations;
+ if (annotations == null) {
+ annotations = primaryAnnotation;
+ }
+ if (annotations != null) {
+ for (int i = 0; i < annotations.length; i++) {
+ Annotation current = annotations[i];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ TypeReference[] typeReferences = typeReference.typeArguments;
+ this.currentIndexes.push(new Integer(0));
+ for (int i = 0, max = typeReferences.length; i < max; i++) {
+ typeReferences[i].traverse(this, scope);
+ if (!this.search) return false;
+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
+ }
+ this.currentIndexes.pop();
+ return true;
+ }
+ public boolean visit(ParameterizedQualifiedTypeReference typeReference, BlockScope scope) {
+ if (!this.search) return false;
+ Annotation[][] annotationsOnDimensions = typeReference.annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ // check if the annotation is located on the first dimension
+ Annotation[] annotations = annotationsOnDimensions[0];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+
+ this.currentIndexes.push(new Integer(0));
+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
+ annotations = annotationsOnDimensions[i];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
+ }
+ }
+ Annotation[] annotations = typeReference.annotations;
+ if (annotations == null) {
+ annotations = primaryAnnotation;
+ }
+ if (annotations != null) {
+ for (int i = 0; i < annotations.length; i++) {
+ Annotation current = annotations[i];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ //TODO it is unclear how to manage annotations located in the first type arguments
+ TypeReference[] typeReferences = typeReference.typeArguments[typeReference.typeArguments.length - 1];
+ this.currentIndexes.push(new Integer(0));
+ for (int i = 0, max = typeReferences.length; i < max; i++) {
+ typeReferences[i].traverse(this, scope);
+ if (!this.search) return false;
+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
+ }
+ this.currentIndexes.pop();
+ return true;
+ }
+ public boolean visit(SingleTypeReference typeReference, BlockScope scope) {
+ if (!this.search) return false;
+ Annotation[][] annotationsOnDimensions = annotationsOnDimensionsOnExpression;
+ if (annotationsOnDimensions != null) {
+ // check if the annotation is located on the first dimension
+ Annotation[] annotations = annotationsOnDimensions[0];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+
+ this.currentIndexes.push(new Integer(0));
+ for (int i = 1, max = annotationsOnDimensions.length; i < max; i++) {
+ annotations = annotationsOnDimensions[i];
+ if (annotations != null) {
+ for (int j = 0, max2 = annotations.length; j < max2; j++) {
+ Annotation current = annotations[j];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ this.currentIndexes.push(new Integer(((Integer) this.currentIndexes.pop()).intValue() + 1));
+ }
+ }
+ Annotation[] annotations = typeReference.annotations;
+ if (annotations != null) {
+ for (int i = 0; i < annotations.length; i++) {
+ Annotation current = annotations[i];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ return false;
+ }
+ public boolean visit(Wildcard typeReference, BlockScope scope) {
+ if (!this.search) return false;
+ TypeReference bound = typeReference.bound;
+ bound.traverse(this, scope);
+ return true;
+ }
+ public boolean visit(QualifiedTypeReference typeReference, BlockScope scope) {
+ if (!this.search) return false;
+ Annotation[] annotations = typeReference.annotations;
+ if (annotations != null) {
+ for (int i = 0; i < annotations.length; i++) {
+ Annotation current = annotations[i];
+ if (current == this.currentAnnotation) {
+ this.search = false;
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer
+ .append("search location for ") //$NON-NLS-1$
+ .append(this.currentAnnotation)
+ .append("\ncurrent indexes : ") //$NON-NLS-1$
+ .append(this.currentIndexes);
+ return String.valueOf(buffer);
+ }
+ }
+ if (reference == null) return null;
+ LocationCollector collector = new LocationCollector(annotation);
+ reference.traverse(collector, (BlockScope) null);
+ if (collector.currentIndexes.isEmpty()) {
+ return null;
+ }
+ int size = collector.currentIndexes.size();
+ int[] result = new int[size];
+ for (int i = 0; i < size; i++) {
+ result[size - i - 1] = ((Integer) collector.currentIndexes.pop()).intValue();
+ }
+ return result;
+ }
+
+ // jsr 308
+ public static class TypeUseBinding extends ReferenceBinding {
+ private int kind;
+ public TypeUseBinding(int kind) {
+ this.tagBits = 0L;
+ this.kind = kind;
+ }
+ public int kind() {
+ return this.kind;
+ }
+ public boolean hasTypeBit(int bit) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+ }
final static MemberValuePair[] NoValuePairs = new MemberValuePair[0];
private static final long TAGBITS_NULLABLE_OR_NONNULL = TagBits.AnnotationNullable|TagBits.AnnotationNonNull;
@@ -98,6 +427,10 @@
case 'T' :
if (CharOperation.equals(elementName, TypeConstants.TYPE))
return TagBits.AnnotationForType;
+ if (CharOperation.equals(elementName, TypeConstants.TYPE_USE_TARGET))
+ return TagBits.AnnotationForTypeUse;
+ if (CharOperation.equals(elementName, TypeConstants.TYPE_PARAMETER_TARGET))
+ return TagBits.AnnotationForTypeParameter;
break;
}
return 0; // unknown
@@ -214,18 +547,62 @@
return false;
}
long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference
+ // jsr 308
+ // we need to filter out type use and type parameter annotations
+ if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {
+ return false;
+ }
+
if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
return true; // by default the retention is CLASS
return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
}
+ public boolean isRuntimeTypeInvisible() {
+ final TypeBinding annotationBinding = this.resolvedType;
+ if (annotationBinding == null) {
+ return false;
+ }
+ long metaTagBits = annotationBinding.getAnnotationTagBits(); // could be forward reference
+ // jsr 308
+ // we need to filter out type use and type parameter annotations
+ if ((metaTagBits & (TagBits.AnnotationTargetMASK)) != 0
+ && ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) == 0)) {
+ return false;
+ }
+
+ if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
+ return true; // by default the retention is CLASS
+
+ return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationClassRetention;
+ }
+
+ public boolean isRuntimeTypeVisible() {
+ final TypeBinding annotationBinding = this.resolvedType;
+ if (annotationBinding == null) {
+ return false;
+ }
+ long metaTagBits = annotationBinding.getAnnotationTagBits();
+ if ((metaTagBits & (TagBits.AnnotationTargetMASK)) != 0
+ && ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) == 0)) {
+ return false;
+ }
+ if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
+ return false; // by default the retention is CLASS
+
+ return (metaTagBits & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention;
+ }
+
public boolean isRuntimeVisible() {
final TypeBinding annotationBinding = this.resolvedType;
if (annotationBinding == null) {
return false;
}
long metaTagBits = annotationBinding.getAnnotationTagBits();
+ if ((metaTagBits & (TagBits.AnnotationForTypeParameter | TagBits.AnnotationForTypeUse)) != 0) {
+ return false;
+ }
if ((metaTagBits & TagBits.AnnotationRetentionMASK) == 0)
return false; // by default the retention is CLASS
@@ -282,7 +659,6 @@
break pairLoop;
}
}
-
if (isSuppressingWarnings && suppressWarningIrritants != null) {
scope.referenceCompilationUnit().recordSuppressWarnings(suppressWarningIrritants, this, startSuppresss, endSuppress);
}
@@ -354,16 +730,19 @@
}
}
}
- if (!foundValue &&
- (method.modifiers & ClassFileConstants.AccAnnotationDefault) == 0 &&
- (this.bits & IsRecovered) == 0) {
+ if (!foundValue
+ && (method.modifiers & ClassFileConstants.AccAnnotationDefault) == 0
+ && (this.bits & IsRecovered) == 0
+ && annotationType.isValidBinding()) {
scope.problemReporter().missingValueForAnnotationMember(this, selector);
}
}
// check unused pairs
for (int i = 0; i < pairsLength; i++) {
if (pairs[i] != null) {
- scope.problemReporter().undefinedAnnotationValue(annotationType, pairs[i]);
+ if (annotationType.isValidBinding()) {
+ scope.problemReporter().undefinedAnnotationValue(annotationType, pairs[i]);
+ }
pairs[i].resolveTypeExpecting(scope, null); // resilient
}
}
@@ -375,9 +754,10 @@
// record annotation positions in the compilation result
scope.referenceCompilationUnit().recordSuppressWarnings(IrritantSet.NLS, null, this.sourceStart, this.declarationSourceEnd);
if (this.recipient != null) {
+ int kind = this.recipient.kind();
if (tagBits != 0) {
// tag bits onto recipient
- switch (this.recipient.kind()) {
+ switch (kind) {
case Binding.PACKAGE :
((PackageBinding)this.recipient).tagBits |= tagBits;
break;
@@ -450,19 +830,35 @@
}
// check (meta)target compatibility
checkTargetCompatibility: {
- long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
- if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) // does not specify any target restriction
+ if (!annotationType.isValidBinding()) {
+ // no need to check annotation usage if missing
break checkTargetCompatibility;
+ }
- switch (this.recipient.kind()) {
+ long metaTagBits = annotationType.getAnnotationTagBits(); // could be forward reference
+ if ((metaTagBits & TagBits.AnnotationTargetMASK) == 0) {
+ // does not specify any target restriction - all locations supported in Java 7 and before are possible
+ if (kind == Binding.TYPE_PARAMETER || kind == Binding.TYPE_USE) {
+ scope.problemReporter().explitAnnotationTargetRequired(this);
+ }
+ break checkTargetCompatibility;
+ }
+
+ switch (kind) {
case Binding.PACKAGE :
if ((metaTagBits & TagBits.AnnotationForPackage) != 0)
break checkTargetCompatibility;
break;
+ case Binding.TYPE_USE :
+ if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
+ // jsr 308
+ break checkTargetCompatibility;
+ }
+ break;
case Binding.TYPE :
case Binding.GENERIC_TYPE :
if (((ReferenceBinding)this.recipient).isAnnotationType()) {
- if ((metaTagBits & (TagBits.AnnotationForAnnotationType|TagBits.AnnotationForType)) != 0)
+ if ((metaTagBits & (TagBits.AnnotationForAnnotationType | TagBits.AnnotationForType)) != 0)
break checkTargetCompatibility;
} else if ((metaTagBits & TagBits.AnnotationForType) != 0) {
break checkTargetCompatibility;
@@ -477,11 +873,19 @@
// SH}
break;
case Binding.METHOD :
- if (((MethodBinding)this.recipient).isConstructor()) {
+ MethodBinding methodBinding = (MethodBinding) this.recipient;
+ if (methodBinding.isConstructor()) {
if ((metaTagBits & TagBits.AnnotationForConstructor) != 0)
break checkTargetCompatibility;
- } else if ((metaTagBits & TagBits.AnnotationForMethod) != 0)
+ } else if ((metaTagBits & TagBits.AnnotationForMethod) != 0) {
break checkTargetCompatibility;
+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
+ // jsr 308 - annotation on method return type
+ if (methodBinding.returnType != null && methodBinding.returnType.id == T_void) {
+ scope.problemReporter().illegalUsageOfTypeAnnotations(this);
+ }
+ break checkTargetCompatibility;
+ }
break;
//{ObjectTeams: method mappings
// TODO(SH): should annotations for method mappings be controlled separately?
@@ -491,17 +895,33 @@
break;
// SH}
case Binding.FIELD :
- if ((metaTagBits & TagBits.AnnotationForField) != 0)
+ if ((metaTagBits & TagBits.AnnotationForField) != 0) {
break checkTargetCompatibility;
+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
+ // jsr 308 - annotation on field type
+ break checkTargetCompatibility;
+ }
break;
case Binding.LOCAL :
if ((((LocalVariableBinding)this.recipient).tagBits & TagBits.IsArgument) != 0) {
- if ((metaTagBits & TagBits.AnnotationForParameter) != 0)
+ if ((metaTagBits & TagBits.AnnotationForParameter) != 0) {
break checkTargetCompatibility;
- } else if ((annotationType.tagBits & TagBits.AnnotationForLocalVariable) != 0)
+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
+ // jsr 308 - annotation on method parameter type
+ break checkTargetCompatibility;
+ }
+ } else if ((annotationType.tagBits & TagBits.AnnotationForLocalVariable) != 0) {
break checkTargetCompatibility;
+ } else if ((metaTagBits & TagBits.AnnotationForTypeUse) != 0) {
+ // jsr 308 - annotation on local type
+ break checkTargetCompatibility;
+ }
break;
- }
+ case Binding.TYPE_PARAMETER : // jsr308
+ if ((metaTagBits & TagBits.AnnotationForTypeParameter) != 0) {
+ break checkTargetCompatibility;
+ }
+ }
scope.problemReporter().disallowedTargetForAnnotation(this);
}
}
@@ -510,4 +930,5 @@
public abstract void traverse(ASTVisitor visitor, BlockScope scope);
+ public abstract void traverse(ASTVisitor visitor, ClassScope scope);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
index 8860ec6..69840bb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -55,7 +59,10 @@
printIndent(tab, output);
printModifiers(this.modifiers, output);
- if (this.annotations != null) printAnnotations(this.annotations, output);
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
TypeParameter[] typeParams = typeParameters();
if (typeParams != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
index f00b176..f6af465 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -41,9 +45,24 @@
this.declarationSourceEnd = (int) posNom;
this.modifiers = modifiers;
this.type = tr;
+ if (tr != null) {
+ this.bits |= (tr.bits & ASTNode.HasTypeAnnotations);
+ }
this.bits |= (IsLocalDeclarationReachable | IsArgument);
}
+ public Argument(char[] name, long posNom, TypeReference tr, int modifiers, boolean typeElided) {
+
+ super(name, (int) (posNom >>> 32), (int) posNom);
+ this.declarationSourceEnd = (int) posNom;
+ this.modifiers = modifiers;
+ this.type = tr;
+ if (tr != null) {
+ this.bits |= (tr.bits & ASTNode.HasTypeAnnotations);
+ }
+ this.bits |= (IsLocalDeclarationReachable | IsArgument | IsTypeElided);
+ }
+
//{ObjectTeams: consistent updating of name
public void updateName(char[] newName) {
this.name = newName;
@@ -128,6 +147,10 @@
return (this.bits & ASTNode.IsArgument) != 0 ? PARAMETER : LOCAL_VARIABLE;
}
+ public boolean isArgument() {
+ return true;
+ }
+
public boolean isVarArgs() {
return this.type != null && (this.type.bits & IsVarArgs) != 0;
}
@@ -136,7 +159,10 @@
printIndent(indent, output);
printModifiers(this.modifiers, output);
- if (this.annotations != null) printAnnotations(this.annotations, output);
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
if (this.type == null) {
output.append("<no type> "); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
index 1e3c61a..86d750f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java
@@ -4,8 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: ArrayAllocationExpression.java 23404 2010-02-03 14:10:22Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for bug 319201 - [null] no warning when unboxing SingleNameReference causes NPE
@@ -35,6 +38,7 @@
//dimensions.length gives the number of dimensions, but the
// last ones may be nulled as in new int[4][5][][]
public Expression[] dimensions;
+ public Annotation [][] annotationsOnDimensions; // jsr308 style annotations.
public ArrayInitializer initializer;
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
@@ -94,6 +98,11 @@
output.append("new "); //$NON-NLS-1$
this.type.print(0, output);
for (int i = 0; i < this.dimensions.length; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(' ');
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(' ');
+ }
if (this.dimensions[i] == null)
output.append("[]"); //$NON-NLS-1$
else {
@@ -177,6 +186,12 @@
return null;
}
}
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations = this.annotationsOnDimensions[i];
+ resolveAnnotations(scope, annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ }
+ }
return this.resolvedType;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
index 8ad408c..09ae845 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Technical University Berlin - extended API and implementation
@@ -18,6 +22,7 @@
public class ArrayQualifiedTypeReference extends QualifiedTypeReference {
int dimensions;
+ Annotation[][] annotationsOnDimensions; // jsr308 style type annotations on dimensions
//{ObjectTeams: mark generated reference:
public ArrayQualifiedTypeReference(char[][] sources , int dim, long[] poss, boolean isGenerated) {
@@ -29,12 +34,23 @@
super( sources , poss);
this.dimensions = dim ;
+ this.annotationsOnDimensions = null;
+ }
+
+ public ArrayQualifiedTypeReference(char[][] sources, int dim, Annotation[][] annotationsOnDimensions, long[] poss) {
+ this(sources, dim, poss);
+ this.annotationsOnDimensions = annotationsOnDimensions;
+ this.bits |= ASTNode.HasTypeAnnotations;
}
public int dimensions() {
return this.dimensions;
}
+
+ public Annotation[][] getAnnotationsOnDimensions() {
+ return this.annotationsOnDimensions;
+ }
/**
* @return char[][]
@@ -77,16 +93,47 @@
}
}
+ protected TypeBinding internalResolveType(Scope scope) {
+ TypeBinding internalResolveType = super.internalResolveType(scope);
+ if (this.annotationsOnDimensions != null) {
+ switch(scope.kind) {
+ case Scope.BLOCK_SCOPE :
+ case Scope.METHOD_SCOPE :
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
+ resolveAnnotations((BlockScope) scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ }
+ break;
+ }
+ }
+ return internalResolveType;
+ }
+
public StringBuffer printExpression(int indent, StringBuffer output){
super.printExpression(indent, output);
if ((this.bits & IsVarArgs) != 0) {
for (int i= 0 ; i < this.dimensions - 1; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(' ');
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(' ');
+ }
output.append("[]"); //$NON-NLS-1$
}
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
+ output.append(' ');
+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
+ output.append(' ');
+ }
output.append("..."); //$NON-NLS-1$
} else {
for (int i= 0 ; i < this.dimensions; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("[]"); //$NON-NLS-1$
}
}
@@ -94,14 +141,52 @@
}
public void traverse(ASTVisitor visitor, BlockScope scope) {
-
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
+ }
visitor.endVisit(this, scope);
}
public void traverse(ASTVisitor visitor, ClassScope scope) {
-
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
+ }
visitor.endVisit(this, scope);
}
+
+ protected void resolveAnnotations(BlockScope scope) {
+ super.resolveAnnotations(scope);
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
+ resolveAnnotations(scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ }
+ }
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
index fa6c8d5..18f9ce8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -12,6 +16,7 @@
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
+import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.eclipse.jdt.internal.compiler.lookup.Scope;
@@ -19,6 +24,7 @@
public class ArrayTypeReference extends SingleTypeReference {
public int dimensions;
+ public Annotation[][] annotationsOnDimensions; // jsr308 style type annotations on dimensions.
public int originalSourceEnd;
/**
@@ -32,12 +38,25 @@
super(source, pos);
this.originalSourceEnd = this.sourceEnd;
this.dimensions = dimensions ;
+ this.annotationsOnDimensions = null;
+ }
+
+ public ArrayTypeReference(char[] source, int dimensions, Annotation[][] annotationsOnDimensions, long pos) {
+ this(source, dimensions, pos);
+ if (annotationsOnDimensions != null) {
+ this.bits |= ASTNode.HasTypeAnnotations;
+ }
+ this.annotationsOnDimensions = annotationsOnDimensions;
}
public int dimensions() {
return this.dimensions;
}
+
+ public Annotation[][] getAnnotationsOnDimensions() {
+ return this.annotationsOnDimensions;
+ }
/**
* @return char[][]
*/
@@ -69,11 +88,26 @@
super.printExpression(indent, output);
if ((this.bits & IsVarArgs) != 0) {
for (int i= 0 ; i < this.dimensions - 1; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(' ');
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(' ');
+ }
output.append("[]"); //$NON-NLS-1$
}
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
+ output.append(' ');
+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
+ output.append(' ');
+ }
output.append("..."); //$NON-NLS-1$
} else {
for (int i= 0 ; i < this.dimensions; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("[]"); //$NON-NLS-1$
}
}
@@ -81,14 +115,71 @@
}
public void traverse(ASTVisitor visitor, BlockScope scope) {
-
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ if (annotations2 != null) {
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
+ }
+ }
visitor.endVisit(this, scope);
}
public void traverse(ASTVisitor visitor, ClassScope scope) {
-
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ if (annotations2 != null) {
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
+ }
+ }
visitor.endVisit(this, scope);
}
+
+ protected TypeBinding internalResolveType(Scope scope) {
+ TypeBinding internalResolveType = super.internalResolveType(scope);
+ if (this.annotationsOnDimensions != null) {
+ switch(scope.kind) {
+ case Scope.BLOCK_SCOPE :
+ case Scope.METHOD_SCOPE :
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
+ resolveAnnotations((BlockScope) scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ }
+ break;
+ }
+ }
+ return internalResolveType;
+ }
+ protected void resolveAnnotations(BlockScope scope) {
+ super.resolveAnnotations(scope);
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotationsOnDimension = this.annotationsOnDimensions[i];
+ resolveAnnotations(scope, annotationsOnDimension, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ }
+ }
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
index ab7f28f..5476beb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
@@ -4,7 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: CastExpression.java 23405 2010-02-03 17:02:18Z stephan $
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -562,9 +565,15 @@
}
public StringBuffer printExpression(int indent, StringBuffer output) {
+ int parenthesesCount = (this.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
+ String suffix = ""; //$NON-NLS-1$
+ for(int i = 0; i < parenthesesCount; i++) {
+ output.append('(');
+ suffix += ')';
+ }
output.append('(');
this.type.print(0, output).append(") "); //$NON-NLS-1$
- return this.expression.printExpression(0, output);
+ return this.expression.printExpression(0, output).append(suffix);
}
public TypeBinding resolveType(BlockScope scope) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
index 00d6a11..12f1ba6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
@@ -4,8 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: FieldDeclaration.java 23404 2010-02-03 14:10:22Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -13,10 +16,13 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import java.util.List;
+
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.impl.*;
+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
@@ -146,7 +152,13 @@
}
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
-
+public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
+ for (int i = 0, max = this.annotations.length; i < max; i++) {
+ Annotation annotation = this.annotations[i];
+ annotation.traverse(collector, (BlockScope) null);
+ }
+}
/**
* @see org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclaration#getKind()
*/
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
index 6cb2c16..8a14ea4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
@@ -5,6 +5,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -87,7 +90,10 @@
if (this.modifiers != 0) {
printIndent(indent, output);
printModifiers(this.modifiers, output);
- if (this.annotations != null) printAnnotations(this.annotations, output);
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
output.append("{\n"); //$NON-NLS-1$
if (this.block != null) {
this.block.printBody(indent, output);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java
index 696a693..7f985aa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -30,6 +34,10 @@
public TypeReference copyDims(int dim) {
return null;
}
+
+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) {
+ return null;
+ }
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.compiler.ast.TypeReference#getTypeBinding(org.eclipse.jdt.internal.compiler.lookup.Scope)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
new file mode 100644
index 0000000..25b0f2b
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.compiler.ast;
+
+public class LambdaExpression extends NullLiteral { // For the time being.
+ Argument [] arguments;
+ Statement body;
+
+ public LambdaExpression(Argument [] arguments, Statement body) {
+ super(0, 0);
+ this.arguments = arguments;
+ this.body = body;
+ }
+
+ public StringBuffer printExpression(int tab, StringBuffer output) {
+ int parenthesesCount = (this.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT;
+ String suffix = ""; //$NON-NLS-1$
+ for(int i = 0; i < parenthesesCount; i++) {
+ output.append('(');
+ suffix += ')';
+ }
+ output.append('(');
+ if (this.arguments != null) {
+ for (int i = 0; i < this.arguments.length; i++) {
+ if (i > 0) output.append(", "); //$NON-NLS-1$
+ this.arguments[i].print(0, output);
+ }
+ }
+ output.append(") -> " ); //$NON-NLS-1$
+ this.body.print(this.body instanceof Block ? tab : 0, output);
+ return output.append(suffix);
+ }
+}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
index 7aa2afc..e3d72a2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
@@ -4,8 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: LocalDeclaration.java 23405 2010-02-03 17:02:18Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -22,8 +25,11 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import java.util.List;
+
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.impl.*;
+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
@@ -245,6 +251,22 @@
return LOCAL_VARIABLE;
}
+ // for local variables
+ public void getAllAnnotationContexts(int targetType, LocalVariableBinding localVariable, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, localVariable, allAnnotationContexts);
+ this.traverse(collector, (BlockScope) null);
+ }
+ // for arguments
+ public void getAllAnnotationContexts(int targetType, int parameterIndex, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, parameterIndex, allAnnotationContexts);
+ this.traverse(collector, (BlockScope) null);
+ }
+ public boolean isArgument() {
+ return false;
+ }
+ public boolean isReceiver() {
+ return false;
+ }
public void resolve(BlockScope scope) {
//{ObjectTeams: avoid duplicate resolving:
TypeBinding variableType = null;
@@ -367,6 +389,11 @@
}
// only resolve annotation at the end, for constant to be positioned before (96991)
resolveAnnotations(scope, this.annotations, this.binding);
+ // jsr 308
+ Annotation[] typeAnnotations = this.type.annotations;
+ if (typeAnnotations != null) {
+ ASTNode.resolveAnnotations(scope, typeAnnotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ }
scope.validateNullAnnotation(this.binding.tagBits, this.type, this.annotations);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java
index 2a48484..eae5b91 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -42,4 +46,12 @@
}
visitor.endVisit(this, scope);
}
+ public void traverse(ASTVisitor visitor, ClassScope scope) {
+ if (visitor.visit(this, scope)) {
+ if (this.type != null) {
+ this.type.traverse(visitor, scope);
+ }
+ }
+ visitor.endVisit(this, scope);
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java
index e0f7cfb..53c7b16 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contributions for
@@ -17,6 +21,7 @@
import org.eclipse.jdt.internal.compiler.impl.Constant;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.eclipse.jdt.internal.compiler.lookup.ElementValuePair;
import org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
@@ -241,4 +246,12 @@
}
visitor.endVisit(this, scope);
}
+ public void traverse(ASTVisitor visitor, ClassScope scope) {
+ if (visitor.visit(this, scope)) {
+ if (this.value != null) {
+ this.value.traverse(visitor, scope);
+ }
+ }
+ visitor.endVisit(this, scope);
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
index 882980c..34a75e1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
@@ -4,8 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: MethodDeclaration.java 23404 2010-02-03 14:10:22Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -15,12 +18,15 @@
* bug 186342 - [compiler][null] Using annotations for null checking
* bug 365519 - editorial cleanup after bug 186342 and bug 365387
* bug 368546 - [compiler][resource] Avoid remaining false positives found when compiling the Eclipse SDK
+ * bug 382353 - [1.8][compiler] Implementation property modifiers should be accepted on default methods.
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
import static org.eclipse.objectteams.otdt.core.compiler.IOTConstants.CALLIN_FLAG_DEFINITELY_MISSING_BASECALL;
import static org.eclipse.objectteams.otdt.core.compiler.IOTConstants.CALLIN_FLAG_POTENTIALLY_MISSING_BASECALL;
+import java.util.List;
+
import org.eclipse.jdt.core.compiler.*;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.CompilationResult;
@@ -30,6 +36,7 @@
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
+import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers;
import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
@@ -41,6 +48,7 @@
import org.eclipse.jdt.internal.compiler.parser.Parser;
import org.eclipse.jdt.internal.compiler.problem.AbortMethod;
import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities;
+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
import org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseCallTrackingVariable;
import org.eclipse.objectteams.otdt.internal.core.compiler.ast.GuardPredicateDeclaration;
@@ -138,6 +146,7 @@
if (this.arguments != null) {
for (int i = 0, count = this.arguments.length; i < count; i++) {
+ this.bits |= (this.arguments[i].bits & ASTNode.HasTypeAnnotations);
// if this method uses a type parameter declared by the declaring class,
// it can't be static. https://bugs.eclipse.org/bugs/show_bug.cgi?id=318682
if (this.arguments[i].binding != null && (this.arguments[i].binding.type instanceof TypeVariableBinding)) {
@@ -218,6 +227,18 @@
}
// SH}
+ public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
+ for (int i = 0, max = this.annotations.length; i < max; i++) {
+ Annotation annotation = this.annotations[i];
+ annotation.traverse(collector, (BlockScope) null);
+ }
+ }
+
+ public boolean isDefaultMethod() {
+ return (this.modifiers & ExtraCompilerModifiers.AccDefaultMethod) != 0;
+ }
+
public boolean isMethod() {
return true;
}
@@ -235,6 +256,7 @@
public void resolveStatements() {
// ========= abort on fatal error =============
if (this.returnType != null && this.binding != null) {
+ this.bits |= (this.returnType.bits & ASTNode.HasTypeAnnotations);
this.returnType.resolvedType = this.binding.returnType;
// record the return type binding
}
@@ -252,7 +274,10 @@
}
if (this.typeParameters != null) {
for (int i = 0, length = this.typeParameters.length; i < length; i++) {
- this.typeParameters[i].resolve(this.scope);
+ TypeParameter typeParameter = this.typeParameters[i];
+ this.bits |= (typeParameter.bits & ASTNode.HasTypeAnnotations);
+ typeParameter.resolve(this.scope);
+ typeParameter.resolveAnnotations(this.scope);
if (returnsUndeclTypeVar && this.typeParameters[i].binding == this.returnType.resolvedType) {
returnsUndeclTypeVar = false;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java
index a1d1bd1..381cc9a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -71,4 +75,17 @@
}
visitor.endVisit(this, scope);
}
+ public void traverse(ASTVisitor visitor, ClassScope scope) {
+ if (visitor.visit(this, scope)) {
+ if (this.type != null) {
+ this.type.traverse(visitor, scope);
+ }
+ if (this.memberValuePairs != null) {
+ int memberValuePairsLength = this.memberValuePairs.length;
+ for (int i = 0; i < memberValuePairsLength; i++)
+ this.memberValuePairs[i].traverse(visitor, scope);
+ }
+ }
+ visitor.endVisit(this, scope);
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
index bf41a61..081fec2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for Bug 342671 - ClassCastException: org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.ArrayBinding
@@ -53,6 +57,13 @@
super(tokens, dim, positions);
this.typeArguments = typeArguments;
}
+ public ParameterizedQualifiedTypeReference(char[][] tokens, TypeReference[][] typeArguments, int dim, Annotation[][] annotationsOnDimensions, long[] positions) {
+ this(tokens, typeArguments, dim, positions);
+ this.annotationsOnDimensions = annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ this.bits |= ASTNode.HasTypeAnnotations;
+ }
+ }
public void checkBounds(Scope scope) {
if (this.resolvedType == null) return;
@@ -78,6 +89,17 @@
public TypeReference copyDims(int dim){
return new ParameterizedQualifiedTypeReference(this.tokens, this.typeArguments, dim, this.sourcePositions);
}
+ public TypeReference copyDims(int dim, Annotation[][] dimensionAnnotations){
+ ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(this.tokens, this.typeArguments, dim, dimensionAnnotations, this.sourcePositions);
+ parameterizedQualifiedTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
+ if (dimensionAnnotations != null) {
+ parameterizedQualifiedTypeReference.bits |= ASTNode.HasTypeAnnotations;
+ }
+ return parameterizedQualifiedTypeReference;
+ }
+ public boolean isParameterizedTypeReference() {
+ return true;
+ }
/**
* @return char[][]
@@ -147,6 +169,14 @@
}
}
this.bits |= ASTNode.DidResolve;
+ if (this.annotations != null) {
+ switch(scope.kind) {
+ case Scope.BLOCK_SCOPE :
+ case Scope.METHOD_SCOPE :
+ resolveAnnotations((BlockScope) scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ break;
+ }
+ }
TypeBinding type = internalResolveLeafType(scope, checkBounds);
createArrayType(scope);
return type == null ? type : this.resolvedType;
@@ -318,6 +348,11 @@
}
public StringBuffer printExpression(int indent, StringBuffer output) {
+ if (this.annotations != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
int length = this.tokens.length;
for (int i = 0; i < length - 1; i++) {
output.append(this.tokens[i]);
@@ -354,11 +389,26 @@
}
if ((this.bits & IsVarArgs) != 0) {
for (int i= 0 ; i < this.dimensions - 1; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("[]"); //$NON-NLS-1$
}
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("..."); //$NON-NLS-1$
} else {
for (int i= 0 ; i < this.dimensions; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("[]"); //$NON-NLS-1$
}
}
@@ -373,6 +423,20 @@
}
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
for (int i = 0, max = this.typeArguments.length; i < max; i++) {
if (this.typeArguments[i] != null) {
for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {
@@ -386,6 +450,20 @@
public void traverse(ASTVisitor visitor, ClassScope scope) {
if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
for (int i = 0, max = this.typeArguments.length; i < max; i++) {
if (this.typeArguments[i] != null) {
for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
index 187978d..59b8733 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contribution for Bug 342671 - ClassCastException: org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.ArrayBinding
@@ -60,6 +64,13 @@
this.originalSourceEnd = this.sourceEnd;
this.typeArguments = typeArguments;
}
+ public ParameterizedSingleTypeReference(char[] name, TypeReference[] typeArguments, int dim, Annotation[][] annotationsOnDimensions, long pos) {
+ this(name, typeArguments, dim, pos);
+ this.annotationsOnDimensions = annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ this.bits |= ASTNode.HasTypeAnnotations;
+ }
+ }
public void checkBounds(Scope scope) {
if (this.resolvedType == null) return;
@@ -79,6 +90,14 @@
public TypeReference copyDims(int dim) {
return new ParameterizedSingleTypeReference(this.token, this.typeArguments, dim, (((long)this.sourceStart)<<32)+this.sourceEnd);
}
+ public TypeReference copyDims(int dim, Annotation [][] annotationsOnDims) {
+ ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.token, this.typeArguments, dim, annotationsOnDims, (((long)this.sourceStart)<<32)+this.sourceEnd);
+ parameterizedSingleTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
+ if (annotationsOnDims != null) {
+ parameterizedSingleTypeReference.bits |= ASTNode.HasTypeAnnotations;
+ }
+ return parameterizedSingleTypeReference;
+ }
/**
* @return char[][]
@@ -117,6 +136,10 @@
protected TypeBinding getTypeBinding(Scope scope) {
return null; // not supported here - combined with resolveType(...)
}
+
+ public boolean isParameterizedTypeReference() {
+ return true;
+ }
/*
* No need to check for reference to raw type per construction
@@ -142,6 +165,14 @@
}
}
this.bits |= ASTNode.DidResolve;
+ if (this.annotations != null) {
+ switch(scope.kind) {
+ case Scope.BLOCK_SCOPE :
+ case Scope.METHOD_SCOPE :
+ resolveAnnotations((BlockScope) scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ break;
+ }
+ }
//{ObjectTeams: check team anchor first:
for (int typeParamPos=0; typeParamPos<this.typeArguments.length; typeParamPos++) {
if (this.typeArguments[typeParamPos] instanceof TypeAnchorReference)
@@ -219,7 +250,7 @@
}
TypeBinding type = internalResolveLeafType(importScope, scope, enclosingType, checkBounds);
/* orig:
- TypeBinding type = internalResolveLeafType(enclosingType, checkBounds);
+ TypeBinding type = internalResolveLeafType(scope, enclosingType, checkBounds);
:giro */
// SH}
// handle three different outcomes:
@@ -321,6 +352,7 @@
TypeBinding argType = isClassScope
? typeArgument.resolveTypeArgument((ClassScope) scope, currentOriginal, i)
: typeArgument.resolveTypeArgument((BlockScope) scope, currentOriginal, i);
+ this.bits |= (typeArgument.bits & ASTNode.HasTypeAnnotations);
if (argType == null) {
argHasError = true;
} else {
@@ -399,8 +431,19 @@
}
return type;
}
+
+ protected void resolveAnnotations(BlockScope scope) {
+ super.resolveAnnotations(scope);
+ for (int i = 0, length = this.typeArguments.length; i < length; i++) {
+ this.typeArguments[i].resolveAnnotations(scope);
+ }
+ }
public StringBuffer printExpression(int indent, StringBuffer output){
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
output.append(this.token);
output.append("<"); //$NON-NLS-1$
int length = this.typeArguments.length;
@@ -425,11 +468,26 @@
output.append(">"); //$NON-NLS-1$
if ((this.bits & IsVarArgs) != 0) {
for (int i= 0 ; i < this.dimensions - 1; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("[]"); //$NON-NLS-1$
}
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[this.dimensions - 1] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[this.dimensions - 1], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("..."); //$NON-NLS-1$
} else {
for (int i= 0 ; i < this.dimensions; i++) {
+ if (this.annotationsOnDimensions != null && this.annotationsOnDimensions[i] != null) {
+ output.append(" "); //$NON-NLS-1$
+ printAnnotations(this.annotationsOnDimensions[i], output);
+ output.append(" "); //$NON-NLS-1$
+ }
output.append("[]"); //$NON-NLS-1$
}
}
@@ -511,6 +569,22 @@
// SH}
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ if (annotations2 != null) {
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
+ }
for (int i = 0, max = this.typeArguments.length; i < max; i++) {
this.typeArguments[i].traverse(visitor, scope);
}
@@ -520,6 +594,20 @@
public void traverse(ASTVisitor visitor, ClassScope scope) {
if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ if (this.annotationsOnDimensions != null) {
+ for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotations2 = this.annotationsOnDimensions[i];
+ for (int j = 0, max2 = annotations2.length; j < max2; j++) {
+ Annotation annotation = annotations2[j];
+ annotation.traverse(visitor, scope);
+ }
+ }
+ }
for (int i = 0, max = this.typeArguments.length; i < max; i++) {
this.typeArguments[i].traverse(visitor, scope);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
index 43bc84c..90a73ca 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java
@@ -1,11 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: QualifiedTypeReference.java 23404 2010-02-03 14:10:22Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -58,6 +61,18 @@
//warning : the new type ref has a null binding
return new ArrayQualifiedTypeReference(this.tokens, dim, this.sourcePositions);
}
+
+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) {
+ //return a type reference copy of me with some dimensions
+ //warning : the new type ref has a null binding
+ ArrayQualifiedTypeReference arrayQualifiedTypeReference = new ArrayQualifiedTypeReference(this.tokens, dim, annotationsOnDimensions, this.sourcePositions);
+ arrayQualifiedTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
+ if (annotationsOnDimensions != null) {
+ arrayQualifiedTypeReference.bits |= ASTNode.HasTypeAnnotations;
+ }
+ return arrayQualifiedTypeReference;
+ }
+
//{ObjectTeams:
/**
* Try to resolve this type reference as an anchored type "t.R".
@@ -216,7 +231,10 @@
}
public StringBuffer printExpression(int indent, StringBuffer output) {
-
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
for (int i = 0; i < this.tokens.length; i++) {
if (i > 0) output.append('.');
//{ObjectTeams: suppress prefix:
@@ -230,14 +248,24 @@
}
public void traverse(ASTVisitor visitor, BlockScope scope) {
-
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ }
visitor.endVisit(this, scope);
}
public void traverse(ASTVisitor visitor, ClassScope scope) {
-
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ }
visitor.endVisit(this, scope);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java
new file mode 100644
index 0000000..971ee9d
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Receiver.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jdt.internal.compiler.ast;
+
+import org.eclipse.jdt.core.compiler.CharOperation;
+
+public class Receiver extends Argument {
+ TypeReference qualifyingTypeReference;
+ public Receiver(char[] name, long posNom, TypeReference typeReference, TypeReference qualifyingTypeReference, int modifiers) {
+ super(qualifyingTypeReference == null ? name : CharOperation.concatWith(qualifyingTypeReference.getTypeName(), name, '.'), posNom, typeReference, modifiers);
+ this.qualifyingTypeReference = qualifyingTypeReference;
+ }
+ public boolean isReceiver() {
+ return true;
+ }
+}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
new file mode 100644
index 0000000..bc680d6
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jdt.internal.compiler.ast;
+
+public class ReferenceExpression extends NullLiteral { // For the time being.
+
+ protected NameReference name;
+ protected TypeReference type;
+ protected Expression primary;
+
+ protected TypeReference [] typeArguments;
+
+ protected SingleNameReference method; // == null ? "::new" : "::method"
+
+ public ReferenceExpression(NameReference name, TypeReference[] typeArguments, int sourceEnd) {
+ super(name.sourceStart, sourceEnd);
+ this.name = name;
+ this.typeArguments = typeArguments;
+ this.method = null;
+ }
+
+ public ReferenceExpression(NameReference name, TypeReference[] typeArguments, SingleNameReference method) {
+ super(name.sourceStart, method.sourceEnd);
+ this.name = name;
+ this.typeArguments = typeArguments;
+ this.method = method;
+ }
+
+ public ReferenceExpression(Expression primary, TypeReference [] typeArguments, SingleNameReference method) {
+ super(primary.sourceStart, method.sourceEnd);
+ this.primary = primary;
+ this.typeArguments = typeArguments;
+ this.method = method;
+ }
+
+ public ReferenceExpression(TypeReference type, TypeReference[] typeArguments, SingleNameReference method) {
+ super(type.sourceStart, method.sourceEnd);
+ this.type = type;
+ this.typeArguments = typeArguments;
+ this.method = method;
+ }
+
+ public ReferenceExpression(TypeReference type, TypeReference[] typeArguments, int sourceEnd) {
+ super(type.sourceStart, sourceEnd);
+ this.type = type;
+ this.typeArguments = typeArguments;
+ this.method = null;
+ }
+
+ public StringBuffer printExpression(int tab, StringBuffer output) {
+
+ if (this.type != null) {
+ this.type.print(0, output);
+ } else if (this.name != null) {
+ this.name.print(0, output);
+ } else {
+ this.primary.print(0, output);
+ }
+ output.append("::"); //$NON-NLS-1$
+ if (this.typeArguments != null) {
+ output.append('<');
+ int max = this.typeArguments.length - 1;
+ for (int j = 0; j < max; j++) {
+ this.typeArguments[j].print(0, output);
+ output.append(", ");//$NON-NLS-1$
+ }
+ this.typeArguments[max].print(0, output);
+ output.append('>');
+ }
+ if (this.method == null) {
+ output.append("new"); //$NON-NLS-1$
+ } else {
+ this.method.print(0, output);
+ }
+ return output;
+ }
+ public boolean isConstructorReference() {
+ return this.method == null;
+ }
+ public boolean isMethodReference() {
+ return this.method != null;
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java
index e64bf0c..2eff389 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -62,4 +66,16 @@
}
visitor.endVisit(this, scope);
}
+
+ public void traverse(ASTVisitor visitor, ClassScope scope) {
+ if (visitor.visit(this, scope)) {
+ if (this.type != null) {
+ this.type.traverse(visitor, scope);
+ }
+ if (this.memberValue != null) {
+ this.memberValue.traverse(visitor, scope);
+ }
+ }
+ visitor.endVisit(this, scope);
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
index 5f8c0e1..8352c86 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -43,6 +47,17 @@
return new ArrayTypeReference(this.token, dim,(((long)this.sourceStart)<<32)+this.sourceEnd);
}
+
+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions){
+ //return a type reference copy of me with some dimensions
+ //warning : the new type ref has a null binding
+ ArrayTypeReference arrayTypeReference = new ArrayTypeReference(this.token, dim, annotationsOnDimensions, (((long)this.sourceStart)<<32)+this.sourceEnd);
+ arrayTypeReference.bits |= (this.bits & ASTNode.HasTypeAnnotations);
+ if (annotationsOnDimensions != null) {
+ arrayTypeReference.bits |= ASTNode.HasTypeAnnotations;
+ }
+ return arrayTypeReference;
+ }
public char[] getLastToken() {
return this.token;
@@ -64,7 +79,10 @@
}
public StringBuffer printExpression(int indent, StringBuffer output){
-
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
return output.append(this.token);
}
@@ -133,12 +151,24 @@
// SH}
public void traverse(ASTVisitor visitor, BlockScope scope) {
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ }
visitor.endVisit(this, scope);
}
public void traverse(ASTVisitor visitor, ClassScope scope) {
- visitor.visit(this, scope);
+ if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
+ }
visitor.endVisit(this, scope);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 4af7b4c..04f4e94 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -1565,10 +1569,13 @@
public StringBuffer printHeader(int indent, StringBuffer output) {
printModifiers(this.modifiers, output);
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
//{ObjectTeams: role/team:
printTypeKind(this.modifiers, output);
// SH}
- if (this.annotations != null) printAnnotations(this.annotations, output);
switch (kind(this.modifiers)) {
case TypeDeclaration.CLASS_DECL :
@@ -1647,6 +1654,19 @@
try {
this.staticInitializerScope.insideTypeAnnotation = true;
resolveAnnotations(this.staticInitializerScope, this.annotations, sourceType);
+ if (this.superclass != null) {
+ this.superclass.resolveAnnotations(this.staticInitializerScope);
+ }
+ if (this.superInterfaces != null) {
+ for (int i = 0, max = this.superInterfaces.length; i < max; i++) {
+ this.superInterfaces[i].resolveAnnotations(this.staticInitializerScope);
+ }
+ }
+ if (this.typeParameters != null) {
+ for (int i = 0, count = this.typeParameters.length; i < count; i++) {
+ this.typeParameters[i].resolveAnnotations(this.staticInitializerScope);
+ }
+ }
} finally {
this.staticInitializerScope.insideTypeAnnotation = old;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
index 87c0f87..07f6b75 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java
@@ -1,17 +1,25 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Technical University Berlin - extended API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import java.util.List;
+
import org.eclipse.jdt.internal.compiler.ASTVisitor;
+import org.eclipse.jdt.internal.compiler.ast.TypeReference.AnnotationCollector;
+import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
@@ -61,6 +69,36 @@
}
}
+ public void getAllAnnotationContexts(int targetType, int typeParameterIndex, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, typeParameterIndex, allAnnotationContexts);
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(collector, (BlockScope) null);
+ }
+ switch(collector.targetType) {
+ case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER :
+ collector.targetType = AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND;
+ break;
+ case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER :
+ collector.targetType = AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND;
+ }
+ if (this.type != null && ((this.type.bits & ASTNode.HasTypeAnnotations) != 0)) {
+ collector.info2 = 0;
+ this.type.traverse(collector, (BlockScope) null);
+ }
+ if (this.bounds != null) {
+ int boundsLength = this.bounds.length;
+ for (int i = 0; i < boundsLength; i++) {
+ TypeReference bound = this.bounds[i];
+ if ((bound.bits & ASTNode.HasTypeAnnotations) == 0) {
+ continue;
+ }
+ collector.info2 = i + 1;
+ bound.traverse(collector, (BlockScope) null);
+ }
+ }
+ }
private void internalResolve(Scope scope, boolean staticContext) {
// detect variable/type name collisions
if (this.binding != null) {
@@ -85,10 +123,28 @@
internalResolve(scope, scope.enclosingSourceType().isStatic());
}
+ public void resolveAnnotations(BlockScope scope) {
+ if (this.annotations != null) {
+ resolveAnnotations(scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_PARAMETER));
+ }
+ if (this.type != null) {
+ this.type.resolveAnnotations(scope);
+ }
+ if (this.bounds != null) {
+ for (int i = 0, max = this.bounds.length; i < max; i++) {
+ this.bounds[i].resolveAnnotations(scope);
+ }
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.compiler.ast.AstNode#print(int, java.lang.StringBuffer)
*/
public StringBuffer printStatement(int indent, StringBuffer output) {
+ if (this.annotations != null) {
+ printAnnotations(this.annotations, output);
+ output.append(' ');
+ }
output.append(this.name);
if (this.type != null) {
//{ObjectTeams: role type bound:
@@ -114,6 +170,11 @@
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
if (this.type != null) {
this.type.traverse(visitor, scope);
}
@@ -129,6 +190,11 @@
public void traverse(ASTVisitor visitor, ClassScope scope) {
if (visitor.visit(this, scope)) {
+ if (this.annotations != null) {
+ int annotationsLength = this.annotations.length;
+ for (int i = 0; i < annotationsLength; i++)
+ this.annotations[i].traverse(visitor, scope);
+ }
if (this.type != null) {
this.type.traverse(visitor, scope);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
index 0a30535..6bac200 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -12,11 +16,16 @@
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.internal.codeassist.select.SelectionNodeFound;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.eclipse.jdt.internal.compiler.codegen.AnnotationContext;
+import org.eclipse.jdt.internal.compiler.codegen.AnnotationTargetTypeConstants;
import org.eclipse.jdt.internal.compiler.flow.FlowContext;
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
@@ -43,6 +52,205 @@
public abstract class TypeReference extends Expression {
public static final TypeReference[] NO_TYPE_ARGUMENTS = new TypeReference[0];
+ static class AnnotationCollector extends ASTVisitor {
+ List annotationContexts;
+ TypeReference typeReference;
+ int targetType;
+ Annotation[] primaryAnnotations;
+ int info = -1;
+ int info2 = -1;
+ LocalVariableBinding localVariable;
+ Annotation[][] annotationsOnDimensions;
+ Wildcard currentWildcard;
+
+ public AnnotationCollector(
+ TypeParameter typeParameter,
+ int targetType,
+ int typeParameterIndex,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = typeParameter.type;
+ this.targetType = targetType;
+ this.primaryAnnotations = typeParameter.annotations;
+ this.info = typeParameterIndex;
+ }
+
+ public AnnotationCollector(
+ LocalDeclaration localDeclaration,
+ int targetType,
+ LocalVariableBinding localVariable,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = localDeclaration.type;
+ this.targetType = targetType;
+ this.primaryAnnotations = localDeclaration.annotations;
+ this.localVariable = localVariable;
+ }
+
+ public AnnotationCollector(
+ LocalDeclaration localDeclaration,
+ int targetType,
+ int parameterIndex,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = localDeclaration.type;
+ this.targetType = targetType;
+ this.primaryAnnotations = localDeclaration.annotations;
+ this.info = parameterIndex;
+ }
+
+ public AnnotationCollector(
+ MethodDeclaration methodDeclaration,
+ int targetType,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = methodDeclaration.returnType;
+ this.targetType = targetType;
+ this.primaryAnnotations = methodDeclaration.annotations;
+ }
+
+ public AnnotationCollector(
+ FieldDeclaration fieldDeclaration,
+ int targetType,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = fieldDeclaration.type;
+ this.targetType = targetType;
+ this.primaryAnnotations = fieldDeclaration.annotations;
+ }
+ public AnnotationCollector(
+ TypeReference typeReference,
+ int targetType,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = typeReference;
+ this.targetType = targetType;
+ }
+ public AnnotationCollector(
+ TypeReference typeReference,
+ int targetType,
+ int info,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = typeReference;
+ this.info = info;
+ this.targetType = targetType;
+ }
+ public AnnotationCollector(
+ TypeReference typeReference,
+ int targetType,
+ int info,
+ int typeIndex,
+ List annotationContexts) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = typeReference;
+ this.info = info;
+ this.targetType = targetType;
+ this.info2 = typeIndex;
+ }
+ public AnnotationCollector(
+ TypeReference typeReference,
+ int targetType,
+ int info,
+ List annotationContexts,
+ Annotation[][] annotationsOnDimensions) {
+ this.annotationContexts = annotationContexts;
+ this.typeReference = typeReference;
+ this.info = info;
+ this.targetType = targetType;
+ this.annotationsOnDimensions = annotationsOnDimensions;
+ }
+ private boolean internalVisit(Annotation annotation) {
+ AnnotationContext annotationContext = null;
+ if (annotation.isRuntimeTypeInvisible()) {
+ annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, this.primaryAnnotations, AnnotationContext.INVISIBLE, this.annotationsOnDimensions);
+ } else if (annotation.isRuntimeTypeVisible()) {
+ annotationContext = new AnnotationContext(annotation, this.typeReference, this.targetType, this.primaryAnnotations, AnnotationContext.VISIBLE, this.annotationsOnDimensions);
+ }
+ if (annotationContext != null) {
+ annotationContext.wildcard = this.currentWildcard;
+ switch(this.targetType) {
+ case AnnotationTargetTypeConstants.THROWS :
+ case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER :
+ case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER :
+ case AnnotationTargetTypeConstants.METHOD_PARAMETER :
+ case AnnotationTargetTypeConstants.TYPE_CAST :
+ case AnnotationTargetTypeConstants.TYPE_INSTANCEOF :
+ case AnnotationTargetTypeConstants.OBJECT_CREATION :
+ case AnnotationTargetTypeConstants.CLASS_LITERAL :
+ case AnnotationTargetTypeConstants.CLASS_EXTENDS_IMPLEMENTS:
+ annotationContext.info = this.info;
+ break;
+ case AnnotationTargetTypeConstants.CLASS_TYPE_PARAMETER_BOUND :
+ case AnnotationTargetTypeConstants.METHOD_TYPE_PARAMETER_BOUND :
+ annotationContext.info2 = this.info2;
+ annotationContext.info = this.info;
+ break;
+ case AnnotationTargetTypeConstants.LOCAL_VARIABLE :
+ annotationContext.variableBinding = this.localVariable;
+ break;
+ case AnnotationTargetTypeConstants.TYPE_ARGUMENT_METHOD_CALL :
+ case AnnotationTargetTypeConstants.TYPE_ARGUMENT_CONSTRUCTOR_CALL :
+ annotationContext.info2 = this.info2;
+ annotationContext.info = this.info;
+ }
+ this.annotationContexts.add(annotationContext);
+ }
+ return true;
+ }
+ public boolean visit(MarkerAnnotation annotation, BlockScope scope) {
+ return internalVisit(annotation);
+ }
+ public boolean visit(NormalAnnotation annotation, BlockScope scope) {
+ return internalVisit(annotation);
+ }
+ public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
+ return internalVisit(annotation);
+ }
+ public boolean visit(Wildcard wildcard, BlockScope scope) {
+ this.currentWildcard = wildcard;
+ return true;
+ }
+ public boolean visit(Argument argument, BlockScope scope) {
+ if ((argument.bits & ASTNode.IsUnionType) == 0) {
+ return true;
+ }
+ for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) {
+ int startPC = this.localVariable.initializationPCs[i << 1];
+ int endPC = this.localVariable.initializationPCs[(i << 1) + 1];
+ if (startPC != endPC) { // only entries for non zero length
+ return true;
+ }
+ }
+ return false;
+ }
+ public boolean visit(Argument argument, ClassScope scope) {
+ if ((argument.bits & ASTNode.IsUnionType) == 0) {
+ return true;
+ }
+ for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) {
+ int startPC = this.localVariable.initializationPCs[i << 1];
+ int endPC = this.localVariable.initializationPCs[(i << 1) + 1];
+ if (startPC != endPC) { // only entries for non zero length
+ return true;
+ }
+ }
+ return false;
+ }
+ public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
+ for (int i = 0, max = this.localVariable.initializationCount; i < max; i++) {
+ int startPC = this.localVariable.initializationPCs[i << 1];
+ int endPC = this.localVariable.initializationPCs[(i << 1) + 1];
+ if (startPC != endPC) { // only entries for non zero length
+ return true;
+ }
+ }
+ return false;
+ }
+ public void endVisit(Wildcard wildcard, BlockScope scope) {
+ this.currentWildcard = null;
+ }
+ }
//{ObjectTeams: for baseclass decapsulation (implement interface from Expression):
private DecapsulationState baseclassDecapsulation = DecapsulationState.NONE;
@@ -63,7 +271,7 @@
/*
* Answer a base type reference (can be an array of base type).
*/
-public static final TypeReference baseTypeReference(int baseType, int dim) {
+public static final TypeReference baseTypeReference(int baseType, int dim, Annotation[][] dimAnnotations) {
if (dim == 0) {
switch (baseType) {
@@ -89,26 +297,29 @@
}
switch (baseType) {
case (TypeIds.T_void) :
- return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_boolean) :
- return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_char) :
- return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_float) :
- return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_double) :
- return new ArrayTypeReference(TypeBinding.DOUBLE.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.DOUBLE.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_byte) :
- return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_short) :
- return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_int) :
- return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, dimAnnotations, 0);
default : //T_long
- return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, 0);
+ return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, dimAnnotations, 0);
}
}
+// JSR308 type annotations...
+public Annotation[] annotations = null;
+
// allows us to trap completion & selection nodes
public void aboutToResolve(Scope scope) {
// default implementation: do nothing
@@ -120,9 +331,57 @@
// only parameterized type references have bounds
}
public abstract TypeReference copyDims(int dim);
+public abstract TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions);
public int dimensions() {
return 0;
}
+public AnnotationContext[] getAllAnnotationContexts(int targetType) {
+ List allAnnotationContexts = new ArrayList();
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
+ this.traverse(collector, (BlockScope) null);
+ return (AnnotationContext[]) allAnnotationContexts.toArray(new AnnotationContext[allAnnotationContexts.size()]);
+}
+/**
+ * info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
+ * @param targetType
+ * @param info
+ * @param allAnnotationContexts
+ */
+public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts);
+ this.traverse(collector, (BlockScope) null);
+}
+/**
+ * info can be either a type index (superclass/superinterfaces) or a pc into the bytecode
+ * @param targetType
+ * @param info
+ * @param allAnnotationContexts
+ */
+public void getAllAnnotationContexts(int targetType, int info, List allAnnotationContexts, Annotation[][] annotationsOnDimensions) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, info, allAnnotationContexts, annotationsOnDimensions);
+ this.traverse(collector, (BlockScope) null);
+ if (annotationsOnDimensions != null) {
+ for (int i = 0, max = annotationsOnDimensions.length; i < max; i++) {
+ Annotation[] annotationsOnDimension = annotationsOnDimensions[i];
+ if (annotationsOnDimension != null) {
+ for (int j = 0, max2 = annotationsOnDimension.length; j< max2; j++) {
+ annotationsOnDimension[j].traverse(collector, (BlockScope) null);
+ }
+ }
+ }
+ }
+}
+public void getAllAnnotationContexts(int targetType, int info, int typeIndex, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, info, typeIndex, allAnnotationContexts);
+ this.traverse(collector, (BlockScope) null);
+}
+public void getAllAnnotationContexts(int targetType, List allAnnotationContexts) {
+ AnnotationCollector collector = new AnnotationCollector(this, targetType, allAnnotationContexts);
+ this.traverse(collector, (BlockScope) null);
+}
+public Annotation[][] getAnnotationsOnDimensions() {
+ return null;
+}
public abstract char[] getLastToken();
@@ -263,6 +522,15 @@
&& scope.compilerOptions().getSeverity(CompilerOptions.RawTypeReference) != ProblemSeverities.Ignore) {
scope.problemReporter().rawTypeReference(this, type);
}
+ if (this.annotations != null) {
+ switch(scope.kind) {
+ case Scope.BLOCK_SCOPE :
+ case Scope.METHOD_SCOPE :
+ resolveAnnotations((BlockScope) scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ break;
+ }
+ }
+
if (hasError) {
// do not store the computed type, keep the problem type instead
return type;
@@ -311,6 +579,10 @@
}
//Markus Witte}
+public boolean isParameterizedTypeReference() {
+ return false;
+}
+
protected void reportDeprecatedType(TypeBinding type, Scope scope, int index) {
scope.problemReporter().deprecatedType(type, this, index);
}
@@ -399,4 +671,10 @@
public abstract void traverse(ASTVisitor visitor, BlockScope scope);
public abstract void traverse(ASTVisitor visitor, ClassScope scope);
+
+protected void resolveAnnotations(BlockScope scope) {
+ if (this.annotations != null) {
+ resolveAnnotations(scope, this.annotations, new Annotation.TypeUseBinding(Binding.TYPE_USE));
+ }
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java
index f1d7415..bbf7806 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -156,4 +160,9 @@
return output;
}
+ public TypeReference copyDims(int dim, Annotation[][] annotationsOnDimensions) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
index 73b985d..8f4db26 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Wildcard.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -59,7 +63,7 @@
boundType = scope.kind == Scope.CLASS_SCOPE
? this.bound.resolveType((ClassScope)scope)
: this.bound.resolveType((BlockScope)scope, true /* check bounds*/);
-
+ this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations);
if (boundType == null) {
return null;
}
@@ -89,6 +93,7 @@
public TypeBinding resolveType(BlockScope scope, boolean checkBounds) {
if (this.bound != null) {
this.bound.resolveType(scope, checkBounds);
+ this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations);
}
return null;
}
@@ -96,6 +101,7 @@
public TypeBinding resolveType(ClassScope scope) {
if (this.bound != null) {
this.bound.resolveType(scope);
+ this.bits |= (this.bound.bits & ASTNode.HasTypeAnnotations);
}
return null;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
index ba8c821..3d65c50 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
@@ -1,10 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: ClassFileConstants.java 19873 2009-04-13 16:51:05Z stephan $
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -105,6 +108,7 @@
int MAJOR_VERSION_1_5 = 49;
int MAJOR_VERSION_1_6 = 50;
int MAJOR_VERSION_1_7 = 51;
+ int MAJOR_VERSION_1_8 = 52; //TODO JAVA8: This probably needs to change
int MINOR_VERSION_0 = 0;
int MINOR_VERSION_1 = 1;
@@ -112,7 +116,7 @@
int MINOR_VERSION_3 = 3;
int MINOR_VERSION_4 = 4;
- // JDK 1.1 -> 1.7, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0
+ // JDK 1.1 -> 1.8, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0
// 16 unsigned bits for major, then 16 bits for minor
long JDK1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_3; // 1.1. is 45.3
long JDK1_2 = ((long)ClassFileConstants.MAJOR_VERSION_1_2 << 16) + ClassFileConstants.MINOR_VERSION_0;
@@ -121,6 +125,7 @@
long JDK1_5 = ((long)ClassFileConstants.MAJOR_VERSION_1_5 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK1_6 = ((long)ClassFileConstants.MAJOR_VERSION_1_6 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK1_7 = ((long)ClassFileConstants.MAJOR_VERSION_1_7 << 16) + ClassFileConstants.MINOR_VERSION_0;
+ long JDK1_8 = ((long)ClassFileConstants.MAJOR_VERSION_1_8 << 16) + ClassFileConstants.MINOR_VERSION_0;
/*
* cldc1.1 is 45.3, but we modify it to be different from JDK1_1.
@@ -147,4 +152,5 @@
int ATTR_VARS = 0x4; // LocalVariableTableAttribute
int ATTR_STACK_MAP_TABLE = 0x8; // Stack map table attribute
int ATTR_STACK_MAP = 0x10; // Stack map attribute: cldc
+ int ATTR_TYPE_ANNOTATION = 0x20; // type annotation attribute (jsr 308)
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.java
new file mode 100644
index 0000000..75de873
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationContext.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.compiler.codegen;
+
+import org.eclipse.jdt.internal.compiler.ast.Annotation;
+import org.eclipse.jdt.internal.compiler.ast.TypeReference;
+import org.eclipse.jdt.internal.compiler.ast.Wildcard;
+import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;
+
+public class AnnotationContext {
+ public static final int VISIBLE = 0x1;
+ public static final int INVISIBLE = 0x2;
+ public Annotation annotation;
+ public TypeReference typeReference;
+ public int targetType;
+ public int info;
+ public int info2;
+ public int visibility;
+ public Annotation[] primaryAnnotations;
+ public LocalVariableBinding variableBinding;
+ public Annotation[][] annotationsOnDimensions;
+ public Wildcard wildcard;
+
+ public AnnotationContext(
+ Annotation annotation,
+ TypeReference typeReference,
+ int targetType,
+ Annotation[] primaryAnnotations,
+ int visibility,
+ Annotation[][] annotationsOnDimensions) {
+ this.annotation = annotation;
+ this.typeReference = typeReference;
+ this.targetType = targetType;
+ this.primaryAnnotations = primaryAnnotations;
+ this.visibility = visibility;
+ this.annotationsOnDimensions = annotationsOnDimensions;
+ }
+
+ public String toString() {
+ return "AnnotationContext [annotation=" //$NON-NLS-1$
+ + this.annotation
+ + ", typeReference=" //$NON-NLS-1$
+ + this.typeReference
+ + ", targetType=" //$NON-NLS-1$
+ + this.targetType
+ + ", info =" //$NON-NLS-1$
+ + this.info
+ + ", boundIndex=" //$NON-NLS-1$
+ + this.info2
+ + "]"; //$NON-NLS-1$
+ }
+}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.java
new file mode 100644
index 0000000..ad66617
--- /dev/null
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AnnotationTargetTypeConstants.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.internal.compiler.codegen;
+
+public interface AnnotationTargetTypeConstants {
+ int METHOD_RECEIVER = 0x06;
+ int METHOD_RECEIVER_GENERIC_OR_ARRAY = 0x07;
+ int METHOD_RETURN_TYPE = 0x0A;
+ int METHOD_RETURN_TYPE_GENERIC_OR_ARRAY = 0x0B;
+ int METHOD_PARAMETER = 0x0C;
+ int METHOD_PARAMETER_GENERIC_OR_ARRAY = 0x0D;
+ int FIELD = 0x0E;
+ int FIELD_GENERIC_OR_ARRAY = 0x0F;
+ int CLASS_TYPE_PARAMETER_BOUND = 0x10;
+ int CLASS_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY = 0x11;
+ int METHOD_TYPE_PARAMETER_BOUND = 0x12;
+ int METHOD_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY = 0x13;
+ int CLASS_EXTENDS_IMPLEMENTS = 0x14;
+ int CLASS_EXTENDS_IMPLEMENTS_GENERIC_OR_ARRAY = 0x15;
+ int THROWS = 0x16;
+ int THROWS_GENERIC_OR_ARRAY = 0x17;
+ int WILDCARD_BOUND = 0x1C;
+ int WILDCARD_BOUND_GENERIC_OR_ARRAY = 0x1D;
+ int METHOD_TYPE_PARAMETER = 0x20;
+ int METHOD_TYPE_PARAMETER_GENERIC_OR_ARRAY = 0x21;
+ int CLASS_TYPE_PARAMETER = 0x22;
+ int CLASS_TYPE_PARAMETER_GENERIC_OR_ARRAY = 0x23;
+ int TYPE_CAST = 0x00;
+ int TYPE_CAST_GENERIC_OR_ARRAY = 0x01;
+ int TYPE_INSTANCEOF = 0x02;
+ int TYPE_INSTANCEOF_GENERIC_OR_ARRAY = 0x03;
+ int OBJECT_CREATION = 0x04;
+ int OBJECT_CREATION_GENERIC_OR_ARRAY = 0x05;
+ int LOCAL_VARIABLE = 0x08;
+ int LOCAL_VARIABLE_GENERIC_OR_ARRAY = 0x09;
+ int TYPE_ARGUMENT_CONSTRUCTOR_CALL = 0x18;
+ int TYPE_ARGUMENT_CONSTRUCTOR_CALL_GENERIC_OR_ARRAY = 0x19;
+ int TYPE_ARGUMENT_METHOD_CALL = 0x1A;
+ int TYPE_ARGUMENT_METHOD_CALL_GENERIC_OR_ARRAY = 0x1B;
+ int CLASS_LITERAL = 0x1E;
+ int CLASS_LITERAL_GENERIC_OR_ARRAY = 0x1F;
+}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
index 1399319..259f147 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Benjamin Muskalla - Contribution for bug 239066
@@ -255,6 +259,7 @@
public static final String VERSION_1_5 = "1.5"; //$NON-NLS-1$
public static final String VERSION_1_6 = "1.6"; //$NON-NLS-1$
public static final String VERSION_1_7 = "1.7"; //$NON-NLS-1$
+ public static final String VERSION_1_8 = "1.8"; //$NON-NLS-1$
public static final String ERROR = "error"; //$NON-NLS-1$
public static final String WARNING = "warning"; //$NON-NLS-1$
public static final String IGNORE = "ignore"; //$NON-NLS-1$
@@ -836,6 +841,10 @@
if (jdkLevel == ClassFileConstants.JDK1_7)
return VERSION_1_7;
break;
+ case ClassFileConstants.MAJOR_VERSION_1_8 :
+ if (jdkLevel == ClassFileConstants.JDK1_8)
+ return VERSION_1_8;
+ break;
}
return Util.EMPTY_STRING; // unknown version
}
@@ -860,6 +869,8 @@
return ClassFileConstants.JDK1_6;
case '7':
return ClassFileConstants.JDK1_7;
+ case '8':
+ return ClassFileConstants.JDK1_8;
default:
return 0; // unknown
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
index 72d4066..eea8f53 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Binding.java
@@ -4,8 +4,11 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: Binding.java 23405 2010-02-03 17:02:18Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -43,10 +46,12 @@
public static final int GENERIC_TYPE = TYPE | ASTNode.Bit12;
public static final int TYPE_PARAMETER = TYPE | ASTNode.Bit13;
public static final int INTERSECTION_TYPE = TYPE | ASTNode.Bit14;
+ // jsr 308
+ public static final int TYPE_USE = TYPE | ASTNode.Bit15;
//{ObjectTeams
- public static final int BINDING = ASTNode.Bit15; //callin/callout-Binding
- public static final int PRECEDENCE = ASTNode.Bit16; // binding for a precedence declaration
+ public static final int BINDING = ASTNode.Bit16; //callin/callout-Binding
+ public static final int PRECEDENCE = ASTNode.Bit17; // binding for a precedence declaration
//Markus Witte + SH}
// Shared binding collections
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
index 8181636..7440ec6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ExtraCompilerModifiers.java
@@ -5,11 +5,17 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for bug 328281 - visibility leaks not detected when analyzing unused field in private class
* Fraunhofer FIRST - extended API and implementation
* Technical University Berlin - extended API and implementation
+ * Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
+ * bug 328281 - visibility leaks not detected when analyzing unused field in private class
+ * bug 382353 - [1.8][compiler] Implementation property modifiers should be accepted on default methods.
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
@@ -27,7 +33,7 @@
// those constants are depending upon ClassFileConstants (relying that classfiles only use the 16 lower bits)
final int AccJustFlag = 0xFFFF;// 16 lower bits
- // bit17 - free
+ final int AccDefaultMethod = ASTNode.Bit17;
// bit18 - use by ClassFileConstants.AccAnnotationDefault
final int AccRestrictedAccess = ASTNode.Bit19;
final int AccFromClassFile = ASTNode.Bit20;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
index d1f2cd7..97f2981 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodScope.java
@@ -4,7 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: MethodScope.java 23405 2010-02-03 17:02:18Z stephan $
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -13,12 +16,16 @@
* Stephan Herrmann - Contributions for
* bug 349326 - [1.7] new warning for missing try-with-resources
* bug 374605 - Unreasonable warning for enum-based switch statements
+ * bug 382353 - [1.8][compiler] Implementation property modifiers should be accepted on default methods.
+ * bug 382354 - [1.8][compiler] Compiler silent on conflicting modifier
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.lookup;
+import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
+import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
import org.eclipse.jdt.internal.compiler.flow.FlowInfo;
import org.eclipse.jdt.internal.compiler.flow.UnconditionalFlowInfo;
import org.eclipse.jdt.internal.compiler.impl.IrritantSet;
@@ -212,11 +219,20 @@
:giro */
if (declaringClass.isRegularInterface()) {
// SH}
- if ((realModifiers & ~(ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract)) != 0) {
+ int expectedModifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract;
+ // 9.4 got updated for JSR 335 (default methods):
+ boolean isDefaultMethod = (modifiers & ExtraCompilerModifiers.AccDefaultMethod) != 0; // no need to check validity, is done by the parser
+ if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_8 && isDefaultMethod) {
+ expectedModifiers |= (ClassFileConstants.AccSynchronized | ClassFileConstants.AccStrictfp);
+ }
+ if ((realModifiers & ~expectedModifiers) != 0) {
if ((declaringClass.modifiers & ClassFileConstants.AccAnnotation) != 0)
problemReporter().illegalModifierForAnnotationMember((AbstractMethodDeclaration) this.referenceContext);
else
- problemReporter().illegalModifierForInterfaceMethod((AbstractMethodDeclaration) this.referenceContext);
+ problemReporter().illegalModifierForInterfaceMethod((AbstractMethodDeclaration) this.referenceContext, isDefaultMethod);
+ }
+ if (isDefaultMethod && (modifiers & ClassFileConstants.AccAbstract) != 0) {
+ problemReporter().abstractMethodNeedingNoBody((AbstractMethodDeclaration) this.referenceContext);
}
return;
}
@@ -403,11 +419,16 @@
} else {
//{ObjectTeams: changed to isRegularInterface: role interfaces don't force public
/*orig:
- if (declaringClass.isInterface()) // interface or annotation type
+ if (declaringClass.isInterface()) {// interface or annotation type
:giro */
- if (declaringClass.isRegularInterface())
+ if (declaringClass.isRegularInterface()) {
// SH}
- modifiers |= ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract;
+ if (method.isDefaultMethod()) {
+ modifiers |= ClassFileConstants.AccPublic; // default method is not abstract
+ } else {
+ modifiers |= ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract;
+ }
+ }
method.binding =
new MethodBinding(modifiers, method.selector, null, null, null, declaringClass);
checkAndSetModifiersForMethod(method.binding);
@@ -424,12 +445,33 @@
Argument[] argTypes = method.arguments;
int argLength = argTypes == null ? 0 : argTypes.length;
- if (argLength > 0 && compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
- if (argTypes[--argLength].isVarArgs())
+ long sourceLevel = compilerOptions().sourceLevel;
+ if (argLength > 0 && sourceLevel >= ClassFileConstants.JDK1_5) {
+ Argument argument = argTypes[--argLength];
+ if (argument.isVarArgs())
method.binding.modifiers |= ClassFileConstants.AccVarargs;
+ if (CharOperation.equals(argument.name, ConstantPool.This)) {
+ if (argLength != 0 || sourceLevel <= ClassFileConstants.JDK1_7) {
+ problemReporter().illegalThis(argument, method, sourceLevel);
+ }
+ if (argument.annotations != null) {
+ method.receiverAnnotations = argument.annotations;
+ method.bits |= ASTNode.HasTypeAnnotations;
+ }
+ }
while (--argLength >= 0) {
- if (argTypes[argLength].isVarArgs())
- problemReporter().illegalVararg(argTypes[argLength], method);
+ argument = argTypes[argLength];
+ if (argument.isVarArgs())
+ problemReporter().illegalVararg(argument, method);
+ if (CharOperation.equals(argument.name, ConstantPool.This)) {
+ if (argLength != 0 || sourceLevel <= ClassFileConstants.JDK1_7) {
+ problemReporter().illegalThis(argument, method, sourceLevel);
+ }
+ if (argument.annotations != null) {
+ method.receiverAnnotations = argument.annotations;
+ method.bits |= ASTNode.HasTypeAnnotations;
+ }
+ }
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index 3ea6271..460afd4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -1,11 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: Scope.java 23405 2010-02-03 17:02:18Z stephan $
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -884,6 +887,25 @@
parameterBinding.fPackage = unitPackage;
typeParameter.binding = parameterBinding;
+ if ((typeParameter.bits & ASTNode.HasTypeAnnotations) != 0) {
+ switch(declaringElement.kind()) {
+ case Binding.METHOD :
+ MethodBinding methodBinding = (MethodBinding) declaringElement;
+ AbstractMethodDeclaration sourceMethod = methodBinding.sourceMethod();
+ if (sourceMethod != null) {
+ sourceMethod.bits |= ASTNode.HasTypeAnnotations;
+ }
+ break;
+ case Binding.TYPE :
+ if (declaringElement instanceof SourceTypeBinding) {
+ SourceTypeBinding sourceTypeBinding = (SourceTypeBinding) declaringElement;
+ TypeDeclaration typeDeclaration = sourceTypeBinding.scope.referenceContext;
+ if (typeDeclaration != null) {
+ typeDeclaration.bits |= ASTNode.HasTypeAnnotations;
+ }
+ }
+ }
+ }
// detect duplicates, but keep each variable to reduce secondary errors with instantiating this generic type (assume number of variables is correct)
for (int j = 0; j < count; j++) {
TypeVariableBinding knownVar = typeVariableBindings[j];
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
index 2eea880..4b17005 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Fraunhofer FIRST - extended API and implementation
@@ -114,11 +118,14 @@
long AnnotationForLocalVariable = ASTNode.Bit42L;
long AnnotationForAnnotationType = ASTNode.Bit43L;
long AnnotationForPackage = ASTNode.Bit44L;
+ long AnnotationForTypeUse = ASTNode.Bit54L;
+ long AnnotationForTypeParameter = ASTNode.Bit55L;
long AnnotationTargetMASK = AnnotationTarget
| AnnotationForType | AnnotationForField
| AnnotationForMethod | AnnotationForParameter
| AnnotationForConstructor | AnnotationForLocalVariable
- | AnnotationForAnnotationType | AnnotationForPackage;
+ | AnnotationForAnnotationType | AnnotationForPackage
+ | AnnotationForTypeUse | AnnotationForTypeParameter;
// 2-bits for retention (should check (tagBits & RetentionMask) == RuntimeRetention
long AnnotationSourceRetention = ASTNode.Bit45L;
long AnnotationClassRetention = ASTNode.Bit46L;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
index 95ebdc3..67e770e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Stephan Herrmann - Contributions for
@@ -80,6 +84,10 @@
char[] UPPER_LOCAL_VARIABLE = "LOCAL_VARIABLE".toCharArray(); //$NON-NLS-1$
char[] UPPER_ANNOTATION_TYPE = "ANNOTATION_TYPE".toCharArray(); //$NON-NLS-1$
char[] UPPER_PACKAGE = "PACKAGE".toCharArray(); //$NON-NLS-1$
+
+ // jsr308
+ char[] TYPE_USE_TARGET = "TYPE_USE".toCharArray(); //$NON-NLS-1$
+ char[] TYPE_PARAMETER_TARGET = "TYPE_PARAMETER".toCharArray(); //$NON-NLS-1$
// Constant compound names
char[][] JAVA_LANG = {JAVA, LANG};
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
index ad780d4..6f93621 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocTagConstants.java
@@ -1,9 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -169,6 +173,8 @@
{},
// since 1.7
{},
+ // since 1.8
+ {}
};
public static final char[][][] INLINE_TAGS = {
// since 1.0
@@ -187,6 +193,8 @@
{},
// since 1.7
{},
+ // since 1.8
+ {}
};
public final static int INLINE_TAGS_LENGTH = INLINE_TAGS.length;
public final static int BLOCK_TAGS_LENGTH = BLOCK_TAGS.length;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index c1b95b3..80aff6c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -5,6 +5,10 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Tom Tromey - patch for readTable(String) as described in http://bugs.eclipse.org/bugs/show_bug.cgi?id=32196
@@ -13,6 +17,7 @@
* Stephan Herrmann - Contributions for
* bug 366003 - CCE in ASTNode.resolveAnnotations(ASTNode.java:639)
* bug 374605 - Unreasonable warning for enum-based switch statements
+ * bug 382353 - [1.8][compiler] Implementation property modifiers should be accepted on default methods.
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.parser;
@@ -30,6 +35,7 @@
import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.ast.Expression.DecapsulationState;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
+import org.eclipse.jdt.internal.compiler.codegen.ConstantPool;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.impl.ReferenceContext;
@@ -51,24 +57,7 @@
import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
import org.eclipse.objectteams.otdt.core.compiler.OTNameUtils;
import org.eclipse.objectteams.otdt.core.exceptions.InternalCompilerError;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.AbstractMethodMappingDeclaration;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseAllocationExpression;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseCallMessageSend;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.CallinMappingDeclaration;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.CalloutMappingDeclaration;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.FieldAccessSpec;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.GuardPredicateDeclaration;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.LiftingTypeReference;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.MethodSpec;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.ParameterMapping;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.PrecedenceDeclaration;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.QualifiedBaseReference;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.RoleClassLiteralAccess;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.TSuperMessageSend;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.TsuperReference;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.TypeAnchorReference;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.TypeValueParameter;
-import org.eclipse.objectteams.otdt.internal.core.compiler.ast.WithinStatement;
+import org.eclipse.objectteams.otdt.internal.core.compiler.ast.*;
import org.eclipse.objectteams.otdt.internal.core.compiler.control.Config;
import org.eclipse.objectteams.otdt.internal.core.compiler.model.RoleModel;
import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.MethodSignatureEnhancer;
@@ -83,7 +72,6 @@
* What: New consume methods
* All consume methods show as a comment the grammar rule(s) invoking this method.
*
- * @version $Id: Parser.java 23404 2010-02-03 14:10:22Z stephan $
*/
public class Parser implements ParserBasicInformation, TerminalTokens, OperatorIds, TypeIds {
@@ -114,6 +102,9 @@
//expression stack
protected final static int ExpressionStackIncrement = 100;
+ // annotation stack
+ protected final static int TypeAnnotationStackIncrement = 100;
+
protected final static int GenericsStackIncrement = 10;
private final static String FILEPREFIX = "parser"; //$NON-NLS-1$
@@ -213,6 +204,12 @@
compliance = ClassFileConstants.JDK1_4;
} else if("1.5".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK1_5;
+ } else if("1.6".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK1_6;
+ } else if("1.7".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK1_7;
+ } else if("1.8".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK1_8;
} else if("recovery".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK_DEFERRED;
}
@@ -818,7 +815,7 @@
:giro */
return term_action[term_check[base_action[state]+sym] == (byte)sym ? base_action[state] + sym : base_action[state]];
// SH}
- }
+ }
protected int astLengthPtr;
protected int[] astLengthStack;
@@ -836,7 +833,25 @@
protected int[] expressionLengthStack;
protected int expressionPtr;
protected Expression[] expressionStack = new Expression[ExpressionStackIncrement];
+ protected int unattachedAnnotationPtr; // used for figuring out whether some set of annotations are annotating a dimension or not.
public int firstToken ; // handle for multiple parsing goals
+
+ /* jsr308 -- Type annotation management, we now maintain type annotations in a separate stack
+ as otherwise they get interspersed with other expressions and some of the code is not prepared
+ to handle such interleaving and will look ugly if changed.
+
+ See consumeArrayCreationExpressionWithoutInitializer for example.
+
+ See that annotations gets pushed into expression stack the moment an annotation is discovered and
+ get moved to the new type annotations stack only later when the annotation is recognized to be a
+ type annotation. Where ambiguities exist (i.e 1.7 annotation occurs in a place sanctioned for an
+ 1.5 type annotation, the annotation continues to stay in the expression stack, but in these case
+ interleaving is not an issue.
+ */
+ protected int typeAnnotationPtr;
+ protected int typeAnnotationLengthPtr;
+ protected Annotation [] typeAnnotationStack = new Annotation[TypeAnnotationStackIncrement];
+ protected int [] typeAnnotationLengthStack;
// generics management
protected int genericsIdentifiersLengthPtr;
protected int[] genericsIdentifiersLengthStack = new int[GenericsStackIncrement];
@@ -919,6 +934,9 @@
protected int lastJavadocEnd;
public org.eclipse.jdt.internal.compiler.ReadManager readManager;
private boolean shouldDeferRecovery = false; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=291040
+private int valueLambdaNestDepth = -1;
+private int stateStackLengthStack[] = new int[0];
+private boolean parsingJava8Plus;
//{ObjectTeams: context info while parsing separate role files:
@@ -934,8 +952,10 @@
this.options = problemReporter.options;
this.optimizeStringLiterals = optimizeStringLiterals;
initializeScanner();
+ this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8;
this.astLengthStack = new int[50];
this.expressionLengthStack = new int[30];
+ this.typeAnnotationLengthStack = new int[30];
this.intStack = new int[50];
this.identifierStack = new char[30][];
this.identifierLengthStack = new int[30];
@@ -996,7 +1016,7 @@
if ( (this.firstToken == TokenNamePLUS_PLUS) // compilation unit
|| (this.firstToken == TokenNameQUESTION)) // package declaration
{
-// orig:
+// orig:
this.compilationUnit.currentPackage = null;
// :giro
}
@@ -1293,6 +1313,7 @@
}
}
protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide(TypeReference rightSide, int dim) {
+ Annotation [][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
int nameSize = this.identifierLengthStack[this.identifierLengthPtr];
int tokensSize = nameSize;
if (rightSide instanceof ParameterizedSingleTypeReference) {
@@ -1348,7 +1369,19 @@
typeArguments[nameSize - 1] = currentTypeArguments;
}
this.identifierLengthPtr--;
- return new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, positions);
+ ParameterizedQualifiedTypeReference typeRef = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, annotationsOnDimensions, positions);
+ int length;
+ if (this.typeAnnotationLengthPtr >= 0 && (length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.typeAnnotationStack,
+ (this.typeAnnotationPtr -= length) + 1,
+ typeRef.annotations = new Annotation[length],
+ 0,
+ length);
+ typeRef.sourceStart = typeRef.annotations[0].sourceStart;
+ typeRef.bits |= ASTNode.HasTypeAnnotations;
+ }
+ return typeRef;
}
protected void concatExpressionLists() {
this.expressionLengthStack[--this.expressionLengthPtr]++;
@@ -1695,8 +1728,6 @@
this.expressionLengthPtr -- ;
arrayAllocation.initializer = (ArrayInitializer) this.expressionStack[this.expressionPtr--];
- arrayAllocation.type = getTypeReference(0);
- arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
length = (this.expressionLengthStack[this.expressionLengthPtr--]);
this.expressionPtr -= length ;
System.arraycopy(
@@ -1705,6 +1736,14 @@
arrayAllocation.dimensions = new Expression[length],
0,
length);
+ Annotation[][] annotationsOnDimensions = getAnnotationsOnDimensions(length);
+ arrayAllocation.annotationsOnDimensions = annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ arrayAllocation.bits |= ASTNode.HasTypeAnnotations;
+ }
+ arrayAllocation.type = getTypeReference(0);
+ arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
+
arrayAllocation.sourceStart = this.intStack[this.intPtr--];
if (arrayAllocation.initializer == null) {
arrayAllocation.sourceEnd = this.endStatementPosition;
@@ -1719,8 +1758,6 @@
int length;
ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression();
- arrayAllocation.type = getTypeReference(0);
- arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
length = (this.expressionLengthStack[this.expressionLengthPtr--]);
this.expressionPtr -= length ;
System.arraycopy(
@@ -1729,6 +1766,13 @@
arrayAllocation.dimensions = new Expression[length],
0,
length);
+ Annotation[][] annotationsOnDimensions = getAnnotationsOnDimensions(length);
+ arrayAllocation.annotationsOnDimensions = annotationsOnDimensions;
+ if (annotationsOnDimensions != null) {
+ arrayAllocation.bits |= ASTNode.HasTypeAnnotations;
+ }
+ arrayAllocation.type = getTypeReference(0);
+ arrayAllocation.type.bits |= ASTNode.IgnoreRawTypeCheck; // no need to worry about raw type usage
arrayAllocation.sourceStart = this.intStack[this.intPtr--];
if (arrayAllocation.initializer == null) {
arrayAllocation.sourceEnd = this.endStatementPosition;
@@ -2830,7 +2874,7 @@
pushOnAstStack(caseStatement);
}
protected void consumeCastExpressionLL1() {
- //CastExpression ::= '(' Expression ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
+ //CastExpression ::= '(' Name ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
// Expression is used in order to make the grammar LL1
//optimize push/pop
@@ -2846,6 +2890,44 @@
updateSourcePosition(cast);
cast.sourceEnd=exp.sourceEnd;
}
+protected void consumeCastExpressionLL1WithTypeAnnotations() {
+ // CastExpression ::= '(' Modifiers Name ')' InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
+ // Expression is used in order to make the grammar LL1
+
+ //optimize push/pop
+
+ // pop the expression
+ Expression expression = this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+ // pop the type reference
+ TypeReference typeReference = (TypeReference) this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+
+ int length;
+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ typeReference.annotations = new Annotation[length],
+ 0,
+ length);
+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
+ if (this.modifiersSourceStart < typeReferenceSourceStart) {
+ typeReferenceSourceStart = this.modifiersSourceStart;
+ }
+ typeReference.sourceStart = typeReferenceSourceStart;
+ typeReference.bits |= ASTNode.HasTypeAnnotations;
+ }
+ Expression cast;
+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
+ // pop the two positions for left and right parenthesis
+ updateSourcePosition(cast);
+ cast.sourceEnd = expression.sourceEnd;
+ if (this.modifiers != ClassFileConstants.AccDefault) {
+ problemReporter().invalidLocationForModifiers(typeReference);
+ }
+ resetModifiers();
+}
protected void consumeCastExpressionWithGenericsArray() {
// CastExpression ::= PushLPAREN Name TypeArguments Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
@@ -2863,6 +2945,44 @@
castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
cast.sourceEnd = exp.sourceEnd;
}
+protected void consumeCastExpressionWithGenericsArrayWithTypeAnnotations() {
+ // CastExpression ::= PushLPAREN Modifiers Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
+ int end = this.intStack[this.intPtr--];
+ int dim = this.intStack[this.intPtr--];
+
+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
+ TypeReference typeReference = getTypeReference(dim);
+
+ // pop expression
+ Expression expression = this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+
+ int length;
+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ typeReference.annotations = new Annotation[length],
+ 0,
+ length);
+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
+ if (this.modifiersSourceStart < typeReferenceSourceStart) {
+ typeReferenceSourceStart = this.modifiersSourceStart;
+ }
+ typeReference.bits |= ASTNode.HasTypeAnnotations;
+ typeReference.sourceStart = typeReferenceSourceStart;
+ }
+ Expression cast;
+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
+ this.intPtr--;
+ typeReference.sourceEnd = end - 1;
+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
+ cast.sourceEnd = expression.sourceEnd;
+ if (this.modifiers != ClassFileConstants.AccDefault) {
+ problemReporter().invalidLocationForModifiers(typeReference);
+ }
+ resetModifiers();
+}
protected void consumeCastExpressionWithNameArray() {
// CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
@@ -2880,6 +3000,45 @@
castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
cast.sourceEnd = exp.sourceEnd;
}
+protected void consumeCastExpressionWithNameArrayWithTypeAnnotations() {
+ // CastExpression ::= PushLPAREN Modifiers Name Dims PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpressionNotPlusMinus
+
+ int end = this.intStack[this.intPtr--];
+
+ // handle type arguments
+ pushOnGenericsLengthStack(0);
+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
+
+ // pop expression
+ Expression expression = this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+ TypeReference typeReference = getTypeReference(this.intStack[this.intPtr--]);
+
+ int length;
+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ typeReference.annotations = new Annotation[length],
+ 0,
+ length);
+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
+ if (this.modifiersSourceStart < typeReferenceSourceStart) {
+ typeReferenceSourceStart = this.modifiersSourceStart;
+ }
+ typeReference.bits |= ASTNode.HasTypeAnnotations;
+ typeReference.sourceStart = typeReferenceSourceStart;
+ }
+ Expression cast;
+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
+ typeReference.sourceEnd = end - 1;
+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
+ cast.sourceEnd = expression.sourceEnd;
+ if (this.modifiers != ClassFileConstants.AccDefault) {
+ problemReporter().invalidLocationForModifiers(typeReference);
+ }
+ resetModifiers();
+}
protected void consumeCastExpressionWithPrimitiveType() {
// CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
@@ -2896,6 +3055,44 @@
castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
cast.sourceEnd = exp.sourceEnd;
}
+protected void consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations() {
+ // CastExpression ::= PushLPAREN Modifiers PrimitiveType Dimsopt PushRPARENForAnnotatedTypeCast InsideCastExpression UnaryExpression
+
+ //this.intStack : posOfLeftParen dim posOfRightParen
+ int end = this.intStack[this.intPtr--];
+
+ // pop expression
+ Expression expression = this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+
+ TypeReference typeReference = getTypeReference(this.intStack[this.intPtr--]);
+ int length;
+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ typeReference.annotations = new Annotation[length],
+ 0,
+ length);
+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
+ if (this.modifiersSourceStart < typeReferenceSourceStart) {
+ typeReferenceSourceStart = this.modifiersSourceStart;
+ }
+ typeReference.bits |= ASTNode.HasTypeAnnotations;
+ typeReference.sourceStart = typeReferenceSourceStart;
+ }
+
+ Expression cast;
+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
+
+ typeReference.sourceEnd = end - 1;
+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
+ cast.sourceEnd = expression.sourceEnd;
+ if (this.modifiers != ClassFileConstants.AccDefault) {
+ problemReporter().invalidLocationForModifiers(typeReference);
+ }
+ resetModifiers();
+}
protected void consumeCastExpressionWithQualifiedGenericsArray() {
// CastExpression ::= PushLPAREN Name OnlyTypeArguments '.' ClassOrInterfaceType Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
Expression exp;
@@ -2904,7 +3101,7 @@
int end = this.intStack[this.intPtr--];
int dim = this.intStack[this.intPtr--];
- TypeReference rightSide = getTypeReference(0);
+ TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated.
ParameterizedQualifiedTypeReference qualifiedParameterizedTypeReference = computeQualifiedGenericsFromRightSide(rightSide, dim);
this.intPtr--;
@@ -2913,6 +3110,44 @@
castType.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
cast.sourceEnd = exp.sourceEnd;
}
+protected void consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations() {
+ // CastExpression ::= PushLPAREN Name OnlyTypeArguments '.' ClassOrInterfaceType Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
+ int end = this.intStack[this.intPtr--];
+
+ int dim = this.intStack[this.intPtr--];
+ // pop expression
+ Expression expression = this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+
+ TypeReference rightSide = getUnannotatedTypeReference(0); // by design the type after . is not annotated.
+
+ ParameterizedQualifiedTypeReference typeReference = computeQualifiedGenericsFromRightSide(rightSide, dim);
+ this.intPtr--;
+ int length;
+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ typeReference.annotations = new Annotation[length],
+ 0,
+ length);
+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
+ if (this.modifiersSourceStart < typeReferenceSourceStart) {
+ typeReferenceSourceStart = this.modifiersSourceStart;
+ }
+ typeReference.bits |= ASTNode.HasTypeAnnotations;
+ typeReference.sourceStart = typeReferenceSourceStart;
+ }
+ Expression cast;
+ pushOnExpressionStack(cast = new CastExpression(expression, typeReference));
+ typeReference.sourceEnd = end - 1;
+ typeReference.sourceStart = (cast.sourceStart = this.intStack[this.intPtr--]) + 1;
+ cast.sourceEnd = expression.sourceEnd;
+ if (this.modifiers != ClassFileConstants.AccDefault) {
+ problemReporter().invalidLocationForModifiers(typeReference);
+ }
+ resetModifiers();
+}
protected void consumeCatches() {
// Catches ::= Catches CatchClause
optimizedConcatNodeLists();
@@ -3112,6 +3347,7 @@
TypeReference superClass = getTypeReference(0);
// There is a class declaration on the top of stack
TypeDeclaration typeDecl = (TypeDeclaration) this.astStack[this.astPtr];
+ typeDecl.bits |= (superClass.bits & ASTNode.HasTypeAnnotations);
typeDecl.superclass = superClass;
superClass.bits |= ASTNode.IsSuperType;
typeDecl.bodyStart = typeDecl.superclass.sourceEnd + 1;
@@ -3133,8 +3369,11 @@
typeDecl.superInterfaces = new TypeReference[length],
0,
length);
- for (int i = 0, max = typeDecl.superInterfaces.length; i < max; i++) {
- typeDecl.superInterfaces[i].bits |= ASTNode.IsSuperType;
+ TypeReference[] superinterfaces = typeDecl.superInterfaces;
+ for (int i = 0, max = superinterfaces.length; i < max; i++) {
+ TypeReference typeReference = superinterfaces[i];
+ typeDecl.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations);
+ typeReference.bits |= ASTNode.IsSuperType;
}
typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1;
this.listLength = 0; // reset after having read super-interfaces
@@ -3558,9 +3797,11 @@
}
}
- if (!this.diet || insideFieldInitializer){
- // add it only in non-diet mode, if diet_bodies, then constructor call will be added elsewhere.
- constructorCall = SuperReference.implicitSuperConstructorCall();
+ if (!this.options.ignoreMethodBodies) {
+ if (!this.diet || insideFieldInitializer){
+ // add it only in non-diet mode, if diet_bodies, then constructor call will be added elsewhere.
+ constructorCall = SuperReference.implicitSuperConstructorCall();
+ }
}
}
@@ -3768,6 +4009,7 @@
}
protected void consumeDimWithOrWithOutExpr() {
// DimWithOrWithOutExpr ::= '[' ']'
+ // DimWithOrWithOutExpr ::= OneOrMoreAnnotations '[' ']'
pushOnExpressionStack(null);
if(this.currentElement != null && this.currentToken == TokenNameLBRACE) {
@@ -3982,6 +4224,7 @@
localDeclaration.annotations = new Annotation[length],
0,
length);
+ localDeclaration.bits |= ASTNode.HasTypeAnnotations;
}
if (hasModifiers) {
localDeclaration.declarationSourceStart = declarationSourceStart;
@@ -3990,6 +4233,7 @@
localDeclaration.declarationSourceStart = type.sourceStart;
}
localDeclaration.type = type;
+ localDeclaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
ForeachStatement iteratorForStatement =
new ForeachStatement(
@@ -4080,6 +4324,8 @@
char[] identifierName = this.identifierStack[this.identifierPtr];
long namePosition = this.identifierPositionStack[this.identifierPtr];
int extendedDimension = this.intStack[this.intPtr--];
+ // pop any annotations on extended dimensions now, so they don't pollute the base dimensions.
+ Annotation [][] annotationsOnExtendedDimensions = extendedDimension == 0 ? null : getAnnotationsOnDimensions(extendedDimension);
AbstractVariableDeclaration declaration;
// create the ast node
boolean isLocalDeclaration = this.nestedMethod[this.nestedType] != 0;
@@ -4112,6 +4358,7 @@
declaration.annotations = new Annotation[length],
0,
length);
+ declaration.bits |= ASTNode.HasTypeAnnotations;
}
type = getTypeReference(typeDim = this.intStack[this.intPtr--]); // type dimension
if (declaration.declarationSourceStart == -1) {
@@ -4133,6 +4380,7 @@
declaration.annotations = new Annotation[length],
0,
length);
+ declaration.bits |= ASTNode.HasTypeAnnotations;
}
// Store javadoc only on first declaration as it is the same for all ones
FieldDeclaration fieldDeclaration = (FieldDeclaration) declaration;
@@ -4150,14 +4398,22 @@
if (annotations != null) {
final int annotationsLength = annotations.length;
System.arraycopy(annotations, 0, declaration.annotations = new Annotation[annotationsLength], 0, annotationsLength);
+ declaration.bits |= ASTNode.HasTypeAnnotations;
}
}
if (extendedDimension == 0) {
declaration.type = type;
+ declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
} else {
int dimension = typeDim + extendedDimension;
- declaration.type = copyDims(type, dimension);
+ Annotation [][] annotationsOnAllDimensions = null;
+ Annotation[][] annotationsOnDimensions = type.getAnnotationsOnDimensions();
+ if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) {
+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(typeDim, annotationsOnDimensions, extendedDimension, annotationsOnExtendedDimensions);
+ declaration.bits |= (type.bits & ASTNode.HasTypeAnnotations);
+ }
+ declaration.type = copyDims(type, dimension, annotationsOnAllDimensions);
}
this.variablesCounter[this.nestedType]++;
pushOnAstStack(declaration);
@@ -4184,6 +4440,30 @@
this.lastIgnoredToken = -1;
}
}
+protected Annotation[][] getMergedAnnotationsOnDimensions(int dims, Annotation[][] annotationsOnDimensions,
+ int extendedDims, Annotation[][] annotationsOnExtendedDimensions) {
+
+ if (annotationsOnDimensions == null && annotationsOnExtendedDimensions == null)
+ return null;
+
+ Annotation [][] mergedAnnotations = new Annotation[dims + extendedDims][];
+ for (int i = 0; i < dims; i++) {
+ if (annotationsOnDimensions != null) {
+ mergedAnnotations[i] = annotationsOnDimensions[i];
+ } else {
+ mergedAnnotations[i] = null;
+ }
+ }
+ for (int i = dims, j = 0; i < dims + extendedDims; i++, j++) {
+ if (annotationsOnExtendedDimensions != null) {
+ mergedAnnotations[i] = annotationsOnExtendedDimensions[j];
+ } else {
+ mergedAnnotations[i] = null;
+ }
+ }
+
+ return mergedAnnotations;
+}
protected void consumeEnumBodyNoConstants() {
// nothing to do
// The 0 on the astLengthStack has been pushed by EnumBodyDeclarationsopt
@@ -4294,6 +4574,7 @@
enumConstant.annotations = new Annotation[length],
0,
length);
+ enumConstant.bits |= ASTNode.HasTypeAnnotations;
}
pushOnAstStack(enumConstant);
if (this.currentElement != null){
@@ -4320,18 +4601,18 @@
concatNodeLists();
}
protected void consumeEnumConstantWithClassBody() {
- dispatchDeclarationInto(this.astLengthStack[this.astLengthPtr--]);
- TypeDeclaration anonymousType = (TypeDeclaration) this.astStack[this.astPtr--]; // pop type
- this.astLengthPtr--;
- anonymousType.bodyEnd = this.endPosition;
- anonymousType.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
- final FieldDeclaration fieldDeclaration = ((FieldDeclaration) this.astStack[this.astPtr]);
- fieldDeclaration.declarationEnd = this.endStatementPosition;
+ dispatchDeclarationInto(this.astLengthStack[this.astLengthPtr--]);
+ TypeDeclaration anonymousType = (TypeDeclaration) this.astStack[this.astPtr--]; // pop type
+ this.astLengthPtr--;
+ anonymousType.bodyEnd = this.endPosition;
+ anonymousType.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
+ final FieldDeclaration fieldDeclaration = ((FieldDeclaration) this.astStack[this.astPtr]);
+ fieldDeclaration.declarationEnd = this.endStatementPosition;
int declarationSourceEnd = anonymousType.declarationSourceEnd;
fieldDeclaration.declarationSourceEnd = declarationSourceEnd;
- this.intPtr --; // remove end position of the arguments
- this.variablesCounter[this.nestedType] = 0;
- this.nestedType--;
+ this.intPtr --; // remove end position of the arguments
+ this.variablesCounter[this.nestedType] = 0;
+ this.nestedType--;
ASTNode initialization = fieldDeclaration.initialization;
if (initialization != null) {
initialization.sourceEnd = declarationSourceEnd;
@@ -4880,13 +5161,18 @@
/*
this.astStack :
this.identifierStack : type identifier
- this.intStack : dim dim
+ this.intStack : dim dim 1||0 // 1 => normal parameter, 0 => this parameter
==>
this.astStack : Argument
this.identifierStack :
this.intStack :
*/
-
+ TypeReference qualifyingTypeReference = null;
+ boolean isReceiver = this.intStack[this.intPtr--] == 0;
+ if (isReceiver) {
+ qualifyingTypeReference = (TypeReference) this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr --;
+ }
this.identifierLengthPtr--;
char[] identifierName = this.identifierStack[this.identifierPtr];
long namePositions = this.identifierPositionStack[this.identifierPtr--];
@@ -4896,20 +5182,44 @@
endOfEllipsis = this.intStack[this.intPtr--];
}
int firstDimensions = this.intStack[this.intPtr--];
- final int typeDimensions = firstDimensions + extendedDimensions;
-//{ObjectTeams: LiftingTypeRefernce is introduced here as specific type reference
-/* orig:
- TypeReference type = getTypeReference(typeDimensions);
- :giro */
- TypeReference type = null;
+ TypeReference type = getUnannotatedTypeReference(extendedDimensions);
+ Annotation [] varArgsAnnotations = null;
+ int length;
+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.typeAnnotationStack,
+ (this.typeAnnotationPtr -= length) + 1,
+ varArgsAnnotations = new Annotation[length],
+ 0,
+ length);
+ }
+ final int typeDimensions = firstDimensions + extendedDimensions + (isVarArgs ? 1 : 0);
- if (this.astPtr > -1 && this.astStack[this.astPtr] instanceof LiftingTypeReference)
- type = completeLiftingTypeReference(typeDimensions);
- else
- type = getTypeReference(typeDimensions);
+ if (typeDimensions != extendedDimensions) {
+ // jsr308 type annotations management
+ Annotation [][] annotationsOnFirstDimensions = firstDimensions == 0 ? null : getAnnotationsOnDimensions(firstDimensions);
+ Annotation [][] annotationsOnExtendedDimensions = extendedDimensions == 0 ? null : type.getAnnotationsOnDimensions();
+ Annotation [][] annotationsOnAllDimensions = null;
+ if (annotationsOnFirstDimensions != null || annotationsOnExtendedDimensions != null || varArgsAnnotations != null) {
+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions, annotationsOnFirstDimensions, extendedDimensions, annotationsOnExtendedDimensions);
+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(firstDimensions + extendedDimensions, annotationsOnAllDimensions, isVarArgs ? 1 : 0, isVarArgs ? new Annotation[][]{varArgsAnnotations} : null);
+ }
+ type = copyDims(type, typeDimensions, annotationsOnAllDimensions);
+ type.sourceEnd = type.isParameterizedTypeReference() ? this.endStatementPosition : this.endPosition;
+ }
+//FIXME integrate with above? Or entirely re-construct handling of LiftingType?
+//{ObjectTeams: LiftingTypeRefernce is introduced here as specific type reference
+///* orig:
+// TypeReference type = getTypeReference(typeDimensions);
+// :giro */
+// TypeReference type = null;
+//
+// if (this.astPtr > -1 && this.astStack[this.astPtr] instanceof LiftingTypeReference)
+// type = completeLiftingTypeReference(typeDimensions);
+// else
+// type = getTypeReference(typeDimensions);
// Markus Witte}
if (isVarArgs) {
- type = copyDims(type, typeDimensions + 1);
if (extendedDimensions == 0) {
type.sourceEnd = endOfEllipsis;
}
@@ -4917,15 +5227,24 @@
}
int modifierPositions = this.intStack[this.intPtr--];
this.intPtr--;
- Argument arg =
- new Argument(
+ Argument arg;
+ if (isReceiver) {
+ arg = new Receiver(
+ identifierName,
+ namePositions,
+ type,
+ qualifyingTypeReference,
+ this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated);
+ } else {
+ arg = new Argument(
identifierName,
namePositions,
type,
this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
+ }
arg.declarationSourceStart = modifierPositions;
+ arg.bits |= (type.bits & ASTNode.HasTypeAnnotations);
// consume annotations
- int length;
if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
System.arraycopy(
this.expressionStack,
@@ -4933,6 +5252,7 @@
arg.annotations = new Annotation[length],
0,
length);
+ arg.bits |= ASTNode.HasTypeAnnotations;
RecoveredType currentRecoveryType = this.currentRecoveryType();
if (currentRecoveryType != null)
currentRecoveryType.annotationsConsumed(arg.annotations);
@@ -4952,8 +5272,38 @@
extendedDimensions > 0) {
problemReporter().illegalExtendedDimensions(arg);
}
+ } else {
+ // The grammar allows trailing annotations in FormalParameter as in
+ // "int @NonNull[] @Misplaced parameter" in order to allow for constructs such as
+ // "Object @NonNull[] @Correct ... objects" -- we prune these here.
+ if (varArgsAnnotations != null) {
+ problemReporter().misplacedTypeAnnotations(varArgsAnnotations[0],
+ varArgsAnnotations[varArgsAnnotations.length-1]);
+ }
}
}
+protected Annotation[][] getAnnotationsOnDimensions(int dimensionsCount) {
+ Annotation [][] dimensionsAnnotations = null;
+ if (dimensionsCount > 0) {
+ for (int i = 0; i < dimensionsCount; i++) {
+ Annotation [] annotations = null;
+ int length;
+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.typeAnnotationStack,
+ (this.typeAnnotationPtr -= length) + 1,
+ annotations = new Annotation[length],
+ 0,
+ length);
+ if (dimensionsAnnotations == null) {
+ dimensionsAnnotations = new Annotation[dimensionsCount][];
+ }
+ dimensionsAnnotations[dimensionsCount - i - 1] = annotations;
+ }
+ }
+ }
+ return dimensionsAnnotations;
+}
protected void consumeFormalParameterList() {
// FormalParameterList ::= FormalParameterList ',' FormalParameter
optimizedConcatNodeLists();
@@ -5015,6 +5365,9 @@
protected void consumeInsideCastExpressionWithQualifiedGenerics() {
// InsideCastExpressionWithQualifiedGenerics ::= $empty
}
+protected void consumeInsideCastExpressionWithAnnotatedQualifiedGenerics() {
+ // InsideCastExpressionWithAnnotatedQualifiedGenerics ::= $empty
+}
protected void consumeInstanceOfExpression() {
// RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType
//optimize the push/pop
@@ -5111,8 +5464,11 @@
typeDecl.superInterfaces = new TypeReference[length],
0,
length);
- for (int i = 0, max = typeDecl.superInterfaces.length; i < max; i++) {
- typeDecl.superInterfaces[i].bits |= ASTNode.IsSuperType;
+ TypeReference[] superinterfaces = typeDecl.superInterfaces;
+ for (int i = 0, max = superinterfaces.length; i < max; i++) {
+ TypeReference typeReference = superinterfaces[i];
+ typeDecl.bits |= (typeReference.bits & ASTNode.HasTypeAnnotations);
+ typeReference.bits |= ASTNode.IsSuperType;
}
typeDecl.bodyStart = typeDecl.superInterfaces[length-1].sourceEnd + 1;
this.listLength = 0; // reset after having read super-interfaces
@@ -5308,7 +5664,7 @@
pushOnAstLengthStack(-1);
concatNodeLists();
}
-protected void consumeInvalidMethodDeclaration() {
+protected void consumeInterfaceMethodDeclaration(boolean isDefault) {
// InterfaceMemberDeclaration ::= InvalidMethodDeclaration
/*
@@ -5336,9 +5692,17 @@
MethodDeclaration md = (MethodDeclaration) this.astStack[this.astPtr];
md.bodyEnd = this.endPosition;
md.declarationSourceEnd = flushCommentsDefinedPriorTo(this.endStatementPosition);
+
+ if (isDefault) {
+ if (this.parsingJava8Plus) {
+ md.modifiers |= ExtraCompilerModifiers.AccDefaultMethod;
+ } else {
+ problemReporter().defaultMethodsNotBelow18(md);
+ }
+ }
// report the problem and continue the parsing - narrowing the problem onto the method
- if(!this.statementRecoveryActivated) problemReporter().abstractMethodNeedingNoBody(md);
+ if(!this.statementRecoveryActivated && !isDefault) problemReporter().abstractMethodNeedingNoBody(md);
}
protected void consumeLabel() {
// Do nothing
@@ -5513,8 +5877,10 @@
if (isNotAbstract) {
//statements
explicitDeclarations = this.realBlockStack[this.realBlockPtr--];
- if (!this.options.ignoreMethodBodies) {
- if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) {
+ if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) {
+ if (this.options.ignoreMethodBodies) {
+ this.astPtr -= length;
+ } else {
System.arraycopy(
this.astStack,
(this.astPtr -= length) + 1,
@@ -5522,9 +5888,6 @@
0,
length);
}
- } else {
- length = this.astLengthStack[this.astLengthPtr--];
- this.astPtr -= length;
}
}
@@ -5624,7 +5987,13 @@
TypeReference returnType = md.returnType;
md.sourceEnd = this.endPosition;
int dims = returnType.dimensions() + extendedDims;
- md.returnType = copyDims(returnType, dims);
+ Annotation [][] annotationsOnDimensions = returnType.getAnnotationsOnDimensions();
+ Annotation [][] annotationsOnExtendedDimensions = getAnnotationsOnDimensions(extendedDims);
+ Annotation [][] annotationsOnAllDimensions = null;
+ if (annotationsOnDimensions != null || annotationsOnExtendedDimensions != null) {
+ annotationsOnAllDimensions = getMergedAnnotationsOnDimensions(returnType.dimensions(), annotationsOnDimensions, extendedDims, annotationsOnExtendedDimensions);
+ }
+ md.returnType = copyDims(returnType, dims, annotationsOnAllDimensions);
if (this.currentToken == TokenNameLBRACE){
md.bodyStart = this.endPosition + 1;
}
@@ -5715,7 +6084,9 @@
long selectorSource = this.identifierPositionStack[this.identifierPtr--];
this.identifierLengthPtr--;
//type
- md.returnType = getTypeReference(this.intStack[this.intPtr--]);
+ TypeReference returnType = getTypeReference(this.intStack[this.intPtr--]);
+ md.returnType = returnType;
+ md.bits |= (returnType.bits & ASTNode.HasTypeAnnotations);
// consume type parameters
int length = this.genericsLengthStack[this.genericsLengthPtr--];
@@ -6220,6 +6591,27 @@
// Resources ::= Resources ';' Resource
concatNodeLists();
}
+protected void consumeOneMoreTypeAnnotation() {
+ // OneOrMoreAnnotations ::= OneOrMoreAnnotations Annotation
+ this.expressionLengthPtr --;
+ Annotation annotation = (Annotation) this.expressionStack[this.expressionPtr--];
+ pushOnTypeAnnotationStack(annotation);
+ this.typeAnnotationLengthStack[--this.typeAnnotationLengthPtr]++;
+ if(!this.statementRecoveryActivated &&
+ this.options.sourceLevel <= ClassFileConstants.JDK1_7 &&
+ this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
+ problemReporter().invalidUsageOfTypeAnnotations(annotation);
+ }
+}
+protected void consumePotentialNameArrayType () {
+
+ // FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray VariableDeclaratorId
+ // FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt PotentialNameArray '...' VariableDeclaratorId
+ // PotentialNameArray -> $empty
+ // Dimensions including lack of have been pushed appropriately by action attached to DimsoptAnnotsopt
+ pushOnGenericsLengthStack(0); // handle type arguments
+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
+}
protected void consumeNameArrayType() {
pushOnGenericsLengthStack(0); // handle type arguments
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
@@ -6283,9 +6675,21 @@
}
this.recordStringLiterals = true;
}
-protected void consumeOneDimLoop() {
+protected void consumeOneDimLoop(boolean expressionStackMayHaveAnnotations) {
// OneDimLoop ::= '[' ']'
+ // OneDimOrAnnot -> '[' ']'
this.dimensions++;
+ if (!expressionStackMayHaveAnnotations || this.unattachedAnnotationPtr == -1 ) {
+ pushOnTypeAnnotationLengthStack(0); // no annotations for the current dimension.
+ } else {
+ this.unattachedAnnotationPtr = -1; // Leave type annotation stacks they are.
+ }
+}
+protected void consumeOneDimLoopWithAnnotations() {
+ // OneDimLoop ::= OneOrMoreAnnotations '[' ']'
+ this.dimensions++;
+ // Top of expression stack contains annotations of length specified
+ // by top of expression length stack that apply to this dimension.
}
protected void consumeOnlySynchronized() {
// OnlySynchronized ::= 'synchronized'
@@ -6825,9 +7229,19 @@
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
pushOnGenericsLengthStack(0);
-
+ ClassLiteralAccess cla;
pushOnExpressionStack(
- new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(this.intStack[this.intPtr--])));
+ cla = new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(this.intStack[this.intPtr--])));
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=383884
+ Annotation [][] dimensionAnnotations = cla.type.getAnnotationsOnDimensions();
+ if (dimensionAnnotations != null) {
+ for (int i = 0, max = dimensionAnnotations.length; i < max; i++) {
+ Annotation [] annotations = dimensionAnnotations[i];
+ if (annotations != null) {
+ problemReporter().misplacedTypeAnnotations(annotations[0], annotations[annotations.length - 1]);
+ }
+ }
+ }
}
protected void consumePrimaryNoNewArrayName() {
// PrimaryNoNewArray ::= Name '.' 'class'
@@ -6836,7 +7250,7 @@
// handle type arguments
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
pushOnGenericsLengthStack(0);
- TypeReference typeReference = getTypeReference(0);
+ TypeReference typeReference = getUnannotatedTypeReference(0);
pushOnExpressionStack(
new ClassLiteralAccess(this.intStack[this.intPtr--], typeReference));
@@ -6846,7 +7260,7 @@
// handle type arguments
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
pushOnGenericsLengthStack(0);
- TypeReference typeReference = getTypeReference(0);
+ TypeReference typeReference = getUnannotatedTypeReference(0);
pushOnExpressionStack(
new QualifiedSuperReference(
@@ -6859,8 +7273,7 @@
// handle type arguments
pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
pushOnGenericsLengthStack(0); // handle type arguments
-
- TypeReference typeReference = getTypeReference(0);
+ TypeReference typeReference = getUnannotatedTypeReference(0);
pushOnExpressionStack(
new QualifiedThisReference(
@@ -6871,14 +7284,25 @@
protected void consumePrimaryNoNewArrayPrimitiveArrayType() {
// PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class'
this.intPtr--; // remove the class start position
+ ClassLiteralAccess cla;
pushOnExpressionStack(
- new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(this.intStack[this.intPtr--])));
+ cla = new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(this.intStack[this.intPtr--])));
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=383884
+ Annotation [][] dimensionAnnotations = cla.type.getAnnotationsOnDimensions();
+ if (dimensionAnnotations != null) {
+ for (int i = 0, max = dimensionAnnotations.length; i < max; i++) {
+ Annotation [] annotations = dimensionAnnotations[i];
+ if (annotations != null) {
+ problemReporter().misplacedTypeAnnotations(annotations[0], annotations[annotations.length - 1]);
+ }
+ }
+ }
}
protected void consumePrimaryNoNewArrayPrimitiveType() {
// PrimaryNoNewArray ::= PrimitiveType '.' 'class'
this.intPtr--; // remove the class start position
pushOnExpressionStack(
- new ClassLiteralAccess(this.intStack[this.intPtr--], getTypeReference(0)));
+ new ClassLiteralAccess(this.intStack[this.intPtr--], getUnannotatedTypeReference(0)));
}
protected void consumePrimaryNoNewArrayThis() {
// PrimaryNoNewArray ::= 'this'
@@ -7016,2147 +7440,2890 @@
// PushRPAREN ::= ')'
pushOnIntStack(this.rParenPos);
}
+protected void consumeUnannotatedType() {
+ /* We go through some song & dance here to get the type annotations stacks
+ to reflect the fact that this type was unannotated. Using a dummy non-terminal
+ with an empty rhs leads to conflicts in many places :-(
+ */
+ pushOnTypeAnnotationLengthStack(0); // either done or else made room.
+ int dims = this.intStack[this.intPtr];
+ if (dims != 0) {
+ System.arraycopy(
+ this.typeAnnotationLengthStack,
+ this.typeAnnotationLengthPtr - dims,
+ this.typeAnnotationLengthStack,
+ this.typeAnnotationLengthPtr - dims + 1,
+ dims);
+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims] = 0; // tag type as unannotated
+ }
+}
+protected void consumeAnnotatedType() {
+ /* We go through some song & dance here to get the type annotations stacks
+ to reflect the fact that this type was unannotated. Using a dummy non-terminal
+ with an empty rhs leads to conflicts in many places :-(
+ */
+ int dims = this.intStack[this.intPtr];
+ if (dims != 0) {
+ int counter = 0;
+ for (int i = 0; i < dims; i++) {
+ // we count existing dimensions with annotations
+ counter += this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims + 1 + i];
+ }
+ System.arraycopy(
+ this.typeAnnotationLengthStack,
+ this.typeAnnotationLengthPtr - dims + 1,
+ this.typeAnnotationLengthStack,
+ this.typeAnnotationLengthPtr - dims + 2,
+ dims);
+ int length = this.expressionLengthStack[this.expressionLengthPtr--];
+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr - dims + 1] = length;
+ int typeAnnotationStackLength = this.typeAnnotationStack.length;
+ if (this.typeAnnotationPtr + counter + length >= typeAnnotationStackLength) {
+ System.arraycopy(
+ this.typeAnnotationStack,
+ 0,
+ this.typeAnnotationStack = new Annotation[typeAnnotationStackLength + TypeAnnotationStackIncrement],
+ 0,
+ typeAnnotationStackLength);
+ }
+ System.arraycopy(
+ this.typeAnnotationStack,
+ this.typeAnnotationPtr - counter + 1,
+ this.typeAnnotationStack,
+ this.typeAnnotationPtr - counter + 1 + length,
+ counter);
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ this.typeAnnotationStack,
+ this.typeAnnotationPtr - counter + 1,
+ length);
+ this.typeAnnotationPtr += length;
+ this.typeAnnotationLengthPtr++;
+ } else {
+ int length = this.expressionLengthStack[this.expressionLengthPtr--];
+ int typeAnnotationStackLength = this.typeAnnotationStack.length;
+ if (this.typeAnnotationPtr + length >= typeAnnotationStackLength) {
+ System.arraycopy(
+ this.typeAnnotationStack,
+ 0,
+ this.typeAnnotationStack = new Annotation[typeAnnotationStackLength + TypeAnnotationStackIncrement],
+ 0,
+ typeAnnotationStackLength);
+ }
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ this.typeAnnotationStack,
+ this.typeAnnotationPtr + 1,
+ length);
+ this.typeAnnotationPtr += length;
+ pushOnTypeAnnotationLengthStack(length);
+ }
+// if (this.modifiers != ClassFileConstants.AccDefault) {
+// problemReporter().invalidLocationForModifiers(typeReference);
+// }
+// resetModifiers();
+}
+protected void consumeTypeAnnotation (boolean markAsUnattached) {
+ if(!this.statementRecoveryActivated &&
+ this.options.sourceLevel <= ClassFileConstants.JDK1_7 &&
+ this.lastErrorEndPositionBeforeRecovery < this.scanner.currentPosition) {
+ problemReporter().invalidUsageOfTypeAnnotations((Annotation) this.expressionStack[this.expressionPtr]);
+ }
+ this.expressionLengthPtr --;
+ Annotation annotation = (Annotation) this.expressionStack[this.expressionPtr--];
+ pushOnTypeAnnotationStack(annotation);
+ if (markAsUnattached) {
+ if (this.unattachedAnnotationPtr == -1) {
+ this.unattachedAnnotationPtr = this.typeAnnotationPtr;
+ } else {
+ this.typeAnnotationLengthStack[--this.typeAnnotationLengthPtr]++;
+ }
+ }
+}
+protected void consumeDimsWithTrailingAnnotsopt() {
+ // DimsoptAnnotsopt -> DimsAnnotLoop
+ pushOnIntStack(this.dimensions);
+ this.dimensions = 0;
+ if (this.unattachedAnnotationPtr == -1) {
+ pushOnTypeAnnotationLengthStack(0); // no trailing annotations (receiver/vararg)
+ } else {
+ this.unattachedAnnotationPtr = -1; // reset this and leave the annotation stacks as they are.
+ }
+}
+protected void consumeZeroTypeAnnotations(boolean shouldPush) {
+ if (shouldPush) {
+ pushOnTypeAnnotationLengthStack(0);
+ } else {
+ this.typeAnnotationLengthPtr --; // pop the 0 from the length stack
+ }
+}
+protected void consumeEmptyDimsoptAnnotsopt() {
+ // DimsoptAnnotsopt ::= $empty
+ pushOnIntStack(0); // signal a non array
+ pushOnTypeAnnotationLengthStack(0); // no trailing annotations (receiver/vararg)
+}
+protected void consumeRightParenForUnannotatedTypeCast() {
+ consumeUnannotatedType();
+ // PushRPAREN ::= ')'
+ pushOnIntStack(this.rParenPos);
+}
+protected void consumeRightParenForNameUnannotatedTypeCast() {
+ pushOnIntStack(0); // signal a non array
+ consumeUnannotatedType();
+ // remove the fake dimension
+ this.intPtr--;
+ // PushRPAREN ::= ')'
+ pushOnIntStack(this.rParenPos);
+}
+protected void consumeRightParenForAnnotatedTypeCast() {
+ consumeUnannotatedType();
+ // PushRPAREN ::= ')'
+ pushOnIntStack(this.rParenPos);
+}
+protected void consumeRightParenForNameAndAnnotatedTypeCast() {
+ // push a zero for dimensions
+ pushOnIntStack(0);
+ consumeUnannotatedType();
+ // remove the fake dimension
+ this.intPtr--;
+ // PushRPAREN ::= ')'
+ pushOnIntStack(this.rParenPos);
+}
// This method is part of an automatic generation : do NOT edit-modify
protected void consumeRule(int act) {
switch ( act ) {
- case 35 : if (DEBUG) { System.out.println("Type ::= PrimitiveType"); } //$NON-NLS-1$
+ case 37 : if (DEBUG) { System.out.println("Type ::= TypeInternal"); } //$NON-NLS-1$
+ consumeUnannotatedType();
+ break;
+
+ case 39 : if (DEBUG) { System.out.println("Type0 ::= TypeInternal"); } //$NON-NLS-1$
+ consumeUnannotatedType();
+ break;
+
+ case 40 : if (DEBUG) { System.out.println("TypeInternal ::= PrimitiveType"); } //$NON-NLS-1$
consumePrimitiveType();
break;
- case 52 : if (DEBUG) { System.out.println("ReferenceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
- consumeReferenceType();
+ case 54 : if (DEBUG) { System.out.println("ReferenceType ::= ReferenceType0"); } //$NON-NLS-1$
+ consumeUnannotatedType();
break;
- case 56 : if (DEBUG) { System.out.println("ClassOrInterface ::= Name"); } //$NON-NLS-1$
- consumeClassOrInterfaceName();
+ case 55 : if (DEBUG) { System.out.println("ReferenceType ::= Modifiers ReferenceType0"); } //$NON-NLS-1$
+ consumeAnnotatedType();
break;
- case 57 : if (DEBUG) { System.out.println("ClassOrInterface ::= GenericType DOT Name"); } //$NON-NLS-1$
- consumeClassOrInterface();
+ case 56 : if (DEBUG) { System.out.println("ReferenceType0 ::= ClassOrInterfaceType0"); } //$NON-NLS-1$
+ consumeReferenceType();
break;
- case 58 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments"); } //$NON-NLS-1$
- consumeGenericType();
+ case 58 : if (DEBUG) { System.out.println("Annotationsopt ::="); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations(true);
break;
- case 59 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$
+ case 63 : if (DEBUG) { System.out.println("ClassOrInterface ::= ClassOrInterface0"); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations(true);
+ break;
+
+ case 64 : if (DEBUG) { System.out.println("ClassOrInterface0 ::= Name"); } //$NON-NLS-1$
+ consumeClassOrInterfaceName();
+ break;
+
+ case 66 : if (DEBUG) { System.out.println("PopZeroTypeAnnotations ::="); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations(false);
+ break;
+
+ case 67 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface TypeArguments..."); } //$NON-NLS-1$
+ consumeGenericType();
+ break;
+
+ case 68 : if (DEBUG) { System.out.println("GenericTypeDotName ::= GenericType DOT Name"); } //$NON-NLS-1$
+ consumeClassOrInterface();
+ break;
+
+ case 69 : if (DEBUG) { System.out.println("GenericType ::= ClassOrInterface LESS GREATER"); } //$NON-NLS-1$
consumeGenericTypeWithDiamond();
break;
- case 60 : if (DEBUG) { System.out.println("LiftingType ::= ClassType as ClassType"); } //$NON-NLS-1$
+ case 71 : if (DEBUG) { System.out.println("LiftingTypeopt ::= as Name DimsoptAnnotsopt"); } //$NON-NLS-1$
consumeLiftingType();
break;
- case 61 : if (DEBUG) { System.out.println("ArrayLiftingType ::= ArrayType as ArrayType"); } //$NON-NLS-1$
- consumeLiftingTypeArray();
+ case 72 : if (DEBUG) { System.out.println("LiftingTypeopt ::= as GenericType DimsoptAnnotsopt"); } //$NON-NLS-1$
+ consumeLiftingType();
break;
- case 62 : if (DEBUG) { System.out.println("InvalidDeclaredArrayLifting ::= ClassType as ArrayType"); } //$NON-NLS-1$
- consumeLiftingTypeArrayInvalid();
+ case 73 : if (DEBUG) { System.out.println("LiftingTypeopt ::= as GenericTypeDotName DimsoptAnnotsopt"); } //$NON-NLS-1$
+ consumeLiftingType();
break;
- case 63 : if (DEBUG) { System.out.println("InvalidDeclaredArrayLifting ::= ArrayType as ClassType"); } //$NON-NLS-1$
- consumeLiftingTypeArrayInvalid();
- break;
-
- case 64 : if (DEBUG) { System.out.println("BaseAnchoredType ::= base DOT SimpleName"); } //$NON-NLS-1$
+ case 74 : if (DEBUG) { System.out.println("BaseAnchoredType ::= base DOT SimpleName"); } //$NON-NLS-1$
consumeBaseAnchoredType();
break;
- case 67 : if (DEBUG) { System.out.println("ArrayTypeWithTypeArgumentsName ::= GenericType DOT Name"); } //$NON-NLS-1$
- consumeArrayTypeWithTypeArgumentsName();
- break;
-
- case 68 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$
+ case 78 : if (DEBUG) { System.out.println("ArrayType ::= PrimitiveType Dims"); } //$NON-NLS-1$
consumePrimitiveArrayType();
break;
- case 69 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$
+ case 79 : if (DEBUG) { System.out.println("ArrayType ::= Name Dims"); } //$NON-NLS-1$
consumeNameArrayType();
break;
- case 70 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$
+ case 80 : if (DEBUG) { System.out.println("ArrayType ::= ArrayTypeWithTypeArgumentsName Dims"); } //$NON-NLS-1$
consumeGenericTypeNameArrayType();
break;
- case 71 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$
+ case 81 : if (DEBUG) { System.out.println("ArrayType ::= GenericType Dims"); } //$NON-NLS-1$
consumeGenericTypeArrayType();
break;
- case 76 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT SimpleName"); } //$NON-NLS-1$
+ case 86 : if (DEBUG) { System.out.println("QualifiedName ::= Name DOT SimpleName"); } //$NON-NLS-1$
consumeQualifiedName();
break;
- case 77 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$
+ case 87 : if (DEBUG) { System.out.println("CompilationUnit ::= EnterCompilationUnit..."); } //$NON-NLS-1$
consumeCompilationUnit();
break;
- case 78 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$
+ case 88 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration"); } //$NON-NLS-1$
consumeInternalCompilationUnit();
break;
- case 79 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ case 89 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
consumeInternalCompilationUnit();
break;
- case 80 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ case 90 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 81 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
+ case 91 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= PackageDeclaration..."); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 82 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
+ case 92 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
consumeInternalCompilationUnit();
break;
- case 83 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$
+ case 93 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 84 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
+ case 94 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$
consumeInternalCompilationUnitWithTypes();
break;
- case 85 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$
+ case 95 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$
consumeEmptyInternalCompilationUnit();
break;
- case 86 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$
+ case 96 : if (DEBUG) { System.out.println("ReduceImports ::="); } //$NON-NLS-1$
consumeReduceImports();
break;
- case 87 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$
+ case 97 : if (DEBUG) { System.out.println("EnterCompilationUnit ::="); } //$NON-NLS-1$
consumeEnterCompilationUnit();
break;
- case 105 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
+ case 118 : if (DEBUG) { System.out.println("CatchHeader ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
consumeCatchHeader();
break;
- case 107 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$
+ case 120 : if (DEBUG) { System.out.println("ImportDeclarations ::= ImportDeclarations..."); } //$NON-NLS-1$
consumeImportDeclarations();
break;
- case 109 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$
+ case 122 : if (DEBUG) { System.out.println("TypeDeclarations ::= TypeDeclarations TypeDeclaration"); } //$NON-NLS-1$
consumeTypeDeclarations();
break;
- case 110 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$
+ case 123 : if (DEBUG) { System.out.println("PackageDeclaration ::= PackageDeclarationName SEMICOLON"); } //$NON-NLS-1$
consumePackageDeclaration();
break;
- case 111 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$
+ case 124 : if (DEBUG) { System.out.println("PackageDeclarationName ::= Modifiers package..."); } //$NON-NLS-1$
consumePackageDeclarationNameWithModifiers();
break;
- case 112 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$
- consumePackageDeclarationName();
+ case 125 : if (DEBUG) { System.out.println("PackageDeclarationName ::= PackageComment package Name"); } //$NON-NLS-1$
+ consumePackageDeclarationName();
break;
- case 113 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$
+ case 126 : if (DEBUG) { System.out.println("PackageComment ::="); } //$NON-NLS-1$
consumePackageComment();
break;
- case 119 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$
+ case 132 : if (DEBUG) { System.out.println("SingleTypeImportDeclaration ::=..."); } //$NON-NLS-1$
consumeImportDeclaration();
break;
- case 120 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import ImportName"); } //$NON-NLS-1$
+ case 133 : if (DEBUG) { System.out.println("SingleTypeImportDeclarationName ::= import ImportName"); } //$NON-NLS-1$
consumeSingleTypeImportDeclarationName();
break;
- case 122 : if (DEBUG) { System.out.println("ImportName ::= Name DOT team DOT Name"); } //$NON-NLS-1$
+ case 135 : if (DEBUG) { System.out.println("ImportName ::= Name DOT team DOT Name"); } //$NON-NLS-1$
consumeNameContainingTeam();
break;
- case 123 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
+ case 136 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
consumeImportDeclaration();
break;
- case 124 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$
+ case 137 : if (DEBUG) { System.out.println("TypeImportOnDemandDeclarationName ::= import Name DOT..."); } //$NON-NLS-1$
consumeTypeImportOnDemandDeclarationName();
break;
- case 127 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ case 140 : if (DEBUG) { System.out.println("TypeDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
consumeEmptyTypeDeclaration();
break;
- case 131 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$
+ case 144 : if (DEBUG) { System.out.println("Modifiers ::= Modifiers Modifier"); } //$NON-NLS-1$
consumeModifiers2();
break;
- case 143 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$
+ case 156 : if (DEBUG) { System.out.println("Modifier ::= Annotation"); } //$NON-NLS-1$
consumeAnnotationAsModifier();
break;
- case 147 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$
+ case 160 : if (DEBUG) { System.out.println("ClassDeclaration ::= ClassHeader ClassBody"); } //$NON-NLS-1$
consumeClassDeclaration();
break;
- case 148 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$
+ case 161 : if (DEBUG) { System.out.println("ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt..."); } //$NON-NLS-1$
consumeClassHeader();
break;
- case 149 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$
+ case 162 : if (DEBUG) { System.out.println("ClassHeaderName ::= ClassHeaderName1 TypeParameters"); } //$NON-NLS-1$
consumeTypeHeaderNameWithTypeParameters();
break;
- case 151 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); } //$NON-NLS-1$
+ case 164 : if (DEBUG) { System.out.println("ClassHeaderName1 ::= Modifiersopt class Identifier"); } //$NON-NLS-1$
consumeClassHeaderName1();
break;
- case 152 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$
+ case 165 : if (DEBUG) { System.out.println("ClassHeaderExtends ::= extends ClassType"); } //$NON-NLS-1$
consumeClassHeaderExtends();
break;
- case 153 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$
+ case 166 : if (DEBUG) { System.out.println("ClassHeaderImplements ::= implements InterfaceTypeList"); } //$NON-NLS-1$
consumeClassHeaderImplements();
break;
- case 156 : if (DEBUG) { System.out.println("ClassHeaderPlayedBy ::= playedBy ClassType"); } //$NON-NLS-1$
+ case 169 : if (DEBUG) { System.out.println("ClassHeaderPlayedBy ::= playedBy ClassType"); } //$NON-NLS-1$
consumeClassHeaderPlayedBy();
break;
- case 162 : if (DEBUG) { System.out.println("PredicateHeader ::= when"); } //$NON-NLS-1$
+ case 175 : if (DEBUG) { System.out.println("PredicateHeader ::= when"); } //$NON-NLS-1$
consumePredicate(false);
break;
- case 164 : if (DEBUG) { System.out.println("BasePredicateHeader ::= base when"); } //$NON-NLS-1$
+ case 177 : if (DEBUG) { System.out.println("BasePredicateHeader ::= base when"); } //$NON-NLS-1$
consumePredicate(true);
break;
- case 165 : if (DEBUG) { System.out.println("PredicateBody ::= LPAREN ForceNoDiet Expression..."); } //$NON-NLS-1$
+ case 178 : if (DEBUG) { System.out.println("PredicateBody ::= LPAREN ForceNoDiet Expression..."); } //$NON-NLS-1$
consumePredicateExpression();
break;
- case 166 : if (DEBUG) { System.out.println("PredicateBody ::= LPAREN RPAREN"); } //$NON-NLS-1$
+ case 179 : if (DEBUG) { System.out.println("PredicateBody ::= LPAREN RPAREN"); } //$NON-NLS-1$
consumePredicateMissingExpression();
break;
- case 167 : if (DEBUG) { System.out.println("ForceBaseIsIdentifier ::="); } //$NON-NLS-1$
+ case 180 : if (DEBUG) { System.out.println("ForceBaseIsIdentifier ::="); } //$NON-NLS-1$
consumeForceBaseIsIdentifier();
break;
- case 168 : if (DEBUG) { System.out.println("RestoreBaseKeyword ::="); } //$NON-NLS-1$
+ case 181 : if (DEBUG) { System.out.println("RestoreBaseKeyword ::="); } //$NON-NLS-1$
consumeRestoreBaseKeyword();
break;
- case 170 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$
+ case 183 : if (DEBUG) { System.out.println("InterfaceTypeList ::= InterfaceTypeList COMMA..."); } //$NON-NLS-1$
consumeInterfaceTypeList();
break;
- case 171 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
+ case 184 : if (DEBUG) { System.out.println("InterfaceType ::= ClassOrInterfaceType"); } //$NON-NLS-1$
consumeInterfaceType();
break;
- case 174 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$
+ case 187 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$
consumeClassBodyDeclarations();
break;
- case 178 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$
+ case 191 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$
consumeClassBodyDeclaration();
break;
- case 179 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$
+ case 192 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$
consumeDiet();
break;
- case 180 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$
+ case 193 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$
consumeClassBodyDeclaration();
break;
- case 181 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$
+ case 194 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$
consumeCreateInitializer();
break;
- case 190 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ case 203 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
consumeEmptyTypeDeclaration();
break;
- case 193 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 206 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type0..."); } //$NON-NLS-1$
consumeFieldDeclaration();
break;
- case 195 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$
+ case 208 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$
consumeVariableDeclarators();
break;
- case 198 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$
+ case 211 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$
consumeEnterVariable();
break;
- case 199 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$
+ case 212 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$
consumeExitVariableWithInitialization();
break;
- case 200 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$
+ case 213 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$
consumeExitVariableWithoutInitialization();
break;
- case 201 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$
+ case 214 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$
consumeForceNoDiet();
break;
- case 202 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$
+ case 215 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$
consumeRestoreDiet();
break;
- case 207 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
+ case 216 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= this"); } //$NON-NLS-1$
+ consumeExplicitThisParameter(false);
+ break;
+
+ case 217 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= Name DOT this"); } //$NON-NLS-1$
+ consumeExplicitThisParameter(true);
+ break;
+
+ case 218 : if (DEBUG) { System.out.println("VariableDeclaratorIdOrThis ::= VariableDeclaratorId"); } //$NON-NLS-1$
+ consumeVariableDeclaratorIdParameter();
+ break;
+
+ case 223 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
// set to true to consume a method with a body
consumeMethodDeclaration(true);
break;
- case 208 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$
+ case 224 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$
// set to false to consume a method without body
consumeMethodDeclaration(false);
break;
- case 209 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$
+ case 225 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$
consumeMethodHeader();
break;
- case 210 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$
+ case 226 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$
consumeMethodHeaderNameWithTypeParameters(false);
break;
- case 211 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); } //$NON-NLS-1$
+ case 227 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type0 Identifier..."); } //$NON-NLS-1$
consumeMethodHeaderName(false);
break;
- case 212 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
+ case 228 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$
consumeMethodHeaderRightParen();
break;
- case 213 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$
+ case 229 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$
consumeMethodHeaderExtendedDims();
break;
- case 214 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$
+ case 230 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$
consumeMethodHeaderThrowsClause();
break;
- case 215 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$
+ case 231 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$
consumeConstructorHeader();
break;
- case 216 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$
+ case 232 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$
consumeConstructorHeaderNameWithTypeParameters();
break;
- case 217 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$
+ case 233 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$
consumeConstructorHeaderName();
break;
- case 219 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$
+ case 235 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$
consumeFormalParameterList();
break;
- case 220 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$
+ case 236 : if (DEBUG) { System.out.println("PotentialNameArray ::="); } //$NON-NLS-1$
+ consumePotentialNameArrayType();
+ break;
+
+ case 237 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt PrimitiveType..."); } //$NON-NLS-1$
consumeFormalParameter(false);
break;
- case 221 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type ELLIPSIS..."); } //$NON-NLS-1$
+ case 238 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt PrimitiveType..."); } //$NON-NLS-1$
consumeFormalParameter(true);
break;
- case 222 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$
+ case 239 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt"); } //$NON-NLS-1$
+ consumeFormalParameter(false);
+ break;
+
+ case 240 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Name DimsoptAnnotsopt"); } //$NON-NLS-1$
+ consumeFormalParameter(true);
+ break;
+
+ case 241 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericType..."); } //$NON-NLS-1$
+ consumeFormalParameter(false);
+ break;
+
+ case 242 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericType..."); } //$NON-NLS-1$
+ consumeFormalParameter(true);
+ break;
+
+ case 243 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericTypeDotName..."); } //$NON-NLS-1$
+ consumeFormalParameter(false);
+ break;
+
+ case 244 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt GenericTypeDotName..."); } //$NON-NLS-1$
+ consumeFormalParameter(true);
+ break;
+
+ case 245 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$
consumeCatchFormalParameter();
break;
- case 223 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$
+ case 246 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$
consumeCatchType();
break;
- case 224 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$
+ case 247 : if (DEBUG) { System.out.println("UnionType ::= TypeInternal"); } //$NON-NLS-1$
consumeUnionTypeAsClassType();
break;
- case 225 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$
+ case 248 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$
consumeUnionType();
break;
- case 227 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$
+ case 250 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$
consumeClassTypeList();
break;
- case 228 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$
+ case 251 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$
consumeClassTypeElt();
break;
- case 229 : if (DEBUG) { System.out.println("MethodBody ::= Predicateopt NestedMethod LBRACE..."); } //$NON-NLS-1$
+ case 252 : if (DEBUG) { System.out.println("MethodBody ::= Predicateopt NestedMethod LBRACE..."); } //$NON-NLS-1$
consumeMethodBody();
break;
- case 230 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$
+ case 253 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$
consumeNestedMethod();
break;
- case 234 : if (DEBUG) { System.out.println("CalloutBinding ::= CalloutHeaderLong..."); } //$NON-NLS-1$
+ case 257 : if (DEBUG) { System.out.println("CalloutBinding ::= CalloutHeaderLong..."); } //$NON-NLS-1$
consumeCalloutBindingLong();
break;
- case 235 : if (DEBUG) { System.out.println("CalloutHeaderLong ::= CalloutBindingLeftLong..."); } //$NON-NLS-1$
+ case 258 : if (DEBUG) { System.out.println("CalloutHeaderLong ::= CalloutBindingLeftLong..."); } //$NON-NLS-1$
consumeCalloutHeader();
break;
- case 236 : if (DEBUG) { System.out.println("CalloutHeaderLong ::= CalloutBindingLeftLong..."); } //$NON-NLS-1$
+ case 259 : if (DEBUG) { System.out.println("CalloutHeaderLong ::= CalloutBindingLeftLong..."); } //$NON-NLS-1$
consumeCalloutHeader();
break;
- case 237 : if (DEBUG) { System.out.println("CalloutBindingLeftLong ::= MethodSpecLong CalloutKind"); } //$NON-NLS-1$
+ case 260 : if (DEBUG) { System.out.println("CalloutBindingLeftLong ::= MethodSpecLong CalloutKind"); } //$NON-NLS-1$
consumeCalloutBindingLeft(true);
break;
- case 238 : if (DEBUG) { System.out.println("CalloutBinding ::= Modifiersopt CalloutBindingLeftShort"); } //$NON-NLS-1$
+ case 261 : if (DEBUG) { System.out.println("CalloutBinding ::= Modifiersopt CalloutBindingLeftShort"); } //$NON-NLS-1$
consumeCalloutHeader();
break;
- case 239 : if (DEBUG) { System.out.println("CalloutBindingLeftShort ::= MethodSpecShort CalloutKind"); } //$NON-NLS-1$
+ case 262 : if (DEBUG) { System.out.println("CalloutBindingLeftShort ::= MethodSpecShort CalloutKind"); } //$NON-NLS-1$
consumeCalloutBindingLeft(false);
break;
- case 240 : if (DEBUG) { System.out.println("CalloutBinding ::= Modifiersopt CalloutBindingLeftShort"); } //$NON-NLS-1$
+ case 263 : if (DEBUG) { System.out.println("CalloutBinding ::= Modifiersopt CalloutBindingLeftShort"); } //$NON-NLS-1$
consumeCalloutParameterMappingsInvalid();
break;
- case 245 : if (DEBUG) { System.out.println("CalloutModifier ::= get"); } //$NON-NLS-1$
+ case 268 : if (DEBUG) { System.out.println("CalloutModifier ::= get"); } //$NON-NLS-1$
consumeCalloutModifier(TokenNameget);
break;
- case 246 : if (DEBUG) { System.out.println("CalloutModifier ::= set"); } //$NON-NLS-1$
+ case 269 : if (DEBUG) { System.out.println("CalloutModifier ::= set"); } //$NON-NLS-1$
consumeCalloutModifier(TokenNameset);
break;
- case 248 : if (DEBUG) { System.out.println("CalloutParameterMappingsopt ::= SEMICOLON"); } //$NON-NLS-1$
+ case 271 : if (DEBUG) { System.out.println("CalloutParameterMappingsopt ::= SEMICOLON"); } //$NON-NLS-1$
consumeParameterMappingsEmpty();
break;
- case 252 : if (DEBUG) { System.out.println("CalloutParameterMappingList ::=..."); } //$NON-NLS-1$
+ case 275 : if (DEBUG) { System.out.println("CalloutParameterMappingList ::=..."); } //$NON-NLS-1$
consumeParameterMappingList();
break;
- case 253 : if (DEBUG) { System.out.println("ParameterMapping ::= Expression BINDOUT Identifier"); } //$NON-NLS-1$
+ case 276 : if (DEBUG) { System.out.println("ParameterMapping ::= ExpressionNoLambda ARROW Identifier"); } //$NON-NLS-1$
consumeParameterMappingOut();
break;
- case 254 : if (DEBUG) { System.out.println("ParameterMapping ::= Identifier BINDIN..."); } //$NON-NLS-1$
- consumeParameterMappingIn();
+ case 277 : if (DEBUG) { System.out.println("ParameterMapping ::= Expression CALLOUT_OVERRIDE..."); } //$NON-NLS-1$
+ consumeParameterMappingOut();
break;
- case 255 : if (DEBUG) { System.out.println("NestedParamMappings ::="); } //$NON-NLS-1$
- consumeNestedParamMappings();
- break;
-
- case 256 : if (DEBUG) { System.out.println("CallinBinding ::= CallinHeaderLong..."); } //$NON-NLS-1$
- consumeCallinBindingLong();
- break;
-
- case 257 : if (DEBUG) { System.out.println("CallinHeaderLong ::= CallinBindingLeftLong..."); } //$NON-NLS-1$
- consumeCallinHeader();
- break;
-
- case 258 : if (DEBUG) { System.out.println("CallinHeaderLong ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinHeader();
- break;
-
- case 259 : if (DEBUG) { System.out.println("CallinBindingLeftLong ::= MethodSpecLong BINDIN"); } //$NON-NLS-1$
- consumeCallinBindingLeft(true);
- break;
-
- case 260 : if (DEBUG) { System.out.println("CallinBinding ::= Modifiersopt CallinBindingLeftShort..."); } //$NON-NLS-1$
- consumeCallinHeader();
- break;
-
- case 261 : if (DEBUG) { System.out.println("CallinBinding ::= Modifiersopt CallinLabel Modifiersopt"); } //$NON-NLS-1$
- consumeCallinHeader();
- break;
-
- case 262 : if (DEBUG) { System.out.println("CallinBindingLeftShort ::= MethodSpecShort BINDIN"); } //$NON-NLS-1$
- consumeCallinBindingLeft(false);
- break;
-
- case 263 : if (DEBUG) { System.out.println("CallinLabel ::= SimpleName COLON"); } //$NON-NLS-1$
- consumeCallinLabel();
- break;
-
- case 264 : if (DEBUG) { System.out.println("CallinModifier ::= replace"); } //$NON-NLS-1$
- consumeCallinModifier(TokenNamereplace);
- break;
-
- case 265 : if (DEBUG) { System.out.println("CallinModifier ::= before"); } //$NON-NLS-1$
- consumeCallinModifier(TokenNamebefore);
- break;
-
- case 266 : if (DEBUG) { System.out.println("CallinModifier ::= after"); } //$NON-NLS-1$
- consumeCallinModifier(TokenNameafter);
- break;
-
- case 267 : if (DEBUG) { System.out.println("InvalidCallinModifier ::="); } //$NON-NLS-1$
- consumeCallinModifierMissing();
- break;
-
- case 268 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,false);
- break;
-
- case 269 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,false);
- break;
-
- case 270 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,true);
- break;
-
- case 271 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(false,true);
- break;
-
- case 272 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= CallinBindingLeftLong..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(true,false);
- break;
-
- case 273 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
- consumeCallinBindingInvalid(true,false);
- break;
-
- case 275 : if (DEBUG) { System.out.println("CallinParameterMappingsopt ::= SEMICOLON"); } //$NON-NLS-1$
- consumeParameterMappingsEmpty();
- break;
-
- case 279 : if (DEBUG) { System.out.println("CallinParameterMappingList ::=..."); } //$NON-NLS-1$
- consumeParameterMappingList();
- break;
-
- case 280 : if (DEBUG) { System.out.println("MethodSpecShort ::= SimpleName"); } //$NON-NLS-1$
- consumeMethodSpecShort();
- break;
-
- case 281 : if (DEBUG) { System.out.println("MethodSpecLong ::= MethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLong(false);
- break;
-
- case 282 : if (DEBUG) { System.out.println("MethodSpecLong ::= ConstructorHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLongCtor();
- break;
-
- case 283 : if (DEBUG) { System.out.println("BaseMethodSpecLong ::= MethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodSpecLong(false);
- break;
-
- case 284 : if (DEBUG) { System.out.println("BaseMethodSpecLong ::= MethodSpecNamePlus..."); } //$NON-NLS-1$
- consumeMethodSpecLong(true);
- break;
-
- case 285 : if (DEBUG) { System.out.println("MethodSpecNamePlus ::= Modifiersopt Type PLUS Identifier"); } //$NON-NLS-1$
- consumeMethodHeaderName(false);
- break;
-
- case 286 : if (DEBUG) { System.out.println("CalloutFieldSpecLong ::= CalloutModifier Type Identifier"); } //$NON-NLS-1$
- consumeFieldSpecLong();
- break;
-
- case 289 : if (DEBUG) { System.out.println("BaseMethodSpecListShort ::= BaseMethodSpecListShort..."); } //$NON-NLS-1$
- consumeMethodSpecList();
- break;
-
- case 293 : if (DEBUG) { System.out.println("MethodSpecListLong ::= MethodSpecListLong COMMA..."); } //$NON-NLS-1$
- consumeMethodSpecList();
- break;
-
- case 294 : if (DEBUG) { System.out.println("PrecedenceDeclaration ::= precedence BindingNames..."); } //$NON-NLS-1$
- consumePrecedenceDeclaration(false);
- break;
-
- case 295 : if (DEBUG) { System.out.println("PrecedenceDeclaration ::= precedence after BindingNames"); } //$NON-NLS-1$
- consumePrecedenceDeclaration(true);
- break;
-
- case 297 : if (DEBUG) { System.out.println("BindingNames ::= BindingNames COMMA BindingName"); } //$NON-NLS-1$
- consumeBindingNames();
- break;
-
- case 298 : if (DEBUG) { System.out.println("BindingName ::= Name"); } //$NON-NLS-1$
- consumeBindingName();
- break;
-
- case 299 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$
- consumeStaticInitializer();
- break;
-
- case 300 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$
- consumeStaticOnly();
- break;
-
- case 301 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$
- consumeConstructorDeclaration() ;
- break;
-
- case 302 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration() ;
- break;
-
- case 303 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0, THIS_CALL);
- break;
-
- case 304 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);
- break;
-
- case 305 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0,SUPER_CALL);
- break;
-
- case 306 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);
- break;
-
- case 307 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= tsuper LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(0,TSUPER_CALL);
- break;
-
- case 308 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT tsuper LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2,TSUPER_CALL);
- break;
-
- case 309 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(1, SUPER_CALL);
- break;
-
- case 310 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);
- break;
-
- case 311 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2, SUPER_CALL);
- break;
-
- case 312 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);
- break;
-
- case 313 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(1, THIS_CALL);
- break;
-
- case 314 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);
- break;
-
- case 315 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$
- consumeExplicitConstructorInvocation(2, THIS_CALL);
- break;
-
- case 316 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);
- break;
-
- case 317 : if (DEBUG) { System.out.println("BaseConstructorExpression ::= base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(0);
- break;
-
- case 318 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(1);
- break;
-
- case 319 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= Primary DOT base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(2);
- break;
-
- case 320 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= Name DOT base LPAREN..."); } //$NON-NLS-1$
- consumeExplicitConstructorInvocationBase(3);
- break;
-
- case 321 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$
- consumeInterfaceDeclaration();
- break;
-
- case 322 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$
- consumeInterfaceHeader();
- break;
-
- case 323 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$
- consumeTypeHeaderNameWithTypeParameters();
- break;
-
- case 325 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$
- consumeInterfaceHeaderName1();
- break;
-
- case 326 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$
- consumeInterfaceHeaderExtends();
- break;
-
- case 329 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$
- consumeInterfaceMemberDeclarations();
- break;
-
- case 330 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyTypeDeclaration();
- break;
-
- case 332 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
- consumeInvalidMethodDeclaration();
- break;
-
- case 333 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration(true);
- break;
-
- case 334 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
- consumeInvalidConstructorDeclaration(false);
- break;
-
- case 346 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$
- consumePushLeftBrace();
- break;
-
- case 347 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$
- consumeEmptyArrayInitializer();
- break;
-
- case 348 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
- consumeArrayInitializer();
- break;
-
- case 349 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
- consumeArrayInitializer();
- break;
-
- case 351 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$
- consumeVariableInitializers();
- break;
-
- case 352 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$
- consumeBlock();
- break;
-
- case 353 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$
- consumeOpenBlock() ;
- break;
-
- case 355 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$
- consumeBlockStatements() ;
- break;
-
- case 359 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$
- consumeInvalidInterfaceDeclaration();
- break;
-
- case 360 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$
- consumeInvalidAnnotationTypeDeclaration();
- break;
-
- case 361 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$
- consumeInvalidEnumDeclaration();
- break;
-
- case 362 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$
- consumeLocalVariableDeclarationStatement();
- break;
-
- case 363 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$
- consumeLocalVariableDeclaration();
- break;
-
- case 364 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$
- consumeLocalVariableDeclaration();
- break;
-
- case 365 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$
- consumePushModifiers();
- break;
-
- case 366 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$
- consumePushModifiersForHeader();
- break;
-
- case 367 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$
- consumePushRealModifiers();
- break;
-
- case 395 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$
- consumeEmptyStatement();
- break;
-
- case 396 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$
- consumeStatementLabel() ;
- break;
-
- case 397 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$
- consumeStatementLabel() ;
- break;
-
- case 398 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$
- consumeLabel() ;
- break;
-
- case 399 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$
- consumeExpressionStatement();
- break;
-
- case 409 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementIfNoElse();
- break;
-
- case 410 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementIfWithElse();
- break;
-
- case 411 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementIfWithElse();
- break;
-
- case 412 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementSwitch() ;
- break;
-
- case 413 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$
- consumeEmptySwitchBlock() ;
- break;
-
- case 416 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$
- consumeSwitchBlock() ;
- break;
-
- case 418 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$
- consumeSwitchBlockStatements() ;
- break;
-
- case 419 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$
- consumeSwitchBlockStatement() ;
- break;
-
- case 421 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$
- consumeSwitchLabels() ;
- break;
-
- case 422 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); } //$NON-NLS-1$
- consumeCaseLabel();
- break;
-
- case 423 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$
- consumeDefaultLabel();
- break;
-
- case 424 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeStatementWhile() ;
- break;
-
- case 425 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementWhile() ;
- break;
-
- case 426 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$
- consumeStatementDo() ;
- break;
-
- case 427 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$
- consumeStatementFor() ;
- break;
-
- case 428 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$
- consumeStatementFor() ;
- break;
-
- case 429 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$
- consumeForInit() ;
- break;
-
- case 433 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$
- consumeStatementExpressionList() ;
- break;
-
- case 434 : if (DEBUG) { System.out.println("WithinStatement ::= within LPAREN Expression RPAREN..."); } //$NON-NLS-1$
- consumeWithinStatement();
- break;
-
- case 435 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$
- consumeSimpleAssertStatement() ;
- break;
-
- case 436 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$
- consumeAssertStatement() ;
- break;
-
- case 437 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$
- consumeStatementBreak() ;
- break;
-
- case 438 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
- consumeStatementBreakWithLabel() ;
- break;
-
- case 439 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$
- consumeStatementContinue() ;
- break;
-
- case 440 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$
- consumeStatementContinueWithLabel() ;
- break;
-
- case 441 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$
- consumeStatementReturn() ;
- break;
-
- case 442 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$
- consumeStatementThrow();
- break;
-
- case 443 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$
- consumeStatementSynchronized();
- break;
-
- case 444 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$
- consumeOnlySynchronized();
- break;
-
- case 445 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$
- consumeStatementTry(false, false);
- break;
-
- case 446 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$
- consumeStatementTry(true, false);
- break;
-
- case 447 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
- consumeStatementTry(false, true);
- break;
-
- case 448 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
- consumeStatementTry(true, true);
- break;
-
- case 449 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$
- consumeResourceSpecification();
- break;
-
- case 450 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(false);
- break;
-
- case 451 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(true);
- break;
-
- case 452 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$
- consumeSingleResource();
- break;
-
- case 453 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$
- consumeMultipleResources();
- break;
-
- case 454 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$
- consumeResourceOptionalTrailingSemiColon(true);
- break;
-
- case 455 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$
- consumeResourceAsLocalVariableDeclaration();
- break;
-
- case 456 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$
- consumeResourceAsLocalVariableDeclaration();
- break;
-
- case 458 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$
- consumeExitTryBlock();
- break;
-
- case 460 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$
- consumeCatches();
- break;
-
- case 461 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
- consumeStatementCatch() ;
- break;
-
- case 463 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$
- consumeLeftParen();
- break;
-
- case 464 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$
- consumeRightParen();
- break;
-
- case 469 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$
+ case 282 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= this"); } //$NON-NLS-1$
consumePrimaryNoNewArrayThis();
break;
- case 470 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
+ case 283 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
consumePrimaryNoNewArray();
break;
- case 471 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
+ case 284 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
consumePrimaryNoNewArrayWithName();
break;
- case 475 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$
+ case 288 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= Name DOT this"); } //$NON-NLS-1$
consumePrimaryNoNewArrayNameThis();
break;
- case 476 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); } //$NON-NLS-1$
+ case 289 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= Name DOT super"); } //$NON-NLS-1$
consumePrimaryNoNewArrayNameSuper();
break;
- case 477 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$
+ case 290 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= Name DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayName();
break;
- case 478 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$
+ case 291 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= Name Dims DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayArrayType();
break;
- case 479 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
+ case 292 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayPrimitiveArrayType();
break;
- case 480 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$
+ case 293 : if (DEBUG) { System.out.println("ExpressionNoLambda ::= PrimitiveType DOT class"); } //$NON-NLS-1$
consumePrimaryNoNewArrayPrimitiveType();
break;
- case 481 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
- consumeRoleClassLiteral();
+ case 296 : if (DEBUG) { System.out.println("ParameterMapping ::= Identifier BINDIN..."); } //$NON-NLS-1$
+ consumeParameterMappingIn();
break;
- case 484 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$
- consumeAllocationHeader();
+ case 297 : if (DEBUG) { System.out.println("NestedParamMappings ::="); } //$NON-NLS-1$
+ consumeNestedParamMappings();
break;
- case 485 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionWithTypeArguments();
+ case 298 : if (DEBUG) { System.out.println("CallinBinding ::= CallinHeaderLong..."); } //$NON-NLS-1$
+ consumeCallinBindingLong();
break;
- case 486 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpression();
- break;
-
- case 487 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
- break;
-
- case 488 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualified() ;
- break;
-
- case 489 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualified() ;
- break;
-
- case 490 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
- break;
-
- case 491 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$
- consumeEnterInstanceCreationArgumentList();
- break;
-
- case 492 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); } //$NON-NLS-1$
- consumeClassInstanceCreationExpressionName() ;
- break;
-
- case 493 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$
- consumeClassBodyopt();
- break;
-
- case 495 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
- consumeEnterAnonymousClassBody(false);
- break;
-
- case 496 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$
- consumeClassBodyopt();
- break;
-
- case 498 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
- consumeEnterAnonymousClassBody(true);
- break;
-
- case 500 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$
- consumeArgumentList();
- break;
-
- case 501 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$
- consumeArrayCreationHeader();
- break;
-
- case 502 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$
- consumeArrayCreationHeader();
- break;
-
- case 503 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithoutInitializer();
- break;
-
- case 504 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithInitializer();
- break;
-
- case 505 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithoutInitializer();
- break;
-
- case 506 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$
- consumeArrayCreationExpressionWithInitializer();
- break;
-
- case 508 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$
- consumeDimWithOrWithOutExprs();
- break;
-
- case 510 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
- consumeDimWithOrWithOutExpr();
- break;
-
- case 511 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$
- consumeDims();
- break;
-
- case 514 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
- consumeOneDimLoop();
- break;
-
- case 515 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$
- consumeFieldAccess(false);
- break;
-
- case 516 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$
- consumeFieldAccess(true);
- break;
-
- case 517 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
- consumeMethodInvocationName();
- break;
-
- case 518 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationNameWithTypeArguments();
- break;
-
- case 519 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationPrimaryWithTypeArguments();
- break;
-
- case 520 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationPrimary();
- break;
-
- case 521 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationSuperWithTypeArguments();
- break;
-
- case 522 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationSuper();
- break;
-
- case 523 : if (DEBUG) { System.out.println("MethodInvocation ::= tsuper DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuper(UNQUALIFIED);
- break;
-
- case 524 : if (DEBUG) { System.out.println("MethodInvocation ::= tsuper DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuperWithTypeArguments(0);
- break;
-
- case 525 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT tsuper DOT Identifier..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuper(QUALIFIED);
- break;
-
- case 526 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT tsuper DOT..."); } //$NON-NLS-1$
- consumeMethodInvocationTSuperWithTypeArguments(2);
- break;
-
- case 527 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT Identifier LPAREN..."); } //$NON-NLS-1$
- consumeMethodInvocationBase(false);
- break;
-
- case 528 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT OnlyTypeArguments..."); } //$NON-NLS-1$
- consumeMethodInvocationBaseWithTypeArguments(false);
- break;
-
- case 529 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT super DOT Identifier..."); } //$NON-NLS-1$
- consumeMethodInvocationBase(true);
- break;
-
- case 530 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT super DOT..."); } //$NON-NLS-1$
- consumeMethodInvocationBaseWithTypeArguments(true);
- break;
-
- case 531 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
- consumeArrayAccess(true);
- break;
-
- case 532 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$
- consumeArrayAccess(false);
- break;
-
- case 533 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$
- consumeArrayAccess(false);
- break;
-
- case 535 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$
- consumePostfixExpression();
- break;
-
- case 538 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS,true);
- break;
-
- case 539 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS,true);
- break;
-
- case 540 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$
- consumePushPosition();
- break;
-
- case 543 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS);
- break;
-
- case 544 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS);
- break;
-
- case 546 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS,false);
- break;
-
- case 547 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS,false);
- break;
-
- case 549 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.TWIDDLE);
- break;
-
- case 550 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.NOT);
- break;
-
- case 552 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$
- consumeCastExpressionWithPrimitiveType();
- break;
-
- case 553 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
- consumeCastExpressionWithGenericsArray();
- break;
-
- case 554 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
- consumeCastExpressionWithQualifiedGenericsArray();
- break;
-
- case 555 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$
- consumeCastExpressionLL1();
- break;
-
- case 556 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims PushRPAREN..."); } //$NON-NLS-1$
- consumeCastExpressionWithNameArray();
- break;
-
- case 557 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$
- consumeOnlyTypeArgumentsForCastExpression();
- break;
-
- case 558 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$
- consumeInsideCastExpression();
- break;
-
- case 559 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionLL1();
- break;
-
- case 560 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$
- consumeInsideCastExpressionWithQualifiedGenerics();
- break;
-
- case 562 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MULTIPLY);
- break;
-
- case 563 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.DIVIDE);
- break;
-
- case 564 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.REMAINDER);
- break;
-
- case 566 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.PLUS);
- break;
-
- case 567 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MINUS);
- break;
-
- case 569 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
- break;
-
- case 570 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
- break;
-
- case 571 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 573 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS);
- break;
-
- case 574 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER);
- break;
-
- case 575 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS_EQUAL);
- break;
-
- case 576 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
- break;
-
- case 578 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$
- consumeInstanceOfExpression();
- break;
-
- case 580 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
- break;
-
- case 581 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.NOT_EQUAL);
- break;
-
- case 583 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND);
- break;
-
- case 585 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.XOR);
- break;
-
- case 587 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR);
- break;
-
- case 589 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND_AND);
- break;
-
- case 591 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR_OR);
- break;
-
- case 593 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
- consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
- break;
-
- case 596 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$
- consumeAssignment();
- break;
-
- case 598 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$
- ignoreExpressionAssignment();
- break;
-
- case 599 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(EQUAL);
- break;
-
- case 600 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(MULTIPLY);
- break;
-
- case 601 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(DIVIDE);
- break;
-
- case 602 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(REMAINDER);
- break;
-
- case 603 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(PLUS);
- break;
-
- case 604 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(MINUS);
- break;
-
- case 605 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(LEFT_SHIFT);
- break;
-
- case 606 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(RIGHT_SHIFT);
- break;
-
- case 607 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 608 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(AND);
- break;
-
- case 609 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(XOR);
- break;
-
- case 610 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$
- consumeAssignmentOperator(OR);
- break;
-
- case 614 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$
- consumeEmptyExpression();
- break;
-
- case 619 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyClassBodyDeclarationsopt();
- break;
-
- case 620 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeClassBodyDeclarationsopt();
- break;
-
- case 621 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$
- consumeDefaultModifiers();
- break;
-
- case 622 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$
- consumeModifiers();
- break;
-
- case 623 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$
- consumeEmptyBlockStatementsopt();
- break;
-
- case 625 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$
- consumeEmptyDimsopt();
- break;
-
- case 627 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$
- consumeEmptyArgumentListopt();
- break;
-
- case 631 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$
- consumeFormalParameterListopt();
- break;
-
- case 635 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyInterfaceMemberDeclarationsopt();
- break;
-
- case 636 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeInterfaceMemberDeclarationsopt();
- break;
-
- case 637 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$
- consumeNestedType();
- break;
-
- case 638 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$
- consumeEmptyForInitopt();
- break;
-
- case 640 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$
- consumeEmptyForUpdateopt();
- break;
-
- case 644 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$
- consumeEmptyCatchesopt();
- break;
-
- case 646 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$
- consumeEnumDeclaration();
- break;
-
- case 647 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$
- consumeEnumHeader();
- break;
-
- case 648 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$
- consumeEnumHeaderName();
- break;
-
- case 649 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$
- consumeEnumHeaderNameWithTypeParameters();
- break;
-
- case 650 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$
- consumeEnumBodyNoConstants();
- break;
-
- case 651 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$
- consumeEnumBodyNoConstants();
- break;
-
- case 652 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$
- consumeEnumBodyWithConstants();
- break;
-
- case 653 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$
- consumeEnumBodyWithConstants();
- break;
-
- case 655 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$
- consumeEnumConstants();
- break;
-
- case 656 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
- consumeEnumConstantHeaderName();
- break;
-
- case 657 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$
- consumeEnumConstantHeader();
- break;
-
- case 658 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$
- consumeEnumConstantWithClassBody();
- break;
-
- case 659 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$
- consumeEnumConstantNoClassBody();
- break;
-
- case 660 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
- consumeArguments();
- break;
-
- case 661 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$
- consumeEmptyArguments();
- break;
-
- case 663 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$
- consumeEnumDeclarations();
- break;
-
- case 664 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyEnumDeclarations();
- break;
-
- case 666 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$
- consumeEnhancedForStatement();
- break;
-
- case 667 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$
- consumeEnhancedForStatement();
- break;
-
- case 668 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$
- consumeEnhancedForStatementHeaderInit(false);
- break;
-
- case 669 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$
- consumeEnhancedForStatementHeaderInit(true);
- break;
-
- case 670 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$
- consumeEnhancedForStatementHeader();
- break;
-
- case 671 : if (DEBUG) { System.out.println("SingleBaseImportDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
- break;
-
- case 672 : if (DEBUG) { System.out.println("SingleBaseImportDeclarationName ::= import base Name"); } //$NON-NLS-1$
- consumeSingleBaseImportDeclarationName();
- break;
-
- case 673 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
- break;
-
- case 674 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$
- consumeSingleStaticImportDeclarationName();
- break;
-
- case 675 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
- consumeImportDeclaration();
- break;
-
- case 676 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$
- consumeStaticImportOnDemandDeclarationName();
- break;
-
- case 677 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
- consumeTypeArguments();
- break;
-
- case 678 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
- consumeOnlyTypeArguments();
- break;
-
- case 680 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList1();
- break;
-
- case 682 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$
- consumeTypeArgumentList();
- break;
-
- case 683 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$
- consumeTypeArgument();
- break;
-
- case 688 : if (DEBUG) { System.out.println("TypeAnchor ::= AT Name"); } //$NON-NLS-1$
- consumeTypeAnchor(false);
- break;
-
- case 689 : if (DEBUG) { System.out.println("TypeAnchor ::= AT base"); } //$NON-NLS-1$
- consumeTypeAnchor(true);
- break;
-
- case 690 : if (DEBUG) { System.out.println("TypeAnchor ::= AT this"); } //$NON-NLS-1$
- skipThisAnchor();
- break;
-
- case 691 : if (DEBUG) { System.out.println("TypeAnchor ::= AT Name DOT base"); } //$NON-NLS-1$
- consumeQualifiedBaseTypeAnchor();
- break;
-
- case 694 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$
- consumeReferenceType1();
- break;
-
- case 695 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
- consumeTypeArgumentReferenceType1();
- break;
-
- case 697 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList2();
- break;
-
- case 700 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeReferenceType2();
- break;
-
- case 701 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
- consumeTypeArgumentReferenceType2();
- break;
-
- case 703 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
- consumeTypeArgumentList3();
- break;
-
- case 706 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeReferenceType3();
- break;
-
- case 707 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION"); } //$NON-NLS-1$
- consumeWildcard();
- break;
-
- case 708 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION WildcardBounds"); } //$NON-NLS-1$
- consumeWildcardWithBounds();
- break;
-
- case 709 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$
- consumeWildcardBoundsExtends();
- break;
-
- case 710 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$
- consumeWildcardBoundsSuper();
- break;
-
- case 711 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION GREATER"); } //$NON-NLS-1$
- consumeWildcard1();
- break;
-
- case 712 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION WildcardBounds1"); } //$NON-NLS-1$
- consumeWildcard1WithBounds();
- break;
-
- case 713 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$
- consumeWildcardBounds1Extends();
- break;
-
- case 714 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$
- consumeWildcardBounds1Super();
- break;
-
- case 715 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeWildcard2();
- break;
-
- case 716 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION WildcardBounds2"); } //$NON-NLS-1$
- consumeWildcard2WithBounds();
- break;
-
- case 717 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$
- consumeWildcardBounds2Extends();
- break;
-
- case 718 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$
- consumeWildcardBounds2Super();
- break;
-
- case 719 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
- consumeWildcard3();
- break;
-
- case 720 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION WildcardBounds3"); } //$NON-NLS-1$
- consumeWildcard3WithBounds();
- break;
-
- case 721 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$
- consumeWildcardBounds3Extends();
- break;
-
- case 722 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$
- consumeWildcardBounds3Super();
- break;
-
- case 723 : if (DEBUG) { System.out.println("TypeParameterHeader ::= Identifier"); } //$NON-NLS-1$
- consumeTypeParameterHeader();
- break;
-
- case 724 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$
- consumeTypeParameters();
- break;
-
- case 726 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
- consumeTypeParameterList();
- break;
-
- case 728 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameterWithExtends();
- break;
-
- case 729 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameterWithExtendsAndBounds();
- break;
-
- case 730 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader base ReferenceType"); } //$NON-NLS-1$
- consumeTypeParameterWithBase();
- break;
-
- case 734 : if (DEBUG) { System.out.println("TypeValueParameter ::= TypeParameterHeader Identifier"); } //$NON-NLS-1$
- consumeTypeValueParameter();
- break;
-
- case 739 : if (DEBUG) { System.out.println("TypeBoundOpt ::= extends ReferenceType"); } //$NON-NLS-1$
- consumeBoundsOfAnchoredTypeParameter();
- break;
-
- case 741 : if (DEBUG) { System.out.println("TypeBoundOpt1 ::= extends ReferenceType1"); } //$NON-NLS-1$
- consumeBoundsOfAnchoredTypeParameter();
- break;
-
- case 742 : if (DEBUG) { System.out.println("AnchoredTypeParameterHeader0 ::= TypeParameterHeader..."); } //$NON-NLS-1$
- consumeAnchoredTypeParameter();
- break;
-
- case 744 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$
- consumeAdditionalBoundList();
- break;
-
- case 745 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$
- consumeAdditionalBound();
- break;
-
- case 747 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
- consumeTypeParameterList1();
- break;
-
- case 748 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$
- consumeTypeParameter1();
- break;
-
- case 749 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameter1WithExtends();
- break;
-
- case 750 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader base..."); } //$NON-NLS-1$
- consumeTypeParameter1WithBase();
- break;
-
- case 751 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
- consumeTypeParameter1WithExtendsAndBounds();
- break;
-
- case 753 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$
- consumeAdditionalBoundList1();
- break;
-
- case 754 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$
- consumeAdditionalBound1();
- break;
-
- case 760 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.PLUS);
- break;
-
- case 761 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.MINUS);
- break;
-
- case 764 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.TWIDDLE);
- break;
-
- case 765 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$
- consumeUnaryExpression(OperatorIds.NOT);
- break;
-
- case 768 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MULTIPLY);
- break;
-
- case 769 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);
- break;
-
- case 770 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.DIVIDE);
- break;
-
- case 771 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.DIVIDE);
- break;
-
- case 772 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.REMAINDER);
- break;
-
- case 773 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.REMAINDER);
- break;
-
- case 775 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.PLUS);
- break;
-
- case 776 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.PLUS);
- break;
-
- case 777 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.MINUS);
- break;
-
- case 778 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.MINUS);
- break;
-
- case 780 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
- break;
-
- case 781 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);
- break;
-
- case 782 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
- break;
-
- case 783 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);
- break;
-
- case 784 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 785 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);
- break;
-
- case 787 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS);
- break;
-
- case 788 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LESS);
- break;
-
- case 789 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER);
- break;
-
- case 790 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.GREATER);
- break;
-
- case 791 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.LESS_EQUAL);
- break;
-
- case 792 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);
- break;
-
- case 793 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
- break;
-
- case 794 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);
- break;
-
- case 796 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$
- consumeInstanceOfExpressionWithName();
- break;
-
- case 797 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeInstanceOfExpression();
- break;
-
- case 799 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
- break;
-
- case 800 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);
- break;
-
- case 801 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeEqualityExpression(OperatorIds.NOT_EQUAL);
- break;
-
- case 802 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$
- consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);
- break;
-
- case 804 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND);
- break;
-
- case 805 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.AND);
- break;
-
- case 807 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.XOR);
- break;
-
- case 808 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.XOR);
- break;
-
- case 810 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR);
- break;
-
- case 811 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.OR);
- break;
-
- case 813 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.AND_AND);
- break;
-
- case 814 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.AND_AND);
- break;
-
- case 816 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeBinaryExpression(OperatorIds.OR_OR);
- break;
-
- case 817 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$
- consumeBinaryExpressionWithName(OperatorIds.OR_OR);
- break;
-
- case 819 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$
- consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
- break;
-
- case 820 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$
- consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;
- break;
-
- case 824 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderName() ;
- break;
-
- case 825 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
- break;
-
- case 826 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
- break;
-
- case 827 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeaderName() ;
- break;
-
- case 828 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclarationHeader() ;
- break;
-
- case 829 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeDeclaration() ;
- break;
-
- case 831 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$
- consumeEmptyAnnotationTypeMemberDeclarationsopt() ;
- break;
-
- case 832 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclarationsopt() ;
- break;
-
- case 834 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclarations() ;
- break;
-
- case 835 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
- consumeMethodHeaderNameWithTypeParameters(true);
- break;
-
- case 836 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeMethodHeaderName(true);
- break;
-
- case 837 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$
- consumeEmptyMethodHeaderDefaultValue() ;
- break;
-
- case 838 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$
- consumeMethodHeaderDefaultValue();
- break;
-
- case 839 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 840 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$
- consumeAnnotationTypeMemberDeclaration() ;
- break;
-
- case 848 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); } //$NON-NLS-1$
- consumeAnnotationName() ;
- break;
-
- case 849 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeNormalAnnotation() ;
- break;
-
- case 850 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$
- consumeEmptyMemberValuePairsopt() ;
- break;
-
- case 853 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$
- consumeMemberValuePairs() ;
- break;
-
- case 854 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$
- consumeMemberValuePair() ;
- break;
-
- case 855 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$
- consumeEnterMemberValue() ;
- break;
-
- case 856 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$
- consumeExitMemberValue() ;
- break;
-
- case 858 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$
- consumeMemberValueAsName() ;
- break;
-
- case 861 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeMemberValueArrayInitializer() ;
- break;
-
- case 862 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeMemberValueArrayInitializer() ;
- break;
-
- case 863 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeEmptyMemberValueArrayInitializer() ;
- break;
-
- case 864 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
- consumeEmptyMemberValueArrayInitializer() ;
- break;
-
- case 865 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$
- consumeEnterMemberValueArrayInitializer() ;
- break;
-
- case 867 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$
- consumeMemberValues() ;
- break;
-
- case 868 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$
- consumeMarkerAnnotation() ;
- break;
-
- case 869 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$
- consumeSingleMemberAnnotationMemberValue() ;
- break;
-
- case 870 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
- consumeSingleMemberAnnotation() ;
- break;
-
- case 871 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderNameWithTypeParameters();
- break;
-
- case 872 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$
- consumeRecoveryMethodHeaderName();
- break;
-
- case 873 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 874 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
- consumeMethodHeader();
- break;
-
- case 877 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= RecoveryCallinBindingLeftLong"); } //$NON-NLS-1$
+ case 299 : if (DEBUG) { System.out.println("CallinHeaderLong ::= CallinBindingLeftLong..."); } //$NON-NLS-1$
consumeCallinHeader();
break;
- case 878 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
+ case 300 : if (DEBUG) { System.out.println("CallinHeaderLong ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
consumeCallinHeader();
break;
- case 879 : if (DEBUG) { System.out.println("RecoveryCallinBindingLeftLong ::= RecoveryMethodSpecLong"); } //$NON-NLS-1$
+ case 301 : if (DEBUG) { System.out.println("CallinBindingLeftLong ::= MethodSpecLong BINDIN"); } //$NON-NLS-1$
consumeCallinBindingLeft(true);
break;
- case 880 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt..."); } //$NON-NLS-1$
+ case 302 : if (DEBUG) { System.out.println("CallinBinding ::= Modifiersopt CallinBindingLeftShort..."); } //$NON-NLS-1$
consumeCallinHeader();
break;
- case 881 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
+ case 303 : if (DEBUG) { System.out.println("CallinBinding ::= Modifiersopt CallinLabel Modifiersopt"); } //$NON-NLS-1$
consumeCallinHeader();
break;
- case 882 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::= RecoveryCalloutBindingLeftLong"); } //$NON-NLS-1$
+ case 304 : if (DEBUG) { System.out.println("CallinBindingLeftShort ::= MethodSpecShort BINDIN"); } //$NON-NLS-1$
+ consumeCallinBindingLeft(false);
+ break;
+
+ case 305 : if (DEBUG) { System.out.println("CallinLabel ::= SimpleName COLON"); } //$NON-NLS-1$
+ consumeCallinLabel();
+ break;
+
+ case 306 : if (DEBUG) { System.out.println("CallinModifier ::= replace"); } //$NON-NLS-1$
+ consumeCallinModifier(TokenNamereplace);
+ break;
+
+ case 307 : if (DEBUG) { System.out.println("CallinModifier ::= before"); } //$NON-NLS-1$
+ consumeCallinModifier(TokenNamebefore);
+ break;
+
+ case 308 : if (DEBUG) { System.out.println("CallinModifier ::= after"); } //$NON-NLS-1$
+ consumeCallinModifier(TokenNameafter);
+ break;
+
+ case 309 : if (DEBUG) { System.out.println("InvalidCallinModifier ::="); } //$NON-NLS-1$
+ consumeCallinModifierMissing();
+ break;
+
+ case 310 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeCallinBindingInvalid(false,false);
+ break;
+
+ case 311 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
+ consumeCallinBindingInvalid(false,false);
+ break;
+
+ case 312 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeCallinBindingInvalid(false,true);
+ break;
+
+ case 313 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
+ consumeCallinBindingInvalid(false,true);
+ break;
+
+ case 314 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= CallinBindingLeftLong..."); } //$NON-NLS-1$
+ consumeCallinBindingInvalid(true,false);
+ break;
+
+ case 315 : if (DEBUG) { System.out.println("InvalidCallinBinding ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
+ consumeCallinBindingInvalid(true,false);
+ break;
+
+ case 317 : if (DEBUG) { System.out.println("CallinParameterMappingsopt ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeParameterMappingsEmpty();
+ break;
+
+ case 321 : if (DEBUG) { System.out.println("CallinParameterMappingList ::=..."); } //$NON-NLS-1$
+ consumeParameterMappingList();
+ break;
+
+ case 322 : if (DEBUG) { System.out.println("MethodSpecShort ::= SimpleName"); } //$NON-NLS-1$
+ consumeMethodSpecShort();
+ break;
+
+ case 323 : if (DEBUG) { System.out.println("MethodSpecLong ::= MethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodSpecLong(false);
+ break;
+
+ case 324 : if (DEBUG) { System.out.println("MethodSpecLong ::= ConstructorHeaderName..."); } //$NON-NLS-1$
+ consumeMethodSpecLongCtor();
+ break;
+
+ case 325 : if (DEBUG) { System.out.println("BaseMethodSpecLong ::= MethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodSpecLong(false);
+ break;
+
+ case 326 : if (DEBUG) { System.out.println("BaseMethodSpecLong ::= MethodSpecNamePlus..."); } //$NON-NLS-1$
+ consumeMethodSpecLong(true);
+ break;
+
+ case 327 : if (DEBUG) { System.out.println("MethodSpecNamePlus ::= Modifiersopt Type0 PLUS..."); } //$NON-NLS-1$
+ consumeMethodHeaderName(false);
+ break;
+
+ case 328 : if (DEBUG) { System.out.println("CalloutFieldSpecLong ::= CalloutModifier Type Identifier"); } //$NON-NLS-1$
+ consumeFieldSpecLong();
+ break;
+
+ case 331 : if (DEBUG) { System.out.println("BaseMethodSpecListShort ::= BaseMethodSpecListShort..."); } //$NON-NLS-1$
+ consumeMethodSpecList();
+ break;
+
+ case 335 : if (DEBUG) { System.out.println("MethodSpecListLong ::= MethodSpecListLong COMMA..."); } //$NON-NLS-1$
+ consumeMethodSpecList();
+ break;
+
+ case 336 : if (DEBUG) { System.out.println("PrecedenceDeclaration ::= precedence BindingNames..."); } //$NON-NLS-1$
+ consumePrecedenceDeclaration(false);
+ break;
+
+ case 337 : if (DEBUG) { System.out.println("PrecedenceDeclaration ::= precedence after BindingNames"); } //$NON-NLS-1$
+ consumePrecedenceDeclaration(true);
+ break;
+
+ case 339 : if (DEBUG) { System.out.println("BindingNames ::= BindingNames COMMA BindingName"); } //$NON-NLS-1$
+ consumeBindingNames();
+ break;
+
+ case 340 : if (DEBUG) { System.out.println("BindingName ::= Name"); } //$NON-NLS-1$
+ consumeBindingName();
+ break;
+
+ case 341 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$
+ consumeStaticInitializer();
+ break;
+
+ case 342 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$
+ consumeStaticOnly();
+ break;
+
+ case 343 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$
+ consumeConstructorDeclaration() ;
+ break;
+
+ case 344 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$
+ consumeInvalidConstructorDeclaration() ;
+ break;
+
+ case 345 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(0, THIS_CALL);
+ break;
+
+ case 346 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL);
+ break;
+
+ case 347 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(0,SUPER_CALL);
+ break;
+
+ case 348 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL);
+ break;
+
+ case 349 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= tsuper LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(0,TSUPER_CALL);
+ break;
+
+ case 350 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT tsuper LPAREN"); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(2,TSUPER_CALL);
+ break;
+
+ case 351 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(1, SUPER_CALL);
+ break;
+
+ case 352 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL);
+ break;
+
+ case 353 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(2, SUPER_CALL);
+ break;
+
+ case 354 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL);
+ break;
+
+ case 355 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(1, THIS_CALL);
+ break;
+
+ case 356 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL);
+ break;
+
+ case 357 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocation(2, THIS_CALL);
+ break;
+
+ case 358 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL);
+ break;
+
+ case 359 : if (DEBUG) { System.out.println("BaseConstructorExpression ::= base LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationBase(0);
+ break;
+
+ case 360 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= base LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationBase(1);
+ break;
+
+ case 361 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= Primary DOT base LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationBase(2);
+ break;
+
+ case 362 : if (DEBUG) { System.out.println("BaseConstructorInvocation ::= Name DOT base LPAREN..."); } //$NON-NLS-1$
+ consumeExplicitConstructorInvocationBase(3);
+ break;
+
+ case 363 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$
+ consumeInterfaceDeclaration();
+ break;
+
+ case 364 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$
+ consumeInterfaceHeader();
+ break;
+
+ case 365 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$
+ consumeTypeHeaderNameWithTypeParameters();
+ break;
+
+ case 367 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$
+ consumeInterfaceHeaderName1();
+ break;
+
+ case 368 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$
+ consumeInterfaceHeaderExtends();
+ break;
+
+ case 371 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$
+ consumeInterfaceMemberDeclarations();
+ break;
+
+ case 372 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeEmptyTypeDeclaration();
+ break;
+
+ case 373 : if (DEBUG) { System.out.println("PushDefault ::="); } //$NON-NLS-1$
+ consumeInterfaceMethodDefault();
+ break;
+
+ case 375 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader default..."); } //$NON-NLS-1$
+ consumeInterfaceMethodDeclaration(true);
+ break;
+
+ case 376 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$
+ consumeInterfaceMethodDeclaration(false);
+ break;
+
+ case 377 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
+ consumeInvalidConstructorDeclaration(true);
+ break;
+
+ case 378 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$
+ consumeInvalidConstructorDeclaration(false);
+ break;
+
+ case 390 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$
+ consumePushLeftBrace();
+ break;
+
+ case 391 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$
+ consumeEmptyArrayInitializer();
+ break;
+
+ case 392 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
+ consumeArrayInitializer();
+ break;
+
+ case 393 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$
+ consumeArrayInitializer();
+ break;
+
+ case 395 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$
+ consumeVariableInitializers();
+ break;
+
+ case 396 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$
+ consumeBlock();
+ break;
+
+ case 397 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$
+ consumeOpenBlock() ;
+ break;
+
+ case 399 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$
+ consumeBlockStatements() ;
+ break;
+
+ case 403 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$
+ consumeInvalidInterfaceDeclaration();
+ break;
+
+ case 404 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$
+ consumeInvalidAnnotationTypeDeclaration();
+ break;
+
+ case 405 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$
+ consumeInvalidEnumDeclaration();
+ break;
+
+ case 406 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$
+ consumeLocalVariableDeclarationStatement();
+ break;
+
+ case 407 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type0 PushModifiers..."); } //$NON-NLS-1$
+ consumeLocalVariableDeclaration();
+ break;
+
+ case 408 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type0..."); } //$NON-NLS-1$
+ consumeLocalVariableDeclaration();
+ break;
+
+ case 409 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$
+ consumePushModifiers();
+ break;
+
+ case 410 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$
+ consumePushModifiersForHeader();
+ break;
+
+ case 411 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$
+ consumePushRealModifiers();
+ break;
+
+ case 439 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeEmptyStatement();
+ break;
+
+ case 440 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$
+ consumeStatementLabel() ;
+ break;
+
+ case 441 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$
+ consumeStatementLabel() ;
+ break;
+
+ case 442 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$
+ consumeLabel();
+ break;
+
+ case 443 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$
+ consumeExpressionStatement();
+ break;
+
+ case 453 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementIfNoElse();
+ break;
+
+ case 454 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementIfWithElse();
+ break;
+
+ case 455 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$
+ consumeStatementIfWithElse();
+ break;
+
+ case 456 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementSwitch() ;
+ break;
+
+ case 457 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$
+ consumeEmptySwitchBlock() ;
+ break;
+
+ case 460 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$
+ consumeSwitchBlock() ;
+ break;
+
+ case 462 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$
+ consumeSwitchBlockStatements() ;
+ break;
+
+ case 463 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$
+ consumeSwitchBlockStatement() ;
+ break;
+
+ case 465 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$
+ consumeSwitchLabels() ;
+ break;
+
+ case 466 : if (DEBUG) { System.out.println("SwitchLabel ::= case ConstantExpression COLON"); } //$NON-NLS-1$
+ consumeCaseLabel();
+ break;
+
+ case 467 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$
+ consumeDefaultLabel();
+ break;
+
+ case 468 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeStatementWhile() ;
+ break;
+
+ case 469 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$
+ consumeStatementWhile() ;
+ break;
+
+ case 470 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$
+ consumeStatementDo() ;
+ break;
+
+ case 471 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$
+ consumeStatementFor() ;
+ break;
+
+ case 472 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$
+ consumeStatementFor() ;
+ break;
+
+ case 473 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$
+ consumeForInit() ;
+ break;
+
+ case 477 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$
+ consumeStatementExpressionList() ;
+ break;
+
+ case 478 : if (DEBUG) { System.out.println("WithinStatement ::= within LPAREN Expression RPAREN..."); } //$NON-NLS-1$
+ consumeWithinStatement();
+ break;
+
+ case 479 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$
+ consumeSimpleAssertStatement() ;
+ break;
+
+ case 480 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$
+ consumeAssertStatement() ;
+ break;
+
+ case 481 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementBreak() ;
+ break;
+
+ case 482 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementBreakWithLabel() ;
+ break;
+
+ case 483 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementContinue() ;
+ break;
+
+ case 484 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementContinueWithLabel() ;
+ break;
+
+ case 485 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementReturn() ;
+ break;
+
+ case 486 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$
+ consumeStatementThrow();
+ break;
+
+ case 487 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$
+ consumeStatementSynchronized();
+ break;
+
+ case 488 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$
+ consumeOnlySynchronized();
+ break;
+
+ case 489 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$
+ consumeStatementTry(false, false);
+ break;
+
+ case 490 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$
+ consumeStatementTry(true, false);
+ break;
+
+ case 491 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
+ consumeStatementTry(false, true);
+ break;
+
+ case 492 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$
+ consumeStatementTry(true, true);
+ break;
+
+ case 493 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$
+ consumeResourceSpecification();
+ break;
+
+ case 494 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$
+ consumeResourceOptionalTrailingSemiColon(false);
+ break;
+
+ case 495 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeResourceOptionalTrailingSemiColon(true);
+ break;
+
+ case 496 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$
+ consumeSingleResource();
+ break;
+
+ case 497 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$
+ consumeMultipleResources();
+ break;
+
+ case 498 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$
+ consumeResourceOptionalTrailingSemiColon(true);
+ break;
+
+ case 499 : if (DEBUG) { System.out.println("Resource ::= TypeInternal PushModifiers..."); } //$NON-NLS-1$
+ consumeResourceAsLocalVariableDeclaration();
+ break;
+
+ case 500 : if (DEBUG) { System.out.println("Resource ::= Modifiers TypeInternal PushRealModifiers..."); } //$NON-NLS-1$
+ consumeResourceAsLocalVariableDeclaration();
+ break;
+
+ case 502 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$
+ consumeExitTryBlock();
+ break;
+
+ case 504 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$
+ consumeCatches();
+ break;
+
+ case 505 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$
+ consumeStatementCatch() ;
+ break;
+
+ case 507 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$
+ consumeLeftParen();
+ break;
+
+ case 508 : if (DEBUG) { System.out.println("PushRPARENForUnannotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$
+ consumeRightParenForUnannotatedTypeCast();
+ break;
+
+ case 509 : if (DEBUG) { System.out.println("PushRPARENForNameUnannotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$
+ consumeRightParenForNameUnannotatedTypeCast();
+ break;
+
+ case 510 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$
+ consumeRightParen();
+ break;
+
+ case 511 : if (DEBUG) { System.out.println("PushRPARENForAnnotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$
+ consumeRightParenForAnnotatedTypeCast();
+ break;
+
+ case 512 : if (DEBUG) { System.out.println("PushRPARENForNameAndAnnotatedTypeCast ::= RPAREN"); } //$NON-NLS-1$
+ consumeRightParenForNameAndAnnotatedTypeCast();
+ break;
+
+ case 517 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayThis();
+ break;
+
+ case 518 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$
+ consumePrimaryNoNewArray();
+ break;
+
+ case 519 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayWithName();
+ break;
+
+ case 523 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayNameThis();
+ break;
+
+ case 524 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT super"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayNameSuper();
+ break;
+
+ case 525 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayName();
+ break;
+
+ case 526 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayArrayType();
+ break;
+
+ case 527 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayPrimitiveArrayType();
+ break;
+
+ case 528 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$
+ consumePrimaryNoNewArrayPrimitiveType();
+ break;
+
+ case 529 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
+ consumeRoleClassLiteral();
+ break;
+
+ case 535 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$
+ consumeReferenceExpressionPrimitiveTypeForm();
+ break;
+
+ case 536 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$
+ consumeReferenceExpressionNameForm();
+ break;
+
+ case 537 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); } //$NON-NLS-1$
+ consumeReferenceExpressionTypeForm(false);
+ break;
+
+ case 538 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name..."); } //$NON-NLS-1$
+ consumeReferenceExpressionTypeForm(true);
+ break;
+
+ case 539 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$
+ consumeReferenceExpressionPrimaryForm();
+ break;
+
+ case 540 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$
+ consumeReferenceExpressionSuperForm();
+ break;
+
+ case 541 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$
+ consumeEmptyTypeArguments();
+ break;
+
+ case 543 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$
+ consumeIdentifierOrNew(false);
+ break;
+
+ case 544 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$
+ consumeIdentifierOrNew(true);
+ break;
+
+ case 545 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$
+ consumeLambdaExpression();
+ break;
+
+ case 546 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier"); } //$NON-NLS-1$
+ consumeTypeElidedLambdaParameter(false);
+ break;
+
+ case 550 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$
+ consumeFormalParameterList();
+ break;
+
+ case 551 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$
+ consumeTypeElidedLambdaParameter(true);
+ break;
+
+ case 553 : if (DEBUG) { System.out.println("LambdaBody ::= NestedType NestedMethod LBRACE..."); } //$NON-NLS-1$
+ consumeBlock();
+ break;
+
+ case 554 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$
+ consumeElidedLeftBraceAndReturn();
+ break;
+
+ case 555 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$
+ consumeAllocationHeader();
+ break;
+
+ case 556 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionWithTypeArguments();
+ break;
+
+ case 557 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpression();
+ break;
+
+ case 558 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
+ break;
+
+ case 559 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualified() ;
+ break;
+
+ case 560 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualified() ;
+ break;
+
+ case 561 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ;
+ break;
+
+ case 562 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$
+ consumeEnterInstanceCreationArgumentList();
+ break;
+
+ case 563 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT"); } //$NON-NLS-1$
+ consumeClassInstanceCreationExpressionName() ;
+ break;
+
+ case 564 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$
+ consumeClassBodyopt();
+ break;
+
+ case 566 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
+ consumeEnterAnonymousClassBody(false);
+ break;
+
+ case 567 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$
+ consumeClassBodyopt();
+ break;
+
+ case 569 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$
+ consumeEnterAnonymousClassBody(true);
+ break;
+
+ case 571 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$
+ consumeArgumentList();
+ break;
+
+ case 572 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new Annotationsopt PrimitiveType"); } //$NON-NLS-1$
+ consumeArrayCreationHeader();
+ break;
+
+ case 573 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$
+ consumeArrayCreationHeader();
+ break;
+
+ case 574 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithoutInitializer();
+ break;
+
+ case 575 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new Annotationsopt"); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithInitializer();
+ break;
+
+ case 576 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithoutInitializer();
+ break;
+
+ case 577 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$
+ consumeArrayCreationExpressionWithInitializer();
+ break;
+
+ case 579 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$
+ consumeDimWithOrWithOutExprs();
+ break;
+
+ case 582 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= LBRACKET..."); } //$NON-NLS-1$
+ consumeDimWithOrWithOutExpr();
+ break;
+
+ case 583 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotations LBRACKET..."); } //$NON-NLS-1$
+ consumeDimWithOrWithOutExpr();
+ break;
+
+ case 584 : if (DEBUG) { System.out.println("DimsoptAnnotsopt ::="); } //$NON-NLS-1$
+ consumeEmptyDimsoptAnnotsopt();
+ break;
+
+ case 585 : if (DEBUG) { System.out.println("DimsoptAnnotsopt -> DimsAnnotLoop"); } //$NON-NLS-1$
+ consumeDimsWithTrailingAnnotsopt();
+ break;
+
+ case 588 : if (DEBUG) { System.out.println("OneDimOrAnnot ::= Annotation"); } //$NON-NLS-1$
+ consumeTypeAnnotation(true);
+ break;
+
+ case 589 : if (DEBUG) { System.out.println("OneDimOrAnnot ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
+ consumeOneDimLoop(true);
+ break;
+
+ case 590 : if (DEBUG) { System.out.println("TypeAnnotations ::= Annotation"); } //$NON-NLS-1$
+ consumeTypeAnnotation(false);
+ break;
+
+ case 591 : if (DEBUG) { System.out.println("TypeAnnotations ::= TypeAnnotations Annotation"); } //$NON-NLS-1$
+ consumeOneMoreTypeAnnotation();
+ break;
+
+ case 592 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$
+ consumeDims();
+ break;
+
+ case 595 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$
+ consumeOneDimLoop(false);
+ break;
+
+ case 596 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$
+ consumeOneDimLoopWithAnnotations();
+ break;
+
+ case 597 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$
+ consumeFieldAccess(false);
+ break;
+
+ case 598 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$
+ consumeFieldAccess(true);
+ break;
+
+ case 599 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
+ consumeMethodInvocationName();
+ break;
+
+ case 600 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationNameWithTypeArguments();
+ break;
+
+ case 601 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationPrimaryWithTypeArguments();
+ break;
+
+ case 602 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$
+ consumeMethodInvocationPrimary();
+ break;
+
+ case 603 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationSuperWithTypeArguments();
+ break;
+
+ case 604 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$
+ consumeMethodInvocationSuper();
+ break;
+
+ case 605 : if (DEBUG) { System.out.println("MethodInvocation ::= tsuper DOT Identifier LPAREN..."); } //$NON-NLS-1$
+ consumeMethodInvocationTSuper(UNQUALIFIED);
+ break;
+
+ case 606 : if (DEBUG) { System.out.println("MethodInvocation ::= tsuper DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationTSuperWithTypeArguments(0);
+ break;
+
+ case 607 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT tsuper DOT Identifier..."); } //$NON-NLS-1$
+ consumeMethodInvocationTSuper(QUALIFIED);
+ break;
+
+ case 608 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT tsuper DOT..."); } //$NON-NLS-1$
+ consumeMethodInvocationTSuperWithTypeArguments(2);
+ break;
+
+ case 609 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT Identifier LPAREN..."); } //$NON-NLS-1$
+ consumeMethodInvocationBase(false);
+ break;
+
+ case 610 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT OnlyTypeArguments..."); } //$NON-NLS-1$
+ consumeMethodInvocationBaseWithTypeArguments(false);
+ break;
+
+ case 611 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT super DOT Identifier..."); } //$NON-NLS-1$
+ consumeMethodInvocationBase(true);
+ break;
+
+ case 612 : if (DEBUG) { System.out.println("MethodInvocation ::= base DOT super DOT..."); } //$NON-NLS-1$
+ consumeMethodInvocationBaseWithTypeArguments(true);
+ break;
+
+ case 613 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$
+ consumeArrayAccess(true);
+ break;
+
+ case 614 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$
+ consumeArrayAccess(false);
+ break;
+
+ case 615 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$
+ consumeArrayAccess(false);
+ break;
+
+ case 617 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$
+ consumePostfixExpression();
+ break;
+
+ case 620 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS,true);
+ break;
+
+ case 621 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS,true);
+ break;
+
+ case 622 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$
+ consumePushPosition();
+ break;
+
+ case 625 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 626 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 628 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS,false);
+ break;
+
+ case 629 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS,false);
+ break;
+
+ case 631 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.TWIDDLE);
+ break;
+
+ case 632 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.NOT);
+ break;
+
+ case 634 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$
+ consumeCastExpressionWithPrimitiveType();
+ break;
+
+ case 635 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers PrimitiveType..."); } //$NON-NLS-1$
+ consumeCastExpressionWithPrimitiveTypeWithTypeAnnotations();
+ break;
+
+ case 636 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
+ consumeCastExpressionWithGenericsArray();
+ break;
+
+ case 637 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); } //$NON-NLS-1$
+ consumeCastExpressionWithGenericsArrayWithTypeAnnotations();
+ break;
+
+ case 638 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
+ consumeCastExpressionWithQualifiedGenericsArray();
+ break;
+
+ case 639 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); } //$NON-NLS-1$
+ consumeCastExpressionWithQualifiedGenericsArrayWithTypeAnnotations();
+ break;
+
+ case 640 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$
+ consumeCastExpressionLL1();
+ break;
+
+ case 641 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name..."); } //$NON-NLS-1$
+ consumeCastExpressionLL1WithTypeAnnotations();
+ break;
+
+ case 642 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$
+ consumeCastExpressionWithNameArray();
+ break;
+
+ case 643 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Modifiers Name Dims..."); } //$NON-NLS-1$
+ consumeCastExpressionWithNameArrayWithTypeAnnotations();
+ break;
+
+ case 644 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$
+ consumeOnlyTypeArgumentsForCastExpression();
+ break;
+
+ case 645 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$
+ consumeInsideCastExpression();
+ break;
+
+ case 646 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$
+ consumeInsideCastExpressionLL1();
+ break;
+
+ case 647 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$
+ consumeInsideCastExpressionWithQualifiedGenerics();
+ break;
+
+ case 648 : if (DEBUG) { System.out.println("InsideCastExpressionWithAnnotatedQualifiedGenerics ::="); } //$NON-NLS-1$
+ consumeInsideCastExpressionWithAnnotatedQualifiedGenerics();
+ break;
+
+ case 650 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MULTIPLY);
+ break;
+
+ case 651 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.DIVIDE);
+ break;
+
+ case 652 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.REMAINDER);
+ break;
+
+ case 654 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 655 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 657 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
+ break;
+
+ case 658 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
+ break;
+
+ case 659 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 661 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS);
+ break;
+
+ case 662 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER);
+ break;
+
+ case 663 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS_EQUAL);
+ break;
+
+ case 664 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
+ break;
+
+ case 666 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$
+ consumeInstanceOfExpression();
+ break;
+
+ case 668 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
+ break;
+
+ case 669 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.NOT_EQUAL);
+ break;
+
+ case 671 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND);
+ break;
+
+ case 673 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.XOR);
+ break;
+
+ case 675 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR);
+ break;
+
+ case 677 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND_AND);
+ break;
+
+ case 679 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR_OR);
+ break;
+
+ case 681 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$
+ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
+ break;
+
+ case 684 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$
+ consumeAssignment();
+ break;
+
+ case 686 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$
+ ignoreExpressionAssignment();
+ break;
+
+ case 687 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(EQUAL);
+ break;
+
+ case 688 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(MULTIPLY);
+ break;
+
+ case 689 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(DIVIDE);
+ break;
+
+ case 690 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(REMAINDER);
+ break;
+
+ case 691 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(PLUS);
+ break;
+
+ case 692 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(MINUS);
+ break;
+
+ case 693 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(LEFT_SHIFT);
+ break;
+
+ case 694 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(RIGHT_SHIFT);
+ break;
+
+ case 695 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 696 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(AND);
+ break;
+
+ case 697 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(XOR);
+ break;
+
+ case 698 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$
+ consumeAssignmentOperator(OR);
+ break;
+
+ case 699 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$
+ consumeExpression();
+ break;
+
+ case 702 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$
+ consumeEmptyExpression();
+ break;
+
+ case 707 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyClassBodyDeclarationsopt();
+ break;
+
+ case 708 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ consumeClassBodyDeclarationsopt();
+ break;
+
+ case 709 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$
+ consumeDefaultModifiers();
+ break;
+
+ case 710 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$
+ consumeModifiers();
+ break;
+
+ case 711 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$
+ consumeEmptyBlockStatementsopt();
+ break;
+
+ case 713 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$
+ consumeEmptyDimsopt();
+ break;
+
+ case 715 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$
+ consumeEmptyArgumentListopt();
+ break;
+
+ case 719 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$
+ consumeFormalParameterListopt();
+ break;
+
+ case 723 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyInterfaceMemberDeclarationsopt();
+ break;
+
+ case 724 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ consumeInterfaceMemberDeclarationsopt();
+ break;
+
+ case 725 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$
+ consumeNestedType();
+ break;
+
+ case 726 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$
+ consumeEmptyForInitopt();
+ break;
+
+ case 728 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$
+ consumeEmptyForUpdateopt();
+ break;
+
+ case 732 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$
+ consumeEmptyCatchesopt();
+ break;
+
+ case 734 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$
+ consumeEnumDeclaration();
+ break;
+
+ case 735 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$
+ consumeEnumHeader();
+ break;
+
+ case 736 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$
+ consumeEnumHeaderName();
+ break;
+
+ case 737 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$
+ consumeEnumHeaderNameWithTypeParameters();
+ break;
+
+ case 738 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$
+ consumeEnumBodyNoConstants();
+ break;
+
+ case 739 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$
+ consumeEnumBodyNoConstants();
+ break;
+
+ case 740 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$
+ consumeEnumBodyWithConstants();
+ break;
+
+ case 741 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$
+ consumeEnumBodyWithConstants();
+ break;
+
+ case 743 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$
+ consumeEnumConstants();
+ break;
+
+ case 744 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$
+ consumeEnumConstantHeaderName();
+ break;
+
+ case 745 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$
+ consumeEnumConstantHeader();
+ break;
+
+ case 746 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$
+ consumeEnumConstantWithClassBody();
+ break;
+
+ case 747 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$
+ consumeEnumConstantNoClassBody();
+ break;
+
+ case 748 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$
+ consumeArguments();
+ break;
+
+ case 749 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$
+ consumeEmptyArguments();
+ break;
+
+ case 751 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$
+ consumeEnumDeclarations();
+ break;
+
+ case 752 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyEnumDeclarations();
+ break;
+
+ case 754 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$
+ consumeEnhancedForStatement();
+ break;
+
+ case 755 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$
+ consumeEnhancedForStatement();
+ break;
+
+ case 756 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type0..."); } //$NON-NLS-1$
+ consumeEnhancedForStatementHeaderInit(false);
+ break;
+
+ case 757 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$
+ consumeEnhancedForStatementHeaderInit(true);
+ break;
+
+ case 758 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$
+ consumeEnhancedForStatementHeader();
+ break;
+
+ case 759 : if (DEBUG) { System.out.println("SingleBaseImportDeclaration ::=..."); } //$NON-NLS-1$
+ consumeImportDeclaration();
+ break;
+
+ case 760 : if (DEBUG) { System.out.println("SingleBaseImportDeclarationName ::= import base Name"); } //$NON-NLS-1$
+ consumeSingleBaseImportDeclarationName();
+ break;
+
+ case 761 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$
+ consumeImportDeclaration();
+ break;
+
+ case 762 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$
+ consumeSingleStaticImportDeclarationName();
+ break;
+
+ case 763 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$
+ consumeImportDeclaration();
+ break;
+
+ case 764 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$
+ consumeStaticImportOnDemandDeclarationName();
+ break;
+
+ case 765 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
+ consumeTypeArguments();
+ break;
+
+ case 766 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$
+ consumeOnlyTypeArguments();
+ break;
+
+ case 768 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ consumeTypeArgumentList1();
+ break;
+
+ case 770 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$
+ consumeTypeArgumentList();
+ break;
+
+ case 771 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$
+ consumeTypeArgument();
+ break;
+
+ case 776 : if (DEBUG) { System.out.println("TypeAnchor ::= AT Name"); } //$NON-NLS-1$
+ consumeTypeAnchor(false);
+ break;
+
+ case 777 : if (DEBUG) { System.out.println("TypeAnchor ::= AT base"); } //$NON-NLS-1$
+ consumeTypeAnchor(true);
+ break;
+
+ case 778 : if (DEBUG) { System.out.println("TypeAnchor ::= AT this"); } //$NON-NLS-1$
+ skipThisAnchor();
+ break;
+
+ case 779 : if (DEBUG) { System.out.println("TypeAnchor ::= AT Name DOT base"); } //$NON-NLS-1$
+ consumeQualifiedBaseTypeAnchor();
+ break;
+
+ case 782 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$
+ consumeReferenceType1();
+ break;
+
+ case 783 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
+ consumeTypeArgumentReferenceType1();
+ break;
+
+ case 784 : if (DEBUG) { System.out.println("ReferenceType1 ::= Modifiers ClassOrInterface LESS..."); } //$NON-NLS-1$
+ consumeTypeArgumentReferenceType1WithTypeAnnotations();
+ break;
+
+ case 786 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ consumeTypeArgumentList2();
+ break;
+
+ case 789 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeReferenceType2();
+ break;
+
+ case 790 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$
+ consumeTypeArgumentReferenceType2();
+ break;
+
+ case 791 : if (DEBUG) { System.out.println("ReferenceType2 ::= Modifiers ClassOrInterface LESS..."); } //$NON-NLS-1$
+ consumeTypeArgumentReferenceType2WithTypeAnnotations();
+ break;
+
+ case 793 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$
+ consumeTypeArgumentList3();
+ break;
+
+ case 796 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeReferenceType3();
+ break;
+
+ case 797 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION"); } //$NON-NLS-1$
+ consumeWildcard();
+ break;
+
+ case 798 : if (DEBUG) { System.out.println("Wildcard ::= QUESTION WildcardBounds"); } //$NON-NLS-1$
+ consumeWildcardWithBounds();
+ break;
+
+ case 799 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$
+ consumeWildcardBoundsExtends();
+ break;
+
+ case 800 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$
+ consumeWildcardBoundsSuper();
+ break;
+
+ case 801 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION GREATER"); } //$NON-NLS-1$
+ consumeWildcard1();
+ break;
+
+ case 802 : if (DEBUG) { System.out.println("Wildcard1 ::= QUESTION WildcardBounds1"); } //$NON-NLS-1$
+ consumeWildcard1WithBounds();
+ break;
+
+ case 803 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$
+ consumeWildcardBounds1Extends();
+ break;
+
+ case 804 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$
+ consumeWildcardBounds1Super();
+ break;
+
+ case 805 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeWildcard2();
+ break;
+
+ case 806 : if (DEBUG) { System.out.println("Wildcard2 ::= QUESTION WildcardBounds2"); } //$NON-NLS-1$
+ consumeWildcard2WithBounds();
+ break;
+
+ case 807 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$
+ consumeWildcardBounds2Extends();
+ break;
+
+ case 808 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$
+ consumeWildcardBounds2Super();
+ break;
+
+ case 809 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$
+ consumeWildcard3();
+ break;
+
+ case 810 : if (DEBUG) { System.out.println("Wildcard3 ::= QUESTION WildcardBounds3"); } //$NON-NLS-1$
+ consumeWildcard3WithBounds();
+ break;
+
+ case 811 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$
+ consumeWildcardBounds3Extends();
+ break;
+
+ case 812 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$
+ consumeWildcardBounds3Super();
+ break;
+
+ case 813 : if (DEBUG) { System.out.println("PushZeroTypeAnnotations ::="); } //$NON-NLS-1$
+ consumeZeroTypeAnnotations(true);
+ break;
+
+ case 814 : if (DEBUG) { System.out.println("TypeParameterHeader ::= PushZeroTypeAnnotations..."); } //$NON-NLS-1$
+ consumeTypeParameterHeader();
+ break;
+
+ case 815 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotations Identifier"); } //$NON-NLS-1$
+ consumeTypeParameterHeader();
+ break;
+
+ case 816 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$
+ consumeTypeParameters();
+ break;
+
+ case 818 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
+ consumeTypeParameterList();
+ break;
+
+ case 820 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameterWithExtends();
+ break;
+
+ case 821 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameterWithExtendsAndBounds();
+ break;
+
+ case 822 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader base ReferenceType"); } //$NON-NLS-1$
+ consumeTypeParameterWithBase();
+ break;
+
+ case 826 : if (DEBUG) { System.out.println("TypeValueParameter ::= TypeParameterHeader Identifier"); } //$NON-NLS-1$
+ consumeTypeValueParameter();
+ break;
+
+ case 831 : if (DEBUG) { System.out.println("TypeBoundOpt ::= extends ReferenceType"); } //$NON-NLS-1$
+ consumeBoundsOfAnchoredTypeParameter();
+ break;
+
+ case 833 : if (DEBUG) { System.out.println("TypeBoundOpt1 ::= extends ReferenceType1"); } //$NON-NLS-1$
+ consumeBoundsOfAnchoredTypeParameter();
+ break;
+
+ case 834 : if (DEBUG) { System.out.println("AnchoredTypeParameterHeader0 ::= TypeParameterHeader..."); } //$NON-NLS-1$
+ consumeAnchoredTypeParameter();
+ break;
+
+ case 836 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$
+ consumeAdditionalBoundList();
+ break;
+
+ case 837 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$
+ consumeAdditionalBound();
+ break;
+
+ case 839 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$
+ consumeTypeParameterList1();
+ break;
+
+ case 840 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$
+ consumeTypeParameter1();
+ break;
+
+ case 841 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameter1WithExtends();
+ break;
+
+ case 842 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader base..."); } //$NON-NLS-1$
+ consumeTypeParameter1WithBase();
+ break;
+
+ case 843 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$
+ consumeTypeParameter1WithExtendsAndBounds();
+ break;
+
+ case 845 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$
+ consumeAdditionalBoundList1();
+ break;
+
+ case 846 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$
+ consumeAdditionalBound1();
+ break;
+
+ case 852 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 853 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 856 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.TWIDDLE);
+ break;
+
+ case 857 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$
+ consumeUnaryExpression(OperatorIds.NOT);
+ break;
+
+ case 860 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MULTIPLY);
+ break;
+
+ case 861 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.MULTIPLY);
+ break;
+
+ case 862 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.DIVIDE);
+ break;
+
+ case 863 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.DIVIDE);
+ break;
+
+ case 864 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.REMAINDER);
+ break;
+
+ case 865 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.REMAINDER);
+ break;
+
+ case 867 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.PLUS);
+ break;
+
+ case 868 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.PLUS);
+ break;
+
+ case 869 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.MINUS);
+ break;
+
+ case 870 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.MINUS);
+ break;
+
+ case 872 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LEFT_SHIFT);
+ break;
+
+ case 873 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT);
+ break;
+
+ case 874 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT);
+ break;
+
+ case 875 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT);
+ break;
+
+ case 876 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 877 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT);
+ break;
+
+ case 879 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS);
+ break;
+
+ case 880 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.LESS);
+ break;
+
+ case 881 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER);
+ break;
+
+ case 882 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.GREATER);
+ break;
+
+ case 883 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.LESS_EQUAL);
+ break;
+
+ case 884 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL);
+ break;
+
+ case 885 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.GREATER_EQUAL);
+ break;
+
+ case 886 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL);
+ break;
+
+ case 888 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$
+ consumeInstanceOfExpressionWithName();
+ break;
+
+ case 889 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeInstanceOfExpression();
+ break;
+
+ case 891 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL);
+ break;
+
+ case 892 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL);
+ break;
+
+ case 893 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeEqualityExpression(OperatorIds.NOT_EQUAL);
+ break;
+
+ case 894 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$
+ consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL);
+ break;
+
+ case 896 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND);
+ break;
+
+ case 897 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.AND);
+ break;
+
+ case 899 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.XOR);
+ break;
+
+ case 900 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.XOR);
+ break;
+
+ case 902 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR);
+ break;
+
+ case 903 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.OR);
+ break;
+
+ case 905 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.AND_AND);
+ break;
+
+ case 906 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.AND_AND);
+ break;
+
+ case 908 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeBinaryExpression(OperatorIds.OR_OR);
+ break;
+
+ case 909 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$
+ consumeBinaryExpressionWithName(OperatorIds.OR_OR);
+ break;
+
+ case 911 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$
+ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ;
+ break;
+
+ case 912 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$
+ consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ;
+ break;
+
+ case 916 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderName() ;
+ break;
+
+ case 917 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
+ break;
+
+ case 918 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ;
+ break;
+
+ case 919 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeaderName() ;
+ break;
+
+ case 920 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclarationHeader() ;
+ break;
+
+ case 921 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeDeclaration() ;
+ break;
+
+ case 923 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$
+ consumeEmptyAnnotationTypeMemberDeclarationsopt() ;
+ break;
+
+ case 924 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$
+ consumeAnnotationTypeMemberDeclarationsopt() ;
+ break;
+
+ case 926 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeMemberDeclarations() ;
+ break;
+
+ case 927 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeMethodHeaderNameWithTypeParameters(true);
+ break;
+
+ case 928 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type0..."); } //$NON-NLS-1$
+ consumeMethodHeaderName(true);
+ break;
+
+ case 929 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$
+ consumeEmptyMethodHeaderDefaultValue() ;
+ break;
+
+ case 930 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$
+ consumeMethodHeaderDefaultValue();
+ break;
+
+ case 931 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 932 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$
+ consumeAnnotationTypeMemberDeclaration() ;
+ break;
+
+ case 940 : if (DEBUG) { System.out.println("AnnotationName ::= AT Name"); } //$NON-NLS-1$
+ consumeAnnotationName() ;
+ break;
+
+ case 941 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
+ consumeNormalAnnotation() ;
+ break;
+
+ case 942 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$
+ consumeEmptyMemberValuePairsopt() ;
+ break;
+
+ case 945 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$
+ consumeMemberValuePairs() ;
+ break;
+
+ case 946 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$
+ consumeMemberValuePair() ;
+ break;
+
+ case 947 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$
+ consumeEnterMemberValue() ;
+ break;
+
+ case 948 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$
+ consumeExitMemberValue() ;
+ break;
+
+ case 950 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$
+ consumeMemberValueAsName() ;
+ break;
+
+ case 953 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeMemberValueArrayInitializer() ;
+ break;
+
+ case 954 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeMemberValueArrayInitializer() ;
+ break;
+
+ case 955 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeEmptyMemberValueArrayInitializer() ;
+ break;
+
+ case 956 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$
+ consumeEmptyMemberValueArrayInitializer() ;
+ break;
+
+ case 957 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$
+ consumeEnterMemberValueArrayInitializer() ;
+ break;
+
+ case 959 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$
+ consumeMemberValues() ;
+ break;
+
+ case 960 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$
+ consumeMarkerAnnotation() ;
+ break;
+
+ case 961 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$
+ consumeSingleMemberAnnotationMemberValue() ;
+ break;
+
+ case 962 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$
+ consumeSingleMemberAnnotation() ;
+ break;
+
+ case 963 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$
+ consumeRecoveryMethodHeaderNameWithTypeParameters();
+ break;
+
+ case 964 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type0..."); } //$NON-NLS-1$
+ consumeRecoveryMethodHeaderName();
+ break;
+
+ case 965 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 966 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
+ consumeMethodHeader();
+ break;
+
+ case 969 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= RecoveryCallinBindingLeftLong"); } //$NON-NLS-1$
+ consumeCallinHeader();
+ break;
+
+ case 970 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
+ consumeCallinHeader();
+ break;
+
+ case 971 : if (DEBUG) { System.out.println("RecoveryCallinBindingLeftLong ::= RecoveryMethodSpecLong"); } //$NON-NLS-1$
+ consumeCallinBindingLeft(true);
+ break;
+
+ case 972 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt..."); } //$NON-NLS-1$
+ consumeCallinHeader();
+ break;
+
+ case 973 : if (DEBUG) { System.out.println("RecoveryCallinHeader ::= Modifiersopt CallinLabel..."); } //$NON-NLS-1$
+ consumeCallinHeader();
+ break;
+
+ case 974 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::= RecoveryCalloutBindingLeftLong"); } //$NON-NLS-1$
consumeCalloutHeader();
break;
- case 883 : if (DEBUG) { System.out.println("RecoveryCalloutBindingLeftLong ::=..."); } //$NON-NLS-1$
+ case 975 : if (DEBUG) { System.out.println("RecoveryCalloutBindingLeftLong ::=..."); } //$NON-NLS-1$
consumeCalloutBindingLeft(true);
break;
- case 884 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::= RecoveryCalloutBindingLeftLong"); } //$NON-NLS-1$
+ case 976 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::= RecoveryCalloutBindingLeftLong"); } //$NON-NLS-1$
consumeCalloutHeader();
break;
- case 885 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::= Modifiersopt..."); } //$NON-NLS-1$
+ case 977 : if (DEBUG) { System.out.println("RecoveryCalloutHeader ::= Modifiersopt..."); } //$NON-NLS-1$
consumeCalloutHeader();
break;
- case 886 : if (DEBUG) { System.out.println("RecoveryMethodSpecLong ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
+ case 978 : if (DEBUG) { System.out.println("RecoveryMethodSpecLong ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$
consumeMethodSpecLong(false);
break;
}
}
+protected void consumeVariableDeclaratorIdParameter () {
+ pushOnIntStack(1); // signal "normal" variable declarator id parameter.
+}
+protected void consumeExplicitThisParameter(boolean isQualified) {
+ // VariableDeclaratorIdOrThis ::= 'this'
+ // VariableDeclaratorIdOrThis ::= Name '.' 'this'
+
+ TypeReference qualifyingTypeReference = null;
+ if (isQualified) {
+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
+ pushOnGenericsLengthStack(0); // handle type arguments
+ qualifyingTypeReference = getUnannotatedTypeReference(0);
+ }
+ pushOnExpressionStack(qualifyingTypeReference);
+
+ int stackLength = this.identifierStack.length;
+ if (++this.identifierPtr >= stackLength) {
+ System.arraycopy(
+ this.identifierStack, 0,
+ this.identifierStack = new char[stackLength + 20][], 0,
+ stackLength);
+ System.arraycopy(
+ this.identifierPositionStack, 0,
+ this.identifierPositionStack = new long[stackLength + 20], 0,
+ stackLength);
+ }
+ this.identifierStack[this.identifierPtr] = ConstantPool.This;
+ int thisStart = this.intStack[this.intPtr--];
+ this.identifierPositionStack[this.identifierPtr] =
+ (((long) thisStart << 32)) + (thisStart + 3);
+
+ stackLength = this.identifierLengthStack.length;
+ if (++this.identifierLengthPtr >= stackLength) {
+ System.arraycopy(
+ this.identifierLengthStack, 0,
+ this.identifierLengthStack = new int[stackLength + 10], 0,
+ stackLength);
+ }
+ this.identifierLengthStack[this.identifierLengthPtr] = 1;
+ pushOnIntStack(0); // extended dimensions ...
+ pushOnIntStack(0); // signal explicit this
+}
+protected void consumeLambdaExpression() {
+
+ // LambdaExpression ::= LambdaParameters ARROW LambdaBody
+
+//{ObjectTeams: pop two ints pushed in consumeToken(ARROW) (aka TokenNameBINDOUT)
+ this.intPtr -= 2;
+// SH}
+
+ this.astLengthPtr--;
+ Statement body = (Statement) this.astStack[this.astPtr--];
+ if (body instanceof Block) {
+ this.nestedType--;
+ this.intPtr--;
+ if (this.options.ignoreMethodBodies) {
+ body = new Block(0);
+ }
+ }
+ Argument [] arguments = null;
+ int length = this.astLengthStack[this.astLengthPtr--];
+ this.astPtr -= length;
+ //arguments
+ if (length != 0) {
+ System.arraycopy(
+ this.astStack,
+ this.astPtr + 1,
+ arguments = new Argument[length],
+ 0,
+ length);
+ }
+ for (int i = 0; i < length; i++) {
+ if (arguments[i].isReceiver()) {
+ problemReporter().illegalThis(arguments[i]);
+ }
+ }
+ LambdaExpression lexp = new LambdaExpression(arguments, body);
+ this.intPtr--; // ')' position, discard for now.
+ lexp.sourceStart = this.intStack[this.intPtr--]; // '(' position or identifier position.
+ lexp.sourceEnd = body.sourceEnd;
+ pushOnExpressionStack(lexp);
+ if (!this.parsingJava8Plus) {
+ problemReporter().lambdaExpressionsNotBelow18(lexp);
+ }
+ this.listLength = 0; // reset this.listLength after having read all parameters
+}
+
+protected void consumeTypeElidedLambdaParameter(boolean parenthesized) {
+
+ // LambdaParameters ::= Identifier
+ // TypeElidedFormalParameter ::= Modifiersopt Identifier
+
+ int modifier = ClassFileConstants.AccDefault;
+ int annotationLength = 0;
+ int modifiersStart = 0;
+ if (parenthesized) { // The grammar is permissive enough to allow optional modifiers for the parenthesized version, they should be rejected if present.
+ modifiersStart = this.intStack[this.intPtr--];
+ modifier = this.intStack[this.intPtr--];
+ // pop annotations
+ annotationLength = this.expressionLengthStack[this.expressionLengthPtr--];
+ this.expressionPtr -= annotationLength;
+ }
+
+ this.identifierLengthPtr--;
+ char[] identifierName = this.identifierStack[this.identifierPtr];
+ long namePositions = this.identifierPositionStack[this.identifierPtr--];
+
+ Argument arg =
+ new Argument(
+ identifierName,
+ namePositions,
+ null, // elided type
+ ClassFileConstants.AccDefault,
+ true);
+ arg.declarationSourceStart = (int) (namePositions >>> 32);
+ if (modifier != ClassFileConstants.AccDefault || annotationLength != 0) {
+ problemReporter().illegalModifiersForElidedType(arg);
+ arg.declarationSourceStart = modifiersStart;
+ }
+ pushOnAstStack(arg);
+ if (!parenthesized) { // in the absence of '(' and ')', record positions.
+ pushOnIntStack(arg.declarationSourceStart);
+ pushOnIntStack(arg.declarationSourceEnd);
+ }
+ /* if incomplete method header, this.listLength counter will not have been reset,
+ indicating that some arguments are available on the stack */
+ this.listLength++;
+}
+protected void consumeElidedLeftBraceAndReturn() {
+ /* ElidedLeftBraceAndReturn ::= $empty
+ Alert ! Sleight of hand - Part I : Record stack depth now that we are at the state with the kernel item
+ ElidedLeftBraceAndReturn .Expression ElidedSemicolonAndRightBrace
+ */
+ int stackLength = this.stateStackLengthStack.length;
+ if (++this.valueLambdaNestDepth >= stackLength) {
+ System.arraycopy(
+ this.stateStackLengthStack, 0,
+ this.stateStackLengthStack = new int[stackLength + 4], 0,
+ stackLength);
+ }
+ this.stateStackLengthStack[this.valueLambdaNestDepth] = this.stateStackTop;
+}
+protected void consumeExpression() {
+ /* Expression ::= AssignmentExpression
+ Alert ! Sleight of hand - Part II: See if we are at the state with the item: "ElidedLeftBraceAndReturn Expression .ElidedSemicolonAndRightBrace"
+ If so, push back the current token into the lexer stream, materialize the synthetic terminal marker symbol, switch and continue.
+ */
+ if (this.valueLambdaNestDepth >= 0 && this.stateStackLengthStack[this.valueLambdaNestDepth] == this.stateStackTop - 1) {
+ this.valueLambdaNestDepth--;
+ this.scanner.ungetToken(this.currentToken);
+ this.currentToken = TokenNameElidedSemicolonAndRightBrace; // conjure a rabbit out of the hat ...
+ Expression exp = this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+ pushOnAstStack(exp);
+ }
+}
+protected void consumeIdentifierOrNew(boolean newForm) {
+ pushOnIntStack(newForm ? 1 : 0); // to discriminate between the two forms downstream.
+}
+protected void consumeEmptyTypeArguments() {
+ pushOnGenericsLengthStack(0); // signal absence of type arguments.
+}
+protected void consumeReferenceExpressionPrimitiveTypeForm() {
+ // ReferenceExpression ::= PrimitiveType Dims '::' NonWildTypeArgumentsopt IdentifierOrNew
+
+ ReferenceExpression rexp;
+ TypeReference type = null;
+ TypeReference [] typeArguments = null;
+ SingleNameReference methodReference = null;
+ int newEnd = -1;
+
+ boolean newForm = this.intStack[this.intPtr--] != 0;
+ if (newForm) {
+ newEnd = this.intStack[this.intPtr--] + 3; // "new"
+ } else {
+ methodReference = (SingleNameReference) getUnspecifiedReferenceOptimized();
+ }
+
+ int length = this.genericsLengthStack[this.genericsLengthPtr--];
+ if (length > 0) {
+ this.genericsPtr -= length;
+ System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
+ this.intPtr--; // pop type arguments source start.
+ }
+
+ type = getUnannotatedTypeReference(this.intStack[this.intPtr--]);
+
+ if (newForm) {
+ rexp = new ReferenceExpression(type, typeArguments, newEnd);
+ } else {
+ rexp = new ReferenceExpression(type, typeArguments, methodReference);
+ }
+
+ pushOnExpressionStack(rexp);
+ if (!this.parsingJava8Plus) {
+ problemReporter().referenceExpressionsNotBelow18(rexp);
+ }
+}
+protected void consumeReferenceExpressionNameForm() {
+ // ReferenceExpression ::= Name Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
+
+ ReferenceExpression rexp;
+ TypeReference [] typeArguments = null;
+ SingleNameReference methodReference = null;
+ int newEnd = -1;
+
+ boolean newForm = this.intStack[this.intPtr--] != 0;
+ if (newForm) {
+ newEnd = this.intStack[this.intPtr--] + 3; // "new"
+ } else {
+ methodReference = (SingleNameReference) getUnspecifiedReferenceOptimized();
+ }
+
+ int length = this.genericsLengthStack[this.genericsLengthPtr--];
+ if (length > 0) {
+ this.genericsPtr -= length;
+ System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
+ this.intPtr--; // pop type arguments source start.
+ }
+
+ this.intPtr--; // Pop and drop dimensions as of now - there is some ambiguity between type reference and name reference here.
+ NameReference nameReference = getUnspecifiedReference();
+ if (newForm) {
+ rexp = new ReferenceExpression(nameReference, typeArguments, newEnd);
+ } else {
+ rexp = new ReferenceExpression(nameReference, typeArguments, methodReference);
+ }
+ pushOnExpressionStack(rexp);
+ if (!this.parsingJava8Plus) {
+ problemReporter().referenceExpressionsNotBelow18(rexp);
+ }
+}
+protected void consumeReferenceExpressionPrimaryForm() {
+ // ReferenceExpression ::= Primary '::' NonWildTypeArgumentsopt Identifier
+
+ ReferenceExpression rexp;
+ TypeReference [] typeArguments = null;
+ SingleNameReference methodReference;
+
+ methodReference = (SingleNameReference) getUnspecifiedReferenceOptimized();
+ int length = this.genericsLengthStack[this.genericsLengthPtr--];
+ if (length > 0) {
+ this.genericsPtr -= length;
+ System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
+ this.intPtr--; // pop type arguments source start.
+ }
+
+ Expression primary = this.expressionStack[this.expressionPtr--];
+ this.expressionLengthPtr--;
+ rexp = new ReferenceExpression(primary, typeArguments, methodReference);
+ pushOnExpressionStack(rexp);
+ if (!this.parsingJava8Plus) {
+ problemReporter().referenceExpressionsNotBelow18(rexp);
+ }
+}
+protected void consumeReferenceExpressionSuperForm() {
+ // ReferenceExpression ::= 'super' '::' NonWildTypeArgumentsopt Identifier
+
+ ReferenceExpression rexp;
+ TypeReference [] typeArguments = null;
+ SingleNameReference methodReference;
+
+ methodReference = (SingleNameReference) getUnspecifiedReferenceOptimized();
+ int length = this.genericsLengthStack[this.genericsLengthPtr--];
+ if (length > 0) {
+ this.genericsPtr -= length;
+ System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
+ this.intPtr--; // pop type arguments source start.
+ }
+
+ SuperReference superReference = new SuperReference(this.intStack[this.intPtr--], this.endPosition);
+ rexp = new ReferenceExpression(superReference, typeArguments, methodReference);
+ pushOnExpressionStack(rexp);
+ if (!this.parsingJava8Plus) {
+ problemReporter().referenceExpressionsNotBelow18(rexp);
+ }
+}
+protected void consumeReferenceExpressionTypeForm(boolean qualified) {
+ // ReferenceExpression ::= Name OnlyTypeArgumentsForReferenceExpression Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
+ // ReferenceExpression ::= Name OnlyTypeArgumentsForReferenceExpression '.' ClassOrInterfaceType Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
+
+ ReferenceExpression rexp;
+ TypeReference type = null;
+ TypeReference [] typeArguments = null;
+ SingleNameReference methodReference = null;
+ int newEnd = -1;
+
+ boolean newForm = this.intStack[this.intPtr--] != 0;
+ if (newForm) {
+ newEnd = this.intStack[this.intPtr--] + 3; // "new"
+ } else {
+ methodReference = (SingleNameReference) getUnspecifiedReferenceOptimized();
+ }
+
+ int length = this.genericsLengthStack[this.genericsLengthPtr--];
+ if (length > 0) {
+ this.genericsPtr -= length;
+ System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments = new TypeReference[length], 0, length);
+ this.intPtr--; // pop type arguments source start.
+ }
+ int dims = this.intStack[this.intPtr--];
+ // Code lifted from CastExpression consumption actions and pounded into shape ...
+ if (qualified) {
+ TypeReference rightSide = getTypeReference(0);
+ ParameterizedQualifiedTypeReference qualifiedParameterizedTypeReference = computeQualifiedGenericsFromRightSide(rightSide, dims);
+ this.intPtr--;
+ if (newForm) {
+ rexp = new ReferenceExpression(qualifiedParameterizedTypeReference, typeArguments, newEnd);
+ } else {
+ rexp = new ReferenceExpression(qualifiedParameterizedTypeReference, typeArguments, methodReference);
+ }
+ } else {
+ pushOnGenericsIdentifiersLengthStack(this.identifierLengthStack[this.identifierLengthPtr]);
+ type = getTypeReference(dims);
+ if (newForm) {
+ rexp = new ReferenceExpression(type, typeArguments, newEnd);
+ } else {
+ rexp = new ReferenceExpression(type, typeArguments, methodReference);
+ }
+ this.intPtr --; // pop '<' position
+ }
+ pushOnExpressionStack(rexp);
+ if (!this.parsingJava8Plus) {
+ problemReporter().referenceExpressionsNotBelow18(rexp);
+ }
+}
+protected void consumeInterfaceMethodDefault() {
+ // Shift method co-ordinates past the default keyword.
+ AbstractMethodDeclaration md = (AbstractMethodDeclaration) this.astStack[this.astPtr];
+ md.bodyStart = this.scanner.currentPosition;
+ return;
+}
protected void consumeEnterInstanceCreationArgumentList() {
- this.shouldDeferRecovery = true;
+ this.shouldDeferRecovery = true;
}
protected void consumeSimpleAssertStatement() {
// AssertStatement ::= 'assert' Expression ';'
@@ -10207,11 +11374,65 @@
pushOnGenericsStack(getTypeReference(0));
this.intPtr--;
}
+protected void consumeTypeArgumentReferenceType1WithTypeAnnotations() {
+ concatGenericsLists();
+ TypeReference typeReference = getUnannotatedTypeReference(0);
+ // copy from expression stack to type annotation stack
+ int length;
+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ typeReference.annotations = new Annotation[length],
+ 0,
+ length);
+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
+ if (this.modifiersSourceStart < typeReferenceSourceStart) {
+ typeReferenceSourceStart = this.modifiersSourceStart;
+ }
+ typeReference.bits |= ASTNode.HasTypeAnnotations;
+ typeReference.sourceStart = typeReferenceSourceStart;
+ }
+ pushOnGenericsStack(typeReference);
+ // remove the 0 pushed by ZeroTypeAnnotation
+ this.typeAnnotationLengthPtr--;
+ this.intPtr--;
+ if (this.modifiers != ClassFileConstants.AccDefault) {
+ problemReporter().invalidLocationForModifiers(typeReference);
+ }
+ resetModifiers();
+}
protected void consumeTypeArgumentReferenceType2() {
concatGenericsLists();
pushOnGenericsStack(getTypeReference(0));
this.intPtr--;
}
+protected void consumeTypeArgumentReferenceType2WithTypeAnnotations() {
+ concatGenericsLists();
+ TypeReference typeReference = getUnannotatedTypeReference(0);
+ // copy from expression stack to type annotation stack
+ int length;
+ if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.expressionStack,
+ (this.expressionPtr -= length) + 1,
+ typeReference.annotations = new Annotation[length],
+ 0,
+ length);
+ int typeReferenceSourceStart = typeReference.annotations[0].sourceStart;
+ if (this.modifiersSourceStart < typeReferenceSourceStart) {
+ typeReferenceSourceStart = this.modifiersSourceStart;
+ }
+ typeReference.bits |= ASTNode.HasTypeAnnotations;
+ typeReference.sourceStart = typeReferenceSourceStart;
+ }
+ pushOnGenericsStack(typeReference);
+ this.intPtr--;
+ if (this.modifiers != ClassFileConstants.AccDefault) {
+ problemReporter().invalidLocationForModifiers(typeReference);
+ }
+ resetModifiers();
+}
protected void consumeTypeArguments() {
concatGenericsLists();
this.intPtr--;
@@ -10367,6 +11588,7 @@
typeParameter.declarationSourceEnd = superType.sourceEnd;
typeParameter.type = superType;
superType.bits |= ASTNode.IsSuperType;
+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
this.genericsStack[this.genericsPtr] = typeParameter;
}
protected void consumeTypeParameter1WithExtendsAndBounds() {
@@ -10379,15 +11601,28 @@
TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd;
typeParameter.type = superType;
+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
superType.bits |= ASTNode.IsSuperType;
typeParameter.bounds = bounds;
for (int i = 0, max = bounds.length; i < max; i++) {
- bounds[i].bits |= ASTNode.IsSuperType;
+ TypeReference bound = bounds[i];
+ bound.bits |= ASTNode.IsSuperType;
+ typeParameter.bits |= (bound.bits & ASTNode.HasTypeAnnotations);
}
}
protected void consumeTypeParameterHeader() {
//TypeParameterHeader ::= Identifier
TypeParameter typeParameter = new TypeParameter();
+ int length;
+ if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
+ System.arraycopy(
+ this.typeAnnotationStack,
+ (this.typeAnnotationPtr -= length) + 1,
+ typeParameter.annotations = new Annotation[length],
+ 0,
+ length);
+ typeParameter.bits |= ASTNode.HasTypeAnnotations;
+ }
long pos = this.identifierPositionStack[this.identifierPtr];
final int end = (int) pos;
typeParameter.declarationSourceEnd = end;
@@ -10439,6 +11674,7 @@
TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
typeParameter.declarationSourceEnd = superType.sourceEnd;
typeParameter.type = superType;
+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
superType.bits |= ASTNode.IsSuperType;
}
//{ObjectTeams: <B base R>
@@ -10472,11 +11708,14 @@
TypeReference superType = getTypeReference(this.intStack[this.intPtr--]);
TypeParameter typeParameter = (TypeParameter) this.genericsStack[this.genericsPtr];
typeParameter.type = superType;
+ typeParameter.bits |= (superType.bits & ASTNode.HasTypeAnnotations);
superType.bits |= ASTNode.IsSuperType;
typeParameter.bounds = bounds;
typeParameter.declarationSourceEnd = bounds[additionalBoundsLength - 1].sourceEnd;
for (int i = 0, max = bounds.length; i < max; i++) {
- bounds[i].bits |= ASTNode.IsSuperType;
+ TypeReference bound = bounds[i];
+ bound.bits |= ASTNode.IsSuperType;
+ typeParameter.bits |= (bound.bits & ASTNode.HasTypeAnnotations);
}
}
protected void consumeUnaryExpression(int op) {
@@ -10731,12 +11970,18 @@
m.explicitDeclarations = c.explicitDeclarations;
m.returnType = null;
m.javadoc = c.javadoc;
+ m.bits = c.bits;
return m;
}
protected TypeReference copyDims(TypeReference typeRef, int dim) {
return typeRef.copyDims(dim);
}
+
+protected TypeReference copyDims(TypeReference typeRef, int dim, Annotation[][]annotationsOnDimensions) {
+ return typeRef.copyDims(dim, annotationsOnDimensions);
+}
+
protected FieldDeclaration createFieldDeclaration(char[] fieldDeclarationName, int sourceStart, int sourceEnd) {
return new FieldDeclaration(fieldDeclarationName, sourceStart, sourceEnd);
}
@@ -11336,13 +12581,35 @@
return ltr.baseReference; // don't surface illegal LTR
}
// SH}
+ TypeReference ref = getUnannotatedTypeReference(dim);
+ int length;
+ if (this.typeAnnotationLengthPtr >= 0
+ && (length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
+ // if ((length = this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr--]) != 0) {
+
+ System.arraycopy(
+ this.typeAnnotationStack,
+ (this.typeAnnotationPtr -= length) + 1,
+ ref.annotations = new Annotation[length],
+ 0,
+ length);
+ ref.sourceStart = ref.annotations[0].sourceStart;
+ ref.bits |= ASTNode.HasTypeAnnotations;
+ }
+ return ref;
+ }
+protected TypeReference getUnannotatedTypeReference(int dim) {
/* build a Reference on a variable that may be qualified or not
This variable is a type reference and dim will be its dimensions*/
TypeReference ref;
+ Annotation [][] annotationsOnDimensions = null;
int length = this.identifierLengthStack[this.identifierLengthPtr--];
if (length < 0) { //flag for precompiled type reference on base types
- ref = TypeReference.baseTypeReference(-length, dim);
+ if (dim > 0) {
+ annotationsOnDimensions = getAnnotationsOnDimensions(dim);
+ }
+ ref = TypeReference.baseTypeReference(-length, dim, annotationsOnDimensions);
ref.sourceStart = this.intStack[this.intPtr--];
if (dim == 0) {
ref.sourceEnd = this.intStack[this.intPtr--];
@@ -11364,12 +12631,17 @@
this.identifierStack[this.identifierPtr],
this.identifierPositionStack[this.identifierPtr--]);
} else {
+ annotationsOnDimensions = getAnnotationsOnDimensions(dim);
ref =
new ArrayTypeReference(
this.identifierStack[this.identifierPtr],
dim,
+ annotationsOnDimensions,
this.identifierPositionStack[this.identifierPtr--]);
ref.sourceEnd = this.endPosition;
+ if (annotationsOnDimensions != null) {
+ ref.bits |= ASTNode.HasTypeAnnotations;
+ }
}
} else {
this.genericsLengthPtr--;
@@ -11387,8 +12659,10 @@
if (dim == 0) {
ref = new QualifiedTypeReference(tokens, positions);
} else {
- ref = new ArrayQualifiedTypeReference(tokens, dim, positions);
+ annotationsOnDimensions = getAnnotationsOnDimensions(dim);
+ ref = new ArrayQualifiedTypeReference(tokens, dim, annotationsOnDimensions, positions);
ref.sourceEnd = this.endPosition;
+ ref.bits |= ASTNode.HasTypeAnnotations;
}
}
}
@@ -11411,6 +12685,7 @@
}
//SH}
protected TypeReference getTypeReferenceForGenericType(int dim, int identifierLength, int numberOfIdentifiers) {
+ Annotation[][] annotationsOnDimensions = dim == 0 ? null : getAnnotationsOnDimensions(dim);
if (identifierLength == 1 && numberOfIdentifiers == 1) {
int currentTypeArgumentsLength = this.genericsLengthStack[this.genericsLengthPtr--];
TypeReference[] typeArguments = null;
@@ -11421,7 +12696,7 @@
this.genericsPtr -= currentTypeArgumentsLength;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, typeArguments, 0, currentTypeArgumentsLength);
}
- ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.identifierStack[this.identifierPtr], typeArguments, dim, this.identifierPositionStack[this.identifierPtr--]);
+ ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference(this.identifierStack[this.identifierPtr], typeArguments, dim, annotationsOnDimensions, this.identifierPositionStack[this.identifierPtr--]);
if (dim != 0) {
parameterizedSingleTypeReference.sourceEnd = this.endStatementPosition;
}
@@ -11463,7 +12738,7 @@
currentIdentifiersLength = this.identifierLengthStack[this.identifierLengthPtr--];
}
}
- ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, positions);
+ ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference(tokens, typeArguments, dim, annotationsOnDimensions, positions);
if (dim != 0) {
parameterizedQualifiedTypeReference.sourceEnd = this.endStatementPosition;
}
@@ -11724,6 +12999,9 @@
this.astLengthPtr = -1;
this.expressionPtr = -1;
this.expressionLengthPtr = -1;
+ this.unattachedAnnotationPtr = -1;
+ this.typeAnnotationLengthPtr = -1;
+ this.typeAnnotationPtr = -1;
this.identifierPtr = -1;
this.identifierLengthPtr = -1;
this.intPtr = -1;
@@ -11734,6 +13012,7 @@
this.compilationUnit = null;
this.referenceContext = null;
this.endStatementPosition = 0;
+ this.valueLambdaNestDepth = -1;
//remove objects from stack too, while the same parser/compiler couple is
//re-used between two compilations ....
@@ -12062,6 +13341,81 @@
this.astLengthStack[--this.astLengthPtr]++;
}
+private boolean parserAtConflictScenario(int lastAction, int token) {
+
+ /* Answer true if the parser is at a configuration where the scanner must look ahead and help disambiguate between (a) '<' as an operator and '<' as the
+ start of <type argument> and (b) the use of '(' in '(' expression ')' and '( type ')' and '(' lambda formal parameters ')'. When requested thus,
+ the scanner helps by fabricating synthetic tokens and injecting them into the stream ahead of the tokens that trigger conflicts in the absence
+ of these artificial tokens. These manufactured token help transform the grammar into LALR(1) by splitting the states so that they have unambigious
+ prefixes.
+
+ We do this by claiming to the automaton that the next token seen is the (suitable) synthetic token and observing the response of the state machine.
+ Error signals we are NOT at a conflict site, while shift or shift/reduce signals that we are. Accept is impossible, while there may be intermediate
+ reductions that are called for -- It is axiomatic of the push down automaton that corresponds to the LALR grammar that it will never shift on invalid
+ input.
+
+ Obviously, the dry runs should not alter the parser state in any way or otherwise cause side effects. Proof by argument that this is the case:
+
+ - The only pieces of state needed to answer the question are: this.stack, this.stateStackTop and the last action variable `act`. None of the various
+ and sundry stacks used in the AST constructions process are touched here.
+ - As we reduce, we DON'T call the semantic action functions i.e the consume* method calls are skipped.
+ - Lexer stream is left untouched.
+ - this.stateStackTop and the last action variable `act` of the automaton are readily cloned, these being primitives and changes are to the replicas.
+ - We never remove elements from the state stack here (or elsewhere for that matter). Pops are implemented by mere adjustments of the stack pointer.
+ - During this algorithm, either the stack pointer monotonically decreases or stays fixed. (The only way for the stack pointer to increase would call
+ for a shift or a shift/reduce at which point the algorithm is ready to terminate already.) This means that we don't have to replicate the stack.
+ Pushes can be mimiced by writing to a local stackTopState variable, leaving the original stack untouched.
+
+ Though this code looks complex, we should exit early in most situations.
+ */
+
+ int stackTop = this.stateStackTop; // local copy of stack pointer
+ int stackTopState = this.stack[stackTop]; // single cell non write through "alternate stack" - the automaton's stack pointer either stays fixed during this manoeuvre or monotonically decreases.
+ int highWaterMark = stackTop;
+
+ token = token == TokenNameLPAREN ? TokenNameBeginLambda : TokenNameBeginTypeArguments;
+
+ // A rotated version of the automaton - cf. parse()'s for(;;)
+ for (;;) {
+ if (lastAction > ERROR_ACTION) { /* shift-reduce on loop entry from above, reduce on loop back */
+ lastAction -= ERROR_ACTION;
+ do { /* reduce */
+ stackTop -= rhs[lastAction] - 1;
+ if (stackTop < highWaterMark) {
+ stackTopState = this.stack[highWaterMark = stackTop];
+ } // else stackTopState is upto date already.
+ lastAction = ntAction(stackTopState, lhs[lastAction]);
+ } while (lastAction <= NUM_RULES);
+ }
+ highWaterMark = ++stackTop;
+ stackTopState = lastAction; // "push"
+ lastAction = tAction(lastAction, token); // can be looked up from a precomputed cache.
+ if (lastAction <= NUM_RULES) {
+ stackTop --;
+ lastAction += ERROR_ACTION;
+ continue;
+ }
+ // Error => false, Shift, Shift/Reduce => true, Accept => impossible.
+ return lastAction != ERROR_ACTION;
+ }
+}
+protected int getNextToken (int lastAction) throws InvalidInputException {
+ int token = this.scanner.getNextToken();
+ if (this.parsingJava8Plus) {
+ if (token == TokenNameLPAREN || token == TokenNameLESS) {
+ if (parserAtConflictScenario(lastAction, token)) { // Ask the lexer to double check if we at a lambda expression or a method/ctor reference expression ...
+ this.scanner.shouldDisambiguate = true;
+ try {
+ this.scanner.ungetToken(token);
+ token = this.scanner.getNextToken(); // Rescan
+ } finally {
+ this.scanner.shouldDisambiguate = false;
+ }
+ }
+ }
+ }
+ return token;
+}
/*main loop of the automat
When a rule is reduced, the method consumeRule(int) is called with the number
of the consumed rule. When a terminal is consumed, the method consumeToken(int) is
@@ -12139,7 +13493,7 @@
this.recordStringLiterals = oldValue;
}
try {
- this.currentToken = this.scanner.getNextToken();
+ this.currentToken = getNextToken(act);
} catch(InvalidInputException e){
if (!this.hasReportedError){
problemReporter().scannerError(this, e.getMessage());
@@ -12168,7 +13522,7 @@
this.recordStringLiterals = oldValue;
}
try{
- this.currentToken = this.scanner.getNextToken();
+ this.currentToken = getNextToken(act);
} catch(InvalidInputException e){
if (!this.hasReportedError){
problemReporter().scannerError(this, e.getMessage());
@@ -12196,8 +13550,8 @@
System.out.println(name[non_terminal_index[lhs[act]]]);
}
- consumeRule(act);
this.stateStackTop -= (rhs[act] - 1);
+ consumeRule(act);
act = ntAction(this.stack[this.stateStackTop], lhs[act]);
if (DEBUG_AUTOMATON) {
@@ -13129,6 +14483,37 @@
}
this.astLengthStack[this.astLengthPtr] = 1;
}
+protected void pushOnTypeAnnotationStack(Annotation annotation) {
+
+ int stackLength = this.typeAnnotationStack.length;
+ if (++this.typeAnnotationPtr >= stackLength) {
+ System.arraycopy(
+ this.typeAnnotationStack, 0,
+ this.typeAnnotationStack = new Annotation[stackLength + TypeAnnotationStackIncrement], 0,
+ stackLength);
+ }
+ this.typeAnnotationStack[this.typeAnnotationPtr] = annotation;
+
+ stackLength = this.typeAnnotationLengthStack.length;
+ if (++this.typeAnnotationLengthPtr >= stackLength) {
+ System.arraycopy(
+ this.typeAnnotationLengthStack, 0,
+ this.typeAnnotationLengthStack = new int[stackLength + TypeAnnotationStackIncrement], 0,
+ stackLength);
+ }
+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr] = 1;
+}
+protected void pushOnTypeAnnotationLengthStack(int pos) {
+
+ int stackLength = this.typeAnnotationLengthStack.length;
+ if (++this.typeAnnotationLengthPtr >= stackLength) {
+ System.arraycopy(
+ this.typeAnnotationLengthStack, 0,
+ this.typeAnnotationLengthStack = new int[stackLength + TypeAnnotationStackIncrement], 0,
+ stackLength);
+ }
+ this.typeAnnotationLengthStack[this.typeAnnotationLengthPtr] = pos;
+}
protected void pushOnExpressionStack(Expression expr) {
int stackLength = this.expressionStack.length;
@@ -13656,6 +15041,9 @@
this.astLengthPtr = -1;
this.expressionPtr = -1;
this.expressionLengthPtr = -1;
+ this.unattachedAnnotationPtr = -1;
+ this.typeAnnotationLengthPtr = -1;
+ this.typeAnnotationPtr = -1;
this.identifierPtr = -1;
this.identifierLengthPtr = -1;
this.intPtr = -1;
@@ -13670,6 +15058,7 @@
this.genericsIdentifiersLengthPtr = -1;
this.genericsLengthPtr = -1;
this.genericsPtr = -1;
+ this.valueLambdaNestDepth = -1;
}
/*
* Reset context so as to resume to regular parse loop
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
index 2202c3c..3786ce1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java
@@ -4,7 +4,15 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -15,22 +23,22 @@
public interface ParserBasicInformation {
public final static int
- ERROR_SYMBOL = 129,
- MAX_NAME_LENGTH = 41,
- NUM_STATES = 1266,
+ ERROR_SYMBOL = 133,
+ MAX_NAME_LENGTH = 50,
+ NUM_STATES = 1391,
- NT_OFFSET = 129,
- SCOPE_UBOUND = 195,
- SCOPE_SIZE = 196,
- LA_STATE_OFFSET = 14988,
+ NT_OFFSET = 133,
+ SCOPE_UBOUND = 317,
+ SCOPE_SIZE = 318,
+ LA_STATE_OFFSET = 19245,
MAX_LA = 1,
- NUM_RULES = 886,
- NUM_TERMINALS = 129,
- NUM_NON_TERMINALS = 394,
- NUM_SYMBOLS = 523,
- START_STATE = 1043,
- EOFT_SYMBOL = 73,
- EOLT_SYMBOL = 73,
- ACCEPT_ACTION = 14987,
- ERROR_ACTION = 14988;
+ NUM_RULES = 978,
+ NUM_TERMINALS = 133,
+ NUM_NON_TERMINALS = 426,
+ NUM_SYMBOLS = 559,
+ START_STATE = 1212,
+ EOFT_SYMBOL = 72,
+ EOLT_SYMBOL = 72,
+ ACCEPT_ACTION = 19244,
+ ERROR_ACTION = 19245;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
index 3b6d4ff..8fe5d13 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveryScanner.java
@@ -1,9 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -137,7 +141,7 @@
this.data.removedTokenUsed[this.data.removedTokensPtr] = false;
}
- public int getNextToken() throws InvalidInputException {
+ protected int getNextToken0() throws InvalidInputException {
if(this.pendingTokensPtr > -1) {
int nextToken = this.pendingTokens[this.pendingTokensPtr--];
if(nextToken == TerminalTokens.TokenNameIdentifier){
@@ -173,7 +177,7 @@
}
int previousLocation = this.currentPosition;
- int currentToken = super.getNextToken();
+ int currentToken = super.getNextToken0();
if(this.data.replacedTokens != null) {
for (int i = 0; i <= this.data.replacedTokensPtr; i++) {
@@ -204,7 +208,7 @@
this.data.removedTokenUsed[i] = true;
this.currentPosition = this.data.removedTokensEnd[i] + 1;
this.precededByRemoved = false;
- return getNextToken();
+ return getNextToken0();
}
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
index 096b59a..f0a3979 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java
@@ -1,9 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -305,6 +309,11 @@
newEntry5 = 0,
newEntry6 = 0;
public boolean insideRecovery = false;
+ private int nextToken = TokenNameNotAToken; // allows for one token push back, only the most recent token can be reliably ungotten.
+ private final boolean scanningJava8Plus;
+ public boolean shouldDisambiguate; // feedback from parser about need to disambiguate -- to lookahead only when absolutely necessary.
+ public boolean disambiguatedAlready;
+ public boolean scanningHeadOfReferenceExpression = false;
public static final int RoundBracket = 0;
public static final int SquareBracket = 1;
@@ -316,6 +325,7 @@
public static final int HIGH_SURROGATE_MIN_VALUE = 0xD800;
public static final int HIGH_SURROGATE_MAX_VALUE = 0xDBFF;
public static final int LOW_SURROGATE_MAX_VALUE = 0xDFFF;
+ private static final char[] blackListedTokens = new char [] { ';' };
public Scanner() {
this(false /*comment*/, false /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3 /*sourceLevel*/, null/*taskTag*/, null/*taskPriorities*/, true /*taskCaseSensitive*/);
@@ -335,6 +345,8 @@
this.tokenizeComments = tokenizeComments;
this.tokenizeWhiteSpace = tokenizeWhiteSpace;
this.sourceLevel = sourceLevel;
+ this.scanningJava8Plus = sourceLevel >= ClassFileConstants.JDK1_8;
+ this.nextToken = TokenNameNotAToken;
this.complianceLevel = complianceLevel;
this.checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals;
if (taskTags != null) {
@@ -1238,7 +1250,47 @@
return TokenNameERROR;
}
}
+public void ungetToken(int token) {
+ if (this.nextToken != TokenNameNotAToken) {
+ throw new ArrayIndexOutOfBoundsException("Single cell array overflow"); //$NON-NLS-1$
+ }
+ this.nextToken = token;
+}
+
public int getNextToken() throws InvalidInputException {
+ int token;
+ if (this.nextToken != TokenNameNotAToken) {
+ token = this.nextToken;
+ this.nextToken = TokenNameNotAToken;
+ } else {
+ token = getNextToken0();
+ }
+ if (token == TokenNameCOLON_COLON) {
+ this.scanningHeadOfReferenceExpression = false;
+ }
+ if (this.disambiguatedAlready) {
+ this.disambiguatedAlready = false;
+ return token;
+ }
+ if (this.scanningJava8Plus && this.shouldDisambiguate) {
+ if (token == TokenNameLPAREN) {
+ if(atLambdaParameterList()) {
+ this.nextToken = token;
+ this.disambiguatedAlready = true;
+ return TokenNameBeginLambda;
+ }
+ } else if (token == TokenNameLESS && !this.scanningHeadOfReferenceExpression) {
+ if (atReferenceExpression()) {
+ this.nextToken = token;
+ this.disambiguatedAlready = true;
+ this.scanningHeadOfReferenceExpression = true;
+ return TokenNameBeginTypeArguments;
+ }
+ }
+ }
+ return token;
+}
+protected int getNextToken0() throws InvalidInputException {
//{ObjectTeams: support '.' 'team':
if (this._dotSeen > 0)
this._dotSeen--; // "aging"
@@ -1392,13 +1444,15 @@
return TokenNameMINUS_MINUS;
if (test > 0)
return TokenNameMINUS_EQUAL;
-//{ObjectTeams: check for callout binding after '-' tokens
- else {
- if (test < 0 && this._isOTSource)
- if (getNextChar('>')) {
- this._calloutSeen = true;
- return TokenNameBINDOUT;
- }
+//{ObjectTeams: set _calloutSeen?
+/* orig:
+ if (getNextChar('>'))
+ return TokenNameARROW;
+ :giro */
+ if (getNextChar('>')) {
+ if (this._isOTSource)
+ this._calloutSeen = true;
+ return TokenNameARROW;
}
// Markus Witte}
return TokenNameMINUS;
@@ -1502,6 +1556,8 @@
case '?' :
return TokenNameQUESTION;
case ':' :
+ if (getNextChar(':'))
+ return TokenNameCOLON_COLON;
return TokenNameCOLON;
case '\'' :
{
@@ -2773,6 +2829,363 @@
return;
}
// SH}
+private void jumpOver(char open, char close, char [] blackList) throws InvalidInputException {
+ // Lifted from jumpOverMethodBody() and simplified and minimized side effects. Caller should still save and restore cursor.
+ int found = 1;
+ boolean whiteSpace;
+ int blackListLength = blackList == null ? 0 : blackList.length;
+ while (true) {
+ do {
+ this.startPosition = this.currentPosition;
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ && (this.source[this.currentPosition] == 'u')) {
+ whiteSpace = jumpOverUnicodeWhiteSpace();
+ } else {
+ whiteSpace = CharOperation.isWhitespace(this.currentCharacter);
+ }
+ } while (whiteSpace);
+
+ char c = this.currentCharacter;
+ for (int i = 0; i < blackListLength; i++) {
+ if (blackList[i] == c)
+ return;
+ }
+
+ // -------consume token until close is found
+ NextToken: switch (c) {
+ case '(' :
+ if (open == '(') {
+ found++;
+ }
+ break NextToken;
+ case ')' :
+ if (close == ')') {
+ found--;
+ if (found == 0) {
+ return;
+ }
+ }
+ break NextToken;
+ case '<' :
+ if (open == '<') {
+ found++;
+ }
+ break NextToken;
+ case '>' :
+ if (close == '>') {
+ found--;
+ if (found == 0) {
+ return;
+ }
+ }
+ break NextToken;
+ case '\'' : // can show up in annotations ...
+ int test;
+ if ((test = getNextChar('\n', '\r')) >= 0 || getNextChar('\'')) {
+ throw new InvalidInputException(INVALID_CHARACTER_CONSTANT);
+ }
+ if (getNextChar('\\')) {
+ if (this.unicodeAsBackSlash) {
+ this.unicodeAsBackSlash = false;
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') && (this.source[this.currentPosition] == 'u')) {
+ getNextUnicodeChar();
+ }
+ } else {
+ this.currentCharacter = this.source[this.currentPosition++];
+ }
+ scanEscapeCharacter();
+ } else { // consume next character
+ this.unicodeAsBackSlash = false;
+ if ((this.currentCharacter = this.source[this.currentPosition++]) == '\\' && this.source[this.currentPosition] == 'u') {
+ getNextUnicodeChar();
+ }
+ }
+ if (getNextChar('\''))
+ break NextToken;
+ throw new InvalidInputException(INVALID_CHARACTER_CONSTANT);
+ case '"' : // can show up in annotations ...
+ this.unicodeAsBackSlash = false;
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ && (this.source[this.currentPosition] == 'u')) {
+ getNextUnicodeChar();
+ }
+ while (this.currentCharacter != '"') {
+ if (this.currentCharacter == '\n' || this.currentCharacter == '\r') {
+ throw new InvalidInputException(INVALID_CHAR_IN_STRING);
+ }
+ if (this.currentCharacter == '\\') {
+ if (this.unicodeAsBackSlash) {
+ this.unicodeAsBackSlash = false;
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') && (this.source[this.currentPosition] == 'u')) {
+ getNextUnicodeChar();
+ }
+ } else {
+ this.currentCharacter = this.source[this.currentPosition++];
+ }
+ scanEscapeCharacter();
+ }
+ this.unicodeAsBackSlash = false;
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ && (this.source[this.currentPosition] == 'u')) {
+ getNextUnicodeChar();
+ }
+ }
+ break NextToken;
+ case '/' :
+ {
+ if ((test = getNextChar('/', '*')) == 0) { // line comment
+ do {
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ && (this.source[this.currentPosition] == 'u')) {
+ getNextUnicodeChar();
+ }
+ // handle the \\u case manually into comment
+ if (this.currentCharacter == '\\') {
+ if (this.source[this.currentPosition] == '\\')
+ this.currentPosition++;
+ }
+ } while (this.currentCharacter != '\r' && this.currentCharacter != '\n');
+ // completely consume the line break
+ if (this.currentCharacter == '\r') {
+ if (this.source[this.currentPosition] == '\n') {
+ this.currentPosition++;
+ this.currentCharacter = '\n';
+ } else if ((this.source[this.currentPosition] == '\\')
+ && (this.source[this.currentPosition + 1] == 'u')) {
+ getNextUnicodeChar();
+ }
+ }
+ break NextToken;
+ }
+ if (test > 0) { // /**/ && /***/
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ && (this.source[this.currentPosition] == 'u')) {
+ getNextUnicodeChar();
+ }
+ boolean star;
+ do {
+ star = this.currentCharacter == '*';
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ && (this.source[this.currentPosition] == 'u')) {
+ getNextUnicodeChar();
+ }
+ // handle the \\u case manually into comment
+ if (this.currentCharacter == '\\') {
+ if (this.source[this.currentPosition] == '\\')
+ this.currentPosition++;
+ }
+ } while ((this.currentCharacter != '/') || (!star));
+ }
+ break NextToken;
+ }
+ default :
+ if (c < ScannerHelper.MAX_OBVIOUS) {
+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_IDENT_START) != 0) {
+ scanIdentifierOrKeyword();
+ break NextToken;
+ } else if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_DIGIT) != 0) {
+ scanNumber(false); // can occur in annotations.
+ break NextToken;
+ } else {
+ break NextToken;
+ }
+ }
+ boolean isJavaIdStart;
+ if (c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE) {
+ // Unicode 4 detection
+ char low = (char) getNextChar();
+ if (low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE) {
+ // illegal low surrogate
+ break NextToken;
+ }
+ isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c, low);
+ } else if (c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE) {
+ break NextToken;
+ } else {
+ // optimized case already checked
+ isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c);
+ }
+ if (isJavaIdStart) {
+ scanIdentifierOrKeyword();
+ }
+ break NextToken;
+ }
+ }
+}
+private final boolean atLambdaParameterList() {
+
+ /* The cursor is just past '(' and the parser is parsing a primary expression. Look ahead and answer true
+ if we are at the head of a lambda parameter list and false otherwise.
+ */
+
+ int savedCurrentPosition = this.currentPosition;
+ int savedStartPosition = this.startPosition;
+ char savedCurrentCharacter = this.currentCharacter;
+ char[] savedWithoutUnicodeBuffer = null;
+ int savedWithoutUnicodePtr = this.withoutUnicodePtr;
+ if (savedWithoutUnicodePtr != 0) {
+ int length = this.withoutUnicodeBuffer.length;
+ System.arraycopy(this.withoutUnicodeBuffer, 0, savedWithoutUnicodeBuffer = new char [length], 0, length);
+ }
+
+ boolean atLambda = false;
+
+ try {
+ try {
+ jumpOver('(', ')', blackListedTokens);
+ } finally {
+ if (this.currentCharacter == ')') {
+ boolean whiteSpace;
+ do {
+ this.startPosition = this.currentPosition;
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\') && (this.source[this.currentPosition] == 'u')) {
+ whiteSpace = jumpOverUnicodeWhiteSpace();
+ } else {
+ whiteSpace = CharOperation.isWhitespace(this.currentCharacter);
+ }
+ } while (whiteSpace);
+ atLambda = this.currentCharacter == '-' && getNextChar('>');
+ }
+ }
+ } catch (Exception e) {
+ // ignore
+ } finally {
+ // Restore status quo ante and return suitable value.
+ this.currentPosition = savedCurrentPosition;
+ this.startPosition = savedStartPosition;
+ this.currentCharacter = savedCurrentCharacter;
+ this.withoutUnicodePtr = savedWithoutUnicodePtr;
+ if (savedWithoutUnicodePtr != 0) {
+ System.arraycopy(savedWithoutUnicodeBuffer, 0, this.withoutUnicodeBuffer, 0, savedWithoutUnicodeBuffer.length);
+ }
+
+ }
+ return atLambda;
+}
+private final boolean atReferenceExpression() {
+
+ /* The cursor is at a '<' that figures just past the non terminal symbol `Name' and the parser is parsing a primary expression.
+ Look ahead and answer true if we are at a method or constructor reference expression and false otherwise.
+
+ ReferenceExpression ::= Name OnlyTypeArgumentsForReferenceExpression Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
+ ReferenceExpression ::= Name OnlyTypeArgumentsForReferenceExpression '.' ClassOrInterfaceType Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
+
+ Note: At this point, we don't handle annotations on dimensions, I think it is illegal, but needs to be verified.
+ */
+
+ int savedCurrentPosition = this.currentPosition;
+ int savedStartPosition = this.startPosition;
+ char savedCurrentCharacter = this.currentCharacter;
+ char[] savedWithoutUnicodeBuffer = null;
+ int savedWithoutUnicodePtr = this.withoutUnicodePtr;
+ if (savedWithoutUnicodePtr != 0) {
+ int length = this.withoutUnicodeBuffer.length;
+ System.arraycopy(this.withoutUnicodeBuffer, 0, savedWithoutUnicodeBuffer = new char [length], 0, length);
+ }
+
+ boolean atReferenceExpression = false;
+ boolean whiteSpace;
+
+ boolean justPastIdentifier = true, justPastDot = false, justPastTypeArguments = false;
+ char c = '<';
+
+ try {
+ done:
+ while (true) {
+ NextToken: switch (c) {
+ case '[' :
+ case ']' :
+ break NextToken; // good enough for now.
+ case '<' :
+ if (justPastIdentifier) {
+ jumpOver('<' , '>', blackListedTokens);
+ if (this.currentCharacter != '>')
+ throw new InvalidInputException();
+ justPastIdentifier = false;
+ justPastTypeArguments = true;
+ justPastDot = false;
+ break NextToken;
+ }
+ throw new InvalidInputException();
+ case '.' :
+ if (justPastIdentifier || justPastTypeArguments) {
+ justPastIdentifier = false;
+ justPastTypeArguments = false;
+ justPastDot = true;
+ break NextToken;
+ }
+ throw new InvalidInputException();
+ case ':' :
+ if (justPastIdentifier || justPastTypeArguments) {
+ if (getNextChar(':')) {
+ atReferenceExpression = true;
+ break done;
+ }
+ }
+ throw new InvalidInputException();
+ default:
+ if (!justPastDot) {
+ throw new InvalidInputException();
+ }
+ if (c < ScannerHelper.MAX_OBVIOUS) {
+ if ((ScannerHelper.OBVIOUS_IDENT_CHAR_NATURES[c] & ScannerHelper.C_IDENT_START) != 0) {
+ scanIdentifierOrKeyword();
+ justPastDot = false;
+ justPastIdentifier = true;
+ justPastTypeArguments = false;
+ break NextToken;
+ }
+ throw new InvalidInputException();
+ }
+ boolean isJavaIdStart;
+ if (c >= HIGH_SURROGATE_MIN_VALUE && c <= HIGH_SURROGATE_MAX_VALUE) {
+ // Unicode 4 detection
+ char low = (char) getNextChar();
+ if (low < LOW_SURROGATE_MIN_VALUE || low > LOW_SURROGATE_MAX_VALUE) {
+ // illegal low surrogate
+ throw new InvalidInputException();
+ }
+ isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c, low);
+ } else if (c >= LOW_SURROGATE_MIN_VALUE && c <= LOW_SURROGATE_MAX_VALUE) {
+ throw new InvalidInputException();
+ } else {
+ // optimized case already checked
+ isJavaIdStart = ScannerHelper.isJavaIdentifierStart(this.complianceLevel, c);
+ }
+ if (isJavaIdStart) {
+ scanIdentifierOrKeyword();
+ justPastDot = false;
+ justPastIdentifier = true;
+ justPastTypeArguments = false;
+ break NextToken;
+ }
+ throw new InvalidInputException();
+ }
+ do { // skip past white space
+ this.startPosition = this.currentPosition;
+ if (((this.currentCharacter = this.source[this.currentPosition++]) == '\\')
+ && (this.source[this.currentPosition] == 'u')) {
+ whiteSpace = jumpOverUnicodeWhiteSpace();
+ } else {
+ whiteSpace = CharOperation.isWhitespace(this.currentCharacter);
+ }
+ } while (whiteSpace);
+ c = this.currentCharacter; //next non-white character, loop back to decide what to do.
+ }
+ } catch (Exception e) {
+ // ignore
+ } finally {
+ // Restore status quo ante and return suitable value.
+ this.currentPosition = savedCurrentPosition;
+ this.startPosition = savedStartPosition;
+ this.currentCharacter = savedCurrentCharacter;
+ this.withoutUnicodePtr = savedWithoutUnicodePtr;
+ if (savedWithoutUnicodePtr != 0) {
+ System.arraycopy(savedWithoutUnicodeBuffer, 0, this.withoutUnicodeBuffer, 0, savedWithoutUnicodeBuffer.length);
+ }
+ }
+ return atReferenceExpression;
+}
public final boolean jumpOverUnicodeWhiteSpace() throws InvalidInputException {
//BOOLEAN
@@ -3234,6 +3647,7 @@
}
this.commentPtr = -1; // reset comment stack
this.foundTaskCount = 0;
+ this.nextToken = TokenNameNotAToken;
}
protected final void scanEscapeCharacter() throws InvalidInputException {
@@ -4634,7 +5048,11 @@
if (middleLength > -1) {
buffer.append(this.source, this.startPosition, middleLength);
}
- buffer.append("<-- Ends here\n===============================\n"); //$NON-NLS-1$
+ if (this.nextToken != TerminalTokens.TokenNameNotAToken) {
+ buffer.append("<-- Ends here [in pipeline " + toStringAction(this.nextToken) + "]\n===============================\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ buffer.append("<-- Ends here\n===============================\n"); //$NON-NLS-1$
+ }
buffer.append(this.source, (this.currentPosition - 1) + 1, this.eofPosition - (this.currentPosition - 1) - 1);
@@ -4789,8 +5207,6 @@
//{ObjectTeams: deal with callins/callouts
case TokenNameBINDIN :
return "<-"; //$NON-NLS-1$
- case TokenNameBINDOUT :
- return "->"; //$NON-NLS-1$
case TokenNameCALLOUT_OVERRIDE :
return "=>"; //$NON-NLS-1$
// Markus Witte}
@@ -4810,6 +5226,8 @@
return "+="; //$NON-NLS-1$
case TokenNameMINUS_EQUAL :
return "-="; //$NON-NLS-1$
+ case TokenNameARROW :
+ return "->"; //$NON-NLS-1$
case TokenNameMULTIPLY_EQUAL :
return "*="; //$NON-NLS-1$
case TokenNameDIVIDE_EQUAL :
@@ -4874,6 +5292,8 @@
return "?"; //$NON-NLS-1$
case TokenNameCOLON :
return ":"; //$NON-NLS-1$
+ case TokenNameCOLON_COLON :
+ return "::"; //$NON-NLS-1$
case TokenNameCOMMA :
return ","; //$NON-NLS-1$
case TokenNameDOT :
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
index 8763eb5..3cef2a3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java
@@ -4,7 +4,16 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Technical University Berlin - extended API and implementation
@@ -29,140 +38,150 @@
public interface TerminalTokens {
// special tokens not part of grammar - not autogenerated
- int
+ int
+ TokenNameNotAToken = 0,
TokenNameWHITESPACE = 1000,
TokenNameCOMMENT_LINE = 1001,
TokenNameCOMMENT_BLOCK = 1002,
TokenNameCOMMENT_JAVADOC = 1003;
int
- TokenNameIdentifier = 22,
- TokenNameabstract = 60,
- TokenNameassert = 94,
+ TokenNameIdentifier = 14,
+ TokenNameabstract = 50,
+ TokenNameassert = 88,
TokenNameboolean = 33,
- TokenNamebreak = 95,
+ TokenNamebreak = 89,
TokenNamebyte = 34,
- TokenNamecase = 114,
- TokenNamecatch = 111,
+ TokenNamecase = 118,
+ TokenNamecatch = 115,
TokenNamechar = 35,
- TokenNameclass = 78,
- TokenNamecontinue = 96,
- TokenNameconst = 127,
- TokenNamedefault = 108,
- TokenNamedo = 97,
+ TokenNameclass = 81,
+ TokenNamecontinue = 90,
+ TokenNameconst = 131,
+ TokenNamedefault = 100,
+ TokenNamedo = 91,
TokenNamedouble = 36,
- TokenNameelse = 117,
- TokenNameenum = 105,
- TokenNameextends = 107,
- TokenNamefalse = 47,
- TokenNamefinal = 61,
- TokenNamefinally = 115,
+ TokenNameelse = 121,
+ TokenNameenum = 99,
+ TokenNameextends = 101,
+ TokenNamefalse = 62,
+ TokenNamefinal = 51,
+ TokenNamefinally = 119,
TokenNamefloat = 37,
- TokenNamefor = 98,
- TokenNamegoto = 128,
- TokenNameif = 99,
- TokenNameimplements = 125,
- TokenNameimport = 112,
- TokenNameinstanceof = 14,
+ TokenNamefor = 92,
+ TokenNamegoto = 132,
+ TokenNameif = 93,
+ TokenNameimplements = 128,
+ TokenNameimport = 116,
+ TokenNameinstanceof = 18,
TokenNameint = 38,
- TokenNameinterface = 80,
+ TokenNameinterface = 85,
TokenNamelong = 39,
- TokenNamenative = 62,
- TokenNamenew = 44,
- TokenNamenull = 48,
- TokenNamepackage = 113,
- TokenNameprivate = 63,
- TokenNameprotected = 64,
- TokenNamepublic = 65,
- TokenNamereturn = 100,
+ TokenNamenative = 52,
+ TokenNamenew = 46,
+ TokenNamenull = 63,
+ TokenNamepackage = 117,
+ TokenNameprivate = 53,
+ TokenNameprotected = 54,
+ TokenNamepublic = 55,
+ TokenNamereturn = 94,
TokenNameshort = 40,
- TokenNamestatic = 57,
- TokenNamestrictfp = 66,
- TokenNamesuper = 42,
- TokenNameswitch = 101,
- TokenNamesynchronized = 58,
- TokenNamethis = 43,
- TokenNamethrow = 102,
- TokenNamethrows = 118,
- TokenNametransient = 67,
- TokenNametrue = 49,
- TokenNametry = 103,
+ TokenNamestatic = 47,
+ TokenNamestrictfp = 56,
+ TokenNamesuper = 45,
+ TokenNameswitch = 95,
+ TokenNamesynchronized = 48,
+ TokenNamethis = 44,
+ TokenNamethrow = 96,
+ TokenNamethrows = 122,
+ TokenNametransient = 57,
+ TokenNametrue = 64,
+ TokenNametry = 97,
TokenNamevoid = 41,
- TokenNamevolatile = 68,
- TokenNamewhile = 81,
- TokenNameas = 82,
- TokenNamebase = 31,
- TokenNamecallin = 69,
- TokenNameplayedBy = 126,
- TokenNameprecedence = 116,
- TokenNamereadonly = 70,
- TokenNameteam = 59,
- TokenNametsuper = 46,
- TokenNamewhen = 109,
- TokenNamewith = 110,
- TokenNamewithin = 104,
- TokenNamereplace = 120,
- TokenNameafter = 119,
- TokenNamebefore = 121,
- TokenNameget = 122,
- TokenNameset = 123,
- TokenNameIntegerLiteral = 50,
- TokenNameLongLiteral = 51,
- TokenNameFloatingPointLiteral = 52,
- TokenNameDoubleLiteral = 53,
- TokenNameCharacterLiteral = 54,
- TokenNameStringLiteral = 55,
- TokenNamePLUS_PLUS = 9,
- TokenNameMINUS_MINUS = 10,
- TokenNameEQUAL_EQUAL = 18,
+ TokenNamevolatile = 58,
+ TokenNamewhile = 86,
+ TokenNameas = 129,
+ TokenNamebase = 42,
+ TokenNamecallin = 59,
+ TokenNameplayedBy = 130,
+ TokenNameprecedence = 120,
+ TokenNamereadonly = 60,
+ TokenNameteam = 49,
+ TokenNametsuper = 61,
+ TokenNamewhen = 102,
+ TokenNamewith = 114,
+ TokenNamewithin = 98,
+ TokenNamereplace = 124,
+ TokenNameafter = 123,
+ TokenNamebefore = 125,
+ TokenNameget = 126,
+ TokenNameset = 127,
+ TokenNameIntegerLiteral = 65,
+ TokenNameLongLiteral = 66,
+ TokenNameFloatingPointLiteral = 67,
+ TokenNameDoubleLiteral = 68,
+ TokenNameCharacterLiteral = 69,
+ TokenNameStringLiteral = 70,
+ TokenNamePLUS_PLUS = 4,
+ TokenNameMINUS_MINUS = 5,
+ TokenNameEQUAL_EQUAL = 20,
TokenNameLESS_EQUAL = 15,
TokenNameGREATER_EQUAL = 16,
- TokenNameNOT_EQUAL = 19,
- TokenNameLEFT_SHIFT = 17,
- TokenNameRIGHT_SHIFT = 12,
- TokenNameUNSIGNED_RIGHT_SHIFT = 13,
- TokenNamePLUS_EQUAL = 83,
- TokenNameMINUS_EQUAL = 84,
- TokenNameMULTIPLY_EQUAL = 85,
- TokenNameDIVIDE_EQUAL = 86,
- TokenNameAND_EQUAL = 87,
- TokenNameOR_EQUAL = 88,
- TokenNameXOR_EQUAL = 89,
- TokenNameREMAINDER_EQUAL = 90,
- TokenNameLEFT_SHIFT_EQUAL = 91,
- TokenNameRIGHT_SHIFT_EQUAL = 92,
- TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 93,
- TokenNameOR_OR = 27,
- TokenNameAND_AND = 25,
+ TokenNameNOT_EQUAL = 21,
+ TokenNameLEFT_SHIFT = 19,
+ TokenNameRIGHT_SHIFT = 13,
+ TokenNameUNSIGNED_RIGHT_SHIFT = 17,
+ TokenNamePLUS_EQUAL = 103,
+ TokenNameMINUS_EQUAL = 104,
+ TokenNameMULTIPLY_EQUAL = 105,
+ TokenNameDIVIDE_EQUAL = 106,
+ TokenNameAND_EQUAL = 107,
+ TokenNameOR_EQUAL = 108,
+ TokenNameXOR_EQUAL = 109,
+ TokenNameREMAINDER_EQUAL = 110,
+ TokenNameLEFT_SHIFT_EQUAL = 111,
+ TokenNameRIGHT_SHIFT_EQUAL = 112,
+ TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 113,
+ TokenNameOR_OR = 31,
+ TokenNameAND_AND = 30,
TokenNamePLUS = 2,
TokenNameMINUS = 3,
- TokenNameNOT = 71,
- TokenNameREMAINDER = 6,
- TokenNameXOR = 21,
- TokenNameAND = 20,
- TokenNameMULTIPLY = 5,
- TokenNameOR = 23,
- TokenNameTWIDDLE = 72,
- TokenNameDIVIDE = 7,
- TokenNameGREATER = 11,
- TokenNameLESS = 4,
- TokenNameLPAREN = 26,
- TokenNameRPAREN = 28,
- TokenNameLBRACE = 74,
- TokenNameRBRACE = 32,
- TokenNameLBRACKET = 8,
- TokenNameRBRACKET = 76,
- TokenNameSEMICOLON = 29,
- TokenNameQUESTION = 24,
- TokenNameCOLON = 56,
- TokenNameCOMMA = 30,
+ TokenNameNOT = 73,
+ TokenNameREMAINDER = 10,
+ TokenNameXOR = 24,
+ TokenNameAND = 22,
+ TokenNameMULTIPLY = 9,
+ TokenNameOR = 27,
+ TokenNameTWIDDLE = 74,
+ TokenNameDIVIDE = 11,
+ TokenNameGREATER = 12,
+ TokenNameLESS = 7,
+ TokenNameLPAREN = 23,
+ TokenNameRPAREN = 25,
+ TokenNameLBRACE = 76,
+ TokenNameRBRACE = 43,
+ TokenNameLBRACKET = 6,
+ TokenNameRBRACKET = 77,
+ TokenNameSEMICOLON = 28,
+ TokenNameQUESTION = 29,
+ TokenNameCOLON = 75,
+ TokenNameCOMMA = 32,
TokenNameDOT = 1,
- TokenNameEQUAL = 77,
- TokenNameAT = 45,
- TokenNameELLIPSIS = 124,
- TokenNameBINDIN = 79,
- TokenNameBINDOUT = 75,
- TokenNameCALLOUT_OVERRIDE = 106,
- TokenNameEOF = 73,
- TokenNameERROR = 129;
+ TokenNameEQUAL = 83,
+ TokenNameAT = 26,
+ TokenNameELLIPSIS = 87,
+ TokenNameARROW = 79,
+ TokenNameCOLON_COLON = 8,
+ TokenNameBeginLambda = 71,
+ TokenNameBeginTypeArguments = 82,
+ TokenNameElidedSemicolonAndRightBrace = 80,
+ TokenNameBINDIN = 84,
+ TokenNameCALLOUT_OVERRIDE = 78,
+ TokenNameEOF = 72,
+ TokenNameERROR = 133;
+
+
+ // This alias is statically inserted by generateOTParser.sh:
+ int TokenNameBINDOUT = TokenNameARROW;
}
+
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
index 7cb5028..0ac434e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java
@@ -1,10 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: DiagnoseParser.java 19876 2009-04-13 19:39:46Z stephan $
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -14,10 +17,12 @@
package org.eclipse.jdt.internal.compiler.parser.diagnose;
import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.parser.Parser;
import org.eclipse.jdt.internal.compiler.parser.ParserBasicInformation;
import org.eclipse.jdt.internal.compiler.parser.RecoveryScanner;
+import org.eclipse.jdt.internal.compiler.parser.Scanner;
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
import org.eclipse.jdt.internal.compiler.parser.TerminalTokens;
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
@@ -205,6 +210,9 @@
oldRecord = this.recoveryScanner.record;
this.recoveryScanner.record = record;
}
+ if (this.options.sourceLevel >= ClassFileConstants.JDK1_8) {
+ this.parser.scanner.shouldDisambiguate = true;
+ }
try {
this.lexStream.reset();
@@ -448,6 +456,7 @@
if(this.recoveryScanner != null) {
this.recoveryScanner.record = oldRecord;
}
+ this.parser.scanner.shouldDisambiguate = false;
}
return;
}
@@ -815,9 +824,9 @@
}
}
- //
- // Next, try deletion of the error token.
- //
+ /* Next, try deletion of the error token, preferring deletion as a criteria in
+ case of identical, superfluous keyword tokens. See below.
+ */
j = parseCheck(
stck,
stack_top,
@@ -833,6 +842,25 @@
repair.misspellIndex = k;
repair.code = DELETION_CODE;
repair.distance = j;
+ } else if (j == repair.distance) {
+ /* Handle some cases where deletion as a repair strategy is obviously superior to
+ others. e.g: Object o = new new Object() {}; For some reason, with the new grammar
+ rules to support type annotations in place, the scopeTrial's choice above wins out
+ with the repair strategy being to insert a semicolon after the first new. That looks
+ very suspicious. It is not clear if that is due to the bug in the implementation of
+ scopeTrial or in the jikespg parser generator or in the grammar.
+
+ The current fix is a temporary point-fix to address this problem. It does make sense
+ as a rule, but is a bit ad-hoc in nature and the reason why scopeTrial succeeds needs
+ to be understood.
+ */
+ LexStream.Token previousToken = this.lexStream.token(repair.bufferPosition + 1);
+ LexStream.Token curToken = this.lexStream.token(repair.bufferPosition + 2);
+ if (previousToken != null && curToken != null && previousToken.kind == curToken.kind && Scanner.isKeyword(curToken.kind)) {
+ repair.misspellIndex = k;
+ repair.code = DELETION_CODE;
+ repair.distance = j;
+ }
}
//
@@ -2303,10 +2331,13 @@
addedTokens = new int[Parser.scope_rhs.length - Parser.scope_suffix[- nameIndex]];
}
+ int insertedToken = TokenNameNotAToken;
for (int i = Parser.scope_suffix[- nameIndex]; Parser.scope_rhs[i] != 0; i++) {
buf.append(Parser.readableName[Parser.scope_rhs[i]]);
if (Parser.scope_rhs[i + 1] != 0) // any more symbols to print?
buf.append(' ');
+ else
+ insertedToken = Parser.reverse_index[Parser.scope_rhs[i]];
if(addedTokens != null) {
int tmpAddedToken = Parser.reverse_index[Parser.scope_rhs[i]];
@@ -2345,6 +2376,13 @@
}
if (scopeNameIndex != 0) {
+ if (insertedToken == TokenNameElidedSemicolonAndRightBrace) {
+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=383046, we should never ever report the diagnostic, "Syntax error, insert ElidedSemicolonAndRightBraceto complete LambdaBody"
+ as it is a synthetic token. Instead we should simply repair and move on. See how the regular Parser behaves at Parser.consumeElidedLeftBraceAndReturn and Parser.consumeExpression.
+ See also: point (4) in https://bugs.eclipse.org/bugs/show_bug.cgi?id=380194#c15
+ */
+ break;
+ }
if(this.reportProblem) problemReporter().parseErrorInsertToComplete(
errorStart,
errorEnd,
@@ -2479,12 +2517,14 @@
if(this.recoveryScanner != null) {
addedTokens = new int[Parser.scope_rhs.length - Parser.scope_suffix[- nameIndex]];
}
-
+ int insertedToken = TokenNameNotAToken;
for (int i = Parser.scope_suffix[- nameIndex]; Parser.scope_rhs[i] != 0; i++) {
buf.append(Parser.readableName[Parser.scope_rhs[i]]);
if (Parser.scope_rhs[i+1] != 0)
buf.append(' ');
+ else
+ insertedToken = Parser.reverse_index[Parser.scope_rhs[i]];
if(addedTokens != null) {
int tmpAddedToken = Parser.reverse_index[Parser.scope_rhs[i]];
@@ -2520,6 +2560,13 @@
this.recoveryScanner.insertTokens(addedTokens, completedToken, errorEnd);
}
if (scopeNameIndex != 0) {
+ if (insertedToken == TokenNameElidedSemicolonAndRightBrace) {
+ /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=383046, we should never ever report the diagnostic, "Syntax error, insert ElidedSemicolonAndRightBraceto complete LambdaBody"
+ as it is a synthetic token. Instead we should simply repair and move on. See how the regular Parser behaves at Parser.consumeElidedLeftBraceAndReturn and Parser.consumeExpression.
+ See also: point (4) in https://bugs.eclipse.org/bugs/show_bug.cgi?id=380194#c15
+ */
+ break;
+ }
if(this.reportProblem) problemReporter().parseErrorInsertToComplete(
errorStart,
errorEnd,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
index 4e45450..aeb7813 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
index 12cb2fb..3173ec6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
index 7945cf3..9deda02 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
index f817012..fe10dfd 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
index d46f8d7..91aeefb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
index 2eb1023..a5c3cb9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
index fdb5c0b..aab060e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
index d433604..d40d278 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
index c36d2da..7e256af 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
index eab2c90..2cebf4a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
index f87b950..e2fcc95 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
index 1cd9bf0..6d11936 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc
index eadb7d2..f3aafc8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc
index 7e2dda7..4d6f8fe 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
index 8a02157..ed924b4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
index 636ffd2..ca2df98 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc
index da4cf44..9fb0330 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
index b6d844e..b1d7e27 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
index dc471b6..87fd6f0 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
index 9fbed24..d3301a4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
index 8a682b4..f4d4ef4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
index dbc7e9c..5601a41 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
index 5178a98..af9c707 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
index d2f1bc1..2d03d39 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props
index cc0035b..f3eeb17 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props
@@ -1,13 +1,3 @@
-###############################################################################
-# Copyright (c) 2012 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
,opt=,
;opt=;
AbstractMethodDeclaration=MethodDeclaration
@@ -33,6 +23,7 @@
AnnotationTypeMemberDeclaration=AnnotationTypeMemberDeclaration
AnnotationTypeMemberDeclarations=AnnotationTypeMemberDeclarations
AnnotationTypeMemberDeclarationsopt=AnnotationTypeMemberDeclarations
+Annotationsopt=Annotationsopt
ArgumentList=ArgumentList
ArgumentListopt=ArgumentList
Arguments=Arguments
@@ -42,7 +33,6 @@
ArrayCreationWithArrayInitializer=ArrayCreationWithArrayInitializer
ArrayCreationWithoutArrayInitializer=ArrayCreationWithoutArrayInitializer
ArrayInitializer=ArrayInitializer
-ArrayLiftingType=ArrayLiftingType
ArrayType=ArrayType
ArrayTypeWithTypeArgumentsName=ArrayTypeWithTypeArgumentsName
AssertStatement=AssertStatement
@@ -111,7 +101,9 @@
ClassInstanceCreationExpression=ClassInstanceCreationExpression
ClassInstanceCreationExpressionName=ClassInstanceCreationExpressionName
ClassMemberDeclaration=ClassMemberDeclaration
+ClassOrInterface0=Type
ClassOrInterface=Type
+ClassOrInterfaceType0=Type
ClassOrInterfaceType=Type
ClassType=ClassType
ClassTypeElt=ClassType
@@ -135,9 +127,12 @@
DimWithOrWithOutExpr=Dimension
DimWithOrWithOutExprs=Dimensions
Dims=Dimensions
+DimsAnnotLoop=DimsAnnotLoop
DimsLoop=Dimensions
Dimsopt=Dimensions
+DimsoptAnnotsopt=AnnotationsDimensionsSequence
DoStatement=DoStatement
+ElidedLeftBraceAndReturn=ElidedLeftBraceAndReturn
EmptyStatement=EmptyStatement
EnhancedForStatement=EnhancedForStatement
EnhancedForStatementHeader=EnhancedForStatementHeader
@@ -168,6 +163,7 @@
ExitVariableWithoutInitialization=ExitVariableWithoutInitialization
ExplicitConstructorInvocation=ExplicitConstructorInvocation
Expression=Expression
+ExpressionNoLambda=Expression
ExpressionStatement=Statement
Expression_NotName=Expression
Expressionopt=Expression
@@ -188,10 +184,12 @@
FormalParameterListopt=FormalParameterList
GenericMethodDeclaration=GenericMethodDeclaration
GenericType=GenericType
+GenericTypeDotName=GenericTypeDotName
Goal=Goal
Header1=Header1
Header2=Header2
Header=Header
+IdentifierOrNew=IdentifierOrNew
IfThenElseStatement=IfStatement
IfThenElseStatementNoShortIf=IfStatement
IfThenStatement=IfStatement
@@ -203,6 +201,7 @@
Initializer=Initializer
InsideCastExpression=InsideCastExpression
InsideCastExpressionLL1=InsideCastExpression
+InsideCastExpressionWithAnnotatedQualifiedGenerics=InsideCastExpression
InsideCastExpressionWithQualifiedGenerics=InsideCastExpression
InstanceofExpression=Expression
InstanceofExpression_NotName=Expression
@@ -224,12 +223,14 @@
InvalidCallinBinding=InvalidCallinBinding
InvalidCallinModifier=InvalidCallinModifier
InvalidConstructorDeclaration=InvalidConstructorDeclaration
-InvalidDeclaredArrayLifting=InvalidDeclaredArrayLifting
InvalidInitializer=InvalidInitializer
Label=Label
LabeledStatement=LabeledStatement
LabeledStatementNoShortIf=LabeledStatement
-LiftingType=LiftingType
+LambdaBody=LambdaBody
+LambdaExpression=LambdaExpression
+LambdaParameters=TypeElidedFormalParameter
+LiftingTypeopt=LiftingType
Literal=Literal
LocalVariableDeclaration=LocalVariableDeclaration
LocalVariableDeclarationStatement=LocalVariableDeclarationStatement
@@ -263,21 +264,26 @@
NestedMethod=NestedMethod
NestedParamMappings=NestedParameterMappings
NestedType=NestedType
+NonWildTypeArgumentsopt=NonWildTypeArgumentsopt
NormalAnnotation=NormalAnnotation
NumericType=NumericType
OneDimLoop=Dimension
+OneDimOrAnnot=OneDimensionOrAnnotation
OnlySynchronized=OnlySynchronized
OnlyTypeArguments=TypeArguments
OnlyTypeArgumentsForCastExpression=TypeArguments
+OnlyTypeArgumentsForReferenceExpression=OnlyTypeArgumentsForReferenceExpression
OpenBlock=OpenBlock
PackageComment=PackageComment
PackageDeclaration=PackageDeclaration
PackageDeclarationName=PackageDeclarationName
ParameterMapping=ParameterMapping
+PopZeroTypeAnnotations=PopZeroTypeAnnotations
PostDecrementExpression=PostDecrementExpression
PostIncrementExpression=PostIncrementExpression
PostfixExpression=Expression
PostfixExpression_NotName=Expression
+PotentialNameArray=PotentialNameArray
PreDecrementExpression=PreDecrementExpression
PreIncrementExpression=PreIncrementExpression
PrecedenceDeclaration=PrecedenceDeclaration
@@ -286,13 +292,19 @@
Primary=Expression
PrimaryNoNewArray=Expression
PrimitiveType=PrimitiveType
+PushDefault=PushDefault
PushLPAREN=(
PushLeftBrace=PushLeftBrace
PushModifiers=PushModifiers
PushModifiersForHeader=PushModifiersForHeader
PushPosition=PushPosition
PushRPAREN=)
+PushRPARENForAnnotatedTypeCast=)
+PushRPARENForNameAndAnnotatedTypeCast=)
+PushRPARENForNameUnannotatedTypeCast=)
+PushRPARENForUnannotatedTypeCast=)
PushRealModifiers=PushRealModifiers
+PushZeroTypeAnnotations=ZeroTypeAnnotations
QualifiedClassBodyopt=ClassBody
QualifiedEnterAnonymousClassBody=EnterAnonymousClassBody
QualifiedName=QualifiedName
@@ -301,10 +313,14 @@
RecoveryCallinHeader=CallinBindingLong
RecoveryCalloutBindingLeftLong=CalloutBindingLeftLong
RecoveryCalloutHeader=CalloutBindingLong
+RecoveryEnumConstantSeparatoropt=RecoveryEnumConstantSeparatoropt
+RecoveryExitHeader=RecoveryExitHeader
RecoveryMethodHeader=MethodHeader
RecoveryMethodHeaderName=MethodHeaderName
RecoveryMethodSpecLong=MethodSpecLong
ReduceImports=ReduceImports
+ReferenceExpression=ReferenceExpression
+ReferenceType0=ReferenceType
ReferenceType1=ReferenceType1
ReferenceType2=ReferenceType2
ReferenceType3=ReferenceType3
@@ -350,8 +366,10 @@
TryBlock=Block
TryStatement=TryStatement
TryStatementWithResources=TryStatementWithResources
+Type0=Type
Type=Type
TypeAnchor=typeAnchor
+TypeAnnotations=TypeAnnotations
TypeArgument1=TypeArgument1
TypeArgument2=TypeArgument2
TypeArgument3=TypeArgument3
@@ -365,8 +383,11 @@
TypeBoundOpt=TypeParameterBound
TypeDeclaration=TypeDeclaration
TypeDeclarations=TypeDeclarations
+TypeElidedFormalParameter=TypeElidedFormalParameter
+TypeElidedFormalParameterList=TypeElidedFormalParameterList
TypeImportOnDemandDeclaration=TypeImportOnDemandDeclaration
TypeImportOnDemandDeclarationName=TypeImportOnDemandDeclarationName
+TypeInternal=Type
TypeParameter1=TypeParameter1
TypeParameter=TypeParameter
TypeParameterHeader=TypeParameter
@@ -383,6 +404,7 @@
UnqualifiedEnterAnonymousClassBody=EnterAnonymousClassBody
VariableDeclarator=VariableDeclarator
VariableDeclaratorId=VariableDeclaratorId
+VariableDeclaratorIdOrThis=VariableDeclaratorId
VariableDeclarators=VariableDeclarators
VariableInitializer=VariableInitializer
VariableInitializers=VariableInitializers
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index baa1a36..907010a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -4,7 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id: ProblemReporter.java 23405 2010-02-03 17:02:18Z stephan $
+ *
+ * This is an implementation of an early-draft specification developed under the Java
+ * Community Process (JCP) and is made available for testing and evaluation purposes
+ * only. The code is not compatible with any specification of the JCP.
*
* Contributors:
* IBM Corporation - initial API and implementation
@@ -21,6 +24,7 @@
* bug 365531 - [compiler][null] investigate alternative strategy for internally encoding nullness defaults
* bug 365859 - [compiler][null] distinguish warnings based on flow analysis vs. null annotations
* bug 374605 - Unreasonable warning for enum-based switch statements
+ * bug 382353 - [1.8][compiler] Implementation property modifiers should be accepted on default methods.
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.problem;
@@ -74,6 +78,7 @@
import org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression;
import org.eclipse.jdt.internal.compiler.ast.JavadocSingleTypeReference;
import org.eclipse.jdt.internal.compiler.ast.LabeledStatement;
+import org.eclipse.jdt.internal.compiler.ast.LambdaExpression;
import org.eclipse.jdt.internal.compiler.ast.Literal;
import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration;
import org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
@@ -86,6 +91,7 @@
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
import org.eclipse.jdt.internal.compiler.ast.Reference;
+import org.eclipse.jdt.internal.compiler.ast.ReferenceExpression;
import org.eclipse.jdt.internal.compiler.ast.ReturnStatement;
import org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
import org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
@@ -1727,6 +1733,23 @@
annotation.sourceStart,
annotation.sourceEnd);
}
+public void explitAnnotationTargetRequired(Annotation annotation) {
+ int kind = annotation.recipient.kind();
+ if (kind == Binding.TYPE_USE) {
+ this.handle(IProblem.ExplicitAnnotationTargetRequired,
+ new String[] {new String(annotation.resolvedType.readableName())},
+ new String[]{new String(TypeConstants.TYPE_USE_TARGET)},
+ annotation.sourceStart,
+ annotation.sourceEnd);
+ }
+ else if (kind == Binding.TYPE_PARAMETER) {
+ this.handle(IProblem.ExplicitAnnotationTargetRequired,
+ new String[] {new String(annotation.resolvedType.readableName())},
+ new String[]{new String(TypeConstants.TYPE_PARAMETER_TARGET)},
+ annotation.sourceStart,
+ annotation.sourceEnd);
+ }
+}
public void polymorphicMethodNotBelow17(ASTNode node) {
this.handle(
IProblem.PolymorphicMethodNotBelow17,
@@ -2787,11 +2810,13 @@
fieldDecl.sourceStart,
fieldDecl.sourceEnd);
}
-public void illegalModifierForInterfaceMethod(AbstractMethodDeclaration methodDecl) {
+public void illegalModifierForInterfaceMethod(AbstractMethodDeclaration methodDecl, boolean isDefaultMethod) {
// cannot include parameter types since they are not resolved yet
// and the error message would be too long
this.handle(
- IProblem.IllegalModifierForInterfaceMethod,
+ isDefaultMethod
+ ? IProblem.IllegalModifierForInterfaceDefaultMethod
+ : IProblem.IllegalModifierForInterfaceMethod,
new String[] {
new String(methodDecl.selector)
},
@@ -2851,6 +2876,14 @@
methodDecl.sourceStart,
methodDecl.sourceEnd);
}
+public void invalidLocationForModifiers(ASTNode location) {
+ this.handle(
+ IProblem.InvalidLocationForModifiers,
+ NoArgument,
+ NoArgument,
+ location.sourceStart,
+ location.sourceEnd);
+}
public void illegalModifierForVariable(LocalDeclaration localDecl, boolean complainAsArgument) {
String[] arguments = new String[] {new String(localDecl.name)};
this.handle(
@@ -2919,6 +2952,48 @@
argType.sourceStart,
argType.sourceEnd);
}
+public void illegalThis(Argument argument, AbstractMethodDeclaration method, long sourceLevel) {
+ String[] arguments = NoArgument;
+ this.handle(
+ sourceLevel <= ClassFileConstants.JDK1_7 ? IProblem.ExplicitThisParameterNotBelow18 : IProblem.IllegalDeclarationOfThisParameter,
+ arguments,
+ arguments,
+ argument.sourceStart,
+ argument.sourceEnd);
+}
+public void illegalThis(Argument argument) {
+ String[] arguments = NoArgument;
+ this.handle(
+ IProblem.ExplicitThisParameterNotInLambda,
+ arguments,
+ arguments,
+ argument.sourceStart,
+ argument.sourceEnd);
+}
+public void defaultMethodsNotBelow18(MethodDeclaration md) {
+ this.handle(
+ IProblem.DefaultMethodNotBelow18,
+ NoArgument,
+ NoArgument,
+ md.bodyStart,
+ md.bodyEnd);
+}
+public void referenceExpressionsNotBelow18(ReferenceExpression rexp) {
+ this.handle(
+ rexp.isMethodReference() ? IProblem.MethodReferenceNotBelow18 : IProblem.ConstructorReferenceNotBelow18,
+ NoArgument,
+ NoArgument,
+ rexp.sourceStart,
+ rexp.sourceEnd);
+}
+public void lambdaExpressionsNotBelow18(LambdaExpression lexp) {
+ this.handle(
+ IProblem.LambdaExpressionNotBelow18,
+ NoArgument,
+ NoArgument,
+ lexp.sourceStart,
+ lexp.sourceEnd);
+}
public void illegalVisibilityModifierCombinationForField(ReferenceBinding type, FieldDeclaration fieldDecl) {
String[] arguments = new String[] {new String(fieldDecl.name)};
this.handle(
@@ -4733,6 +4808,41 @@
argument.type.sourceStart,
argument.sourceEnd);
}
+
+public void invalidUsageOfTypeAnnotations(Annotation annotation) {
+ this.handle(
+ IProblem.InvalidUsageOfTypeAnnotations,
+ NoArgument,
+ NoArgument,
+ annotation.sourceStart,
+ annotation.sourceEnd);
+}
+
+public void illegalReceiverAnnotations(Annotation first, Annotation last) {
+ this.handle(
+ IProblem.InvalidUsageOfReceiverAnnotations,
+ NoArgument,
+ NoArgument,
+ first.sourceStart,
+ last.sourceEnd);
+}
+
+public void misplacedTypeAnnotations(Annotation first, Annotation last) {
+ this.handle(
+ IProblem.MisplacedTypeAnnotations,
+ NoArgument,
+ NoArgument,
+ first.sourceStart,
+ last.sourceEnd);
+}
+public void illegalUsageOfTypeAnnotations(Annotation annotation) {
+ this.handle(
+ IProblem.IllegalUsageOfTypeAnnotations,
+ NoArgument,
+ NoArgument,
+ annotation.sourceStart,
+ annotation.sourceEnd);
+}
public void isClassPathCorrect(char[][] wellKnownTypeName, CompilationUnitDeclaration compUnitDecl, Object location) {
this.referenceContext = compUnitDecl;
String[] arguments = new String[] {CharOperation.toString(wellKnownTypeName)};
@@ -7461,6 +7571,7 @@
String[] arguments;
if(expectedToken != null) {
+ expectedToken = replaceIfSynthetic(expectedToken);
arguments = new String[] {eTokenName, expectedToken};
} else {
arguments = new String[] {eTokenName};
@@ -7472,6 +7583,19 @@
startPosition,
endPosition);
}
+private String replaceIfSynthetic(String token) {
+ /* Java 8 grammar changes use some synthetic tokens to make the grammar LALR(1). These tokens should not be exposed in messages
+ as it would make no sense to the programmer whatsoever. Replace such artificial tokens with some "suitable" alternative. At
+ the moment, there are two synthetic tokens that need such massaging viz : "BeginLambda" and "BeginTypeArguments". There is a
+ third synthetic token "ElidedSemicolonAndRightBrace" that we don't expect to show up in messages since it is manufactured by
+ the parser automatically.
+ */
+ if (token.equals("BeginTypeArguments")) //$NON-NLS-1$
+ return "."; //$NON-NLS-1$
+ if (token.equals("BeginLambda")) //$NON-NLS-1$
+ return "("; //$NON-NLS-1$
+ return token;
+}
public void task(String tag, String message, String priority, int start, int end){
this.handle(
IProblem.Task,
@@ -12802,4 +12926,14 @@
compUnitDecl.currentPackage.sourceEnd);
}
}
+
+public void illegalModifiersForElidedType(Argument argument) {
+ String[] arg = new String[] {new String(argument.name)};
+ this.handle(
+ IProblem.IllegalModifiersForElidedType,
+ arg,
+ arg,
+ argument.declarationSourceStart,
+ argument.declarationSourceEnd);
+}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
index 5f90cc0..a319bce 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties
@@ -4,7 +4,12 @@
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
-#
+#
+# This is an implementation of an early-draft specification developed under the Java
+# Community Process (JCP) and is made available for testing and evaluation purposes
+# only. The code is not compatible with any specification of the JCP.
+#
+#
# Contributors:
# IBM Corporation - initial API and implementation
# Benjamin Muskalla - Contribution for bug 239066
@@ -18,6 +23,7 @@
# bug 365531 - [compiler][null] investigate alternative strategy for internally encoding nullness defaults
# bug 365859 - [compiler][null] distinguish warnings based on flow analysis vs. null annotations
# bug 374605 - Unreasonable warning for enum-based switch statements
+# bug 382353 - [1.8][compiler] Implementation property modifiers should be accepted on default methods.
###############################################################################
0 = {0}
1 = super cannot be used in java.lang.Object
@@ -583,7 +589,19 @@
634 = The method {0}({1}) of type {2} must override or implement a supertype method
635 = Unnecessary @SuppressWarnings("{0}")
636 = The method {0}({1}) of type {2} should be tagged with @Override since it actually overrides a superinterface method
-
+637 = Syntax error, type annotations are available only when source level is at least 1.8
+638 = Receiver annotations are illegal in a static method context
+639 = Syntax error, type annotations are illegal here
+640 = Syntax error, modifiers are illegal here
+641 = Type annotation is illegal for a method that returns void
+642 = Only the first formal parameter of an instance method may be declared explicitly as "this"
+643 = Explicit declaration of "this" parameter is allowed only at source level 1.8 or above
+644 = Default methods are allowed only at source level 1.8 or above
+645 = Lambda expressions are allowed only at source level 1.8 or above
+646 = Method references are allowed only at source level 1.8 or above
+647 = Constructor references are allowed only at source level 1.8 or above
+648 = Lambda expressions cannot declare a this parameter
+649 = Only annotation types that explicitly specify {0} as a possible target element type can be applied here
### MORE GENERICS
660 = Unused type arguments for the non generic constructor {0}({1}) of type {2}; it should not be parameterized with arguments <{3}>
@@ -693,6 +711,15 @@
932 = Null comparison always yields false: The variable {0} is specified as @{1}
933 = Null type mismatch: required ''@{0} {1}'' but the provided value is specified as @{2}
+
+// Java 8
+1001 = Syntax error, modifiers and annotations are not allowed for the lambda parameter {0} as its type is elided
+
+# Default methods:
+# variant of 359:
+1050 = Illegal modifier for the interface method {0}; only public, abstract, strictfp & synchronized are permitted
+
+
### ELABORATIONS
## Access restrictions
78592 = The type {1} is not accessible due to restriction on classpath entry {0}