diff --git a/org.eclipse.jdt.core.compiler.batch/grammar/java.g b/org.eclipse.jdt.core.compiler.batch/grammar/java.g index 3ac25c48d72..dcd8957191a 100644 --- a/org.eclipse.jdt.core.compiler.batch/grammar/java.g +++ b/org.eclipse.jdt.core.compiler.batch/grammar/java.g @@ -434,10 +434,6 @@ InternalCompilationUnit ::= PackageDeclaration TypeDeclarations /.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ InternalCompilationUnit ::= ImportDeclarations ReduceImports /.$putCase consumeInternalCompilationUnit(); $break ./ -InternalCompilationUnit ::= TypeDeclarations -/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ -InternalCompilationUnit ::= ImportDeclarations ReduceImports TypeDeclarations -/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./ InternalCompilationUnit ::= $empty /.$putCase consumeEmptyInternalCompilationUnit(); $break ./ /:$readableName CompilationUnit:/ @@ -453,6 +449,12 @@ ModuleDeclaration ::= ModuleHeader ModuleBody /:$compliance 9:/ /.$putCase consumeModuleDeclaration(); $break ./ +-- JEP 445: unnamed class, this may capture type declarations without unnamed class, this case is fixed/reduced upon completioon of parsing +InternalCompilationUnit ::= UnnamedClassBodyDeclarations +/.$putCase consumeInternalCompilationUnitWithPotentialUnnamedClass(); $break ./ +InternalCompilationUnit ::= ImportDeclarations ReduceImports UnnamedClassBodyDeclarations +/.$putCase consumeInternalCompilationUnitWithPotentialUnnamedClass(); $break ./ + -- to work around shift/reduce conflicts, we allow Modifiersopt in order to support annotations -- in a module declaration, and then report errors if any modifiers other than annotations are -- encountered @@ -746,6 +748,11 @@ ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration ClassBodyDeclaration -> ClassMemberDeclaration ClassBodyDeclaration -> StaticInitializer ClassBodyDeclaration -> ConstructorDeclaration + +UnnamedClassBodyDeclarations -> ClassMemberDeclaration +UnnamedClassBodyDeclarations ::= ClassMemberDeclaration UnnamedClassBodyDeclarations +/.$putCase consumeUnnamedClassBodyDeclarations(); $break ./ +/:$readableName UnnamedClassBodyDeclarations:/ --1.1 feature ClassBodyDeclaration ::= Diet NestedMethod CreateInitializer Block /.$putCase consumeClassBodyDeclaration(); $break ./ diff --git a/org.eclipse.jdt.core.compiler.batch/scripts/GenerateParserScript.class b/org.eclipse.jdt.core.compiler.batch/scripts/GenerateParserScript.class new file mode 100644 index 00000000000..f0ad7ae3b18 Binary files /dev/null and b/org.eclipse.jdt.core.compiler.batch/scripts/GenerateParserScript.class differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnnamedClass.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnnamedClass.java new file mode 100644 index 00000000000..3d77dae8883 --- /dev/null +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnnamedClass.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2023 Red Hat, Inc. and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.jdt.internal.compiler.ast; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.MessageFormat; + +import org.eclipse.jdt.internal.compiler.CompilationResult; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; + +/** + * Represents an unnamed class as defined in JEP 445 + */ +public class UnnamedClass extends TypeDeclaration { + + private static String NAME_TEMPLATE = ""; //$NON-NLS-1$ + + public UnnamedClass(CompilationResult result) { + super(result); + this.modifiers = ClassFileConstants.AccDefault | ClassFileConstants.AccFinal; + + Path p = Paths.get(new String(result.fileName)); + String basename = p.getFileName().toString(); + String classSuffix; + if (basename.endsWith(".java")) { //$NON-NLS-1$ + classSuffix = basename.substring(0, basename.length() - 5); + } else { + classSuffix = basename; + } + + String nameString = MessageFormat.format(NAME_TEMPLATE, classSuffix); + this.name = nameString.toCharArray(); + } + +} diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java index 78bb694945b..98013026c74 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java @@ -43,6 +43,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Properties; @@ -4842,6 +4843,63 @@ protected void consumeInternalCompilationUnit() { this.compilationUnit.createPackageInfoType(); } } +protected void consumeUnnamedClassBodyDeclarations() { + concatNodeLists(); +} + +protected void consumeInternalCompilationUnitWithPotentialUnnamedClass() { + int length; + if ((length = this.astLengthStack[this.astLengthPtr--]) != 0) { + LinkedList methods = new LinkedList<>(); + LinkedList fields = new LinkedList<>(); + LinkedList types = new LinkedList<>(); + int sourceStart = Integer.MAX_VALUE; + // here are length declarations + for (int i = length - 1; i >= 0; i--) { + ASTNode astNode = this.astStack[this.astPtr--]; + if (astNode instanceof MethodDeclaration method) { + if (method.declarationSourceStart < sourceStart) { + sourceStart = method.declarationSourceStart; + } + //methods and constructors have been regrouped into one single list + methods.addFirst(method); + } else if (astNode instanceof TypeDeclaration type) { + if (type.declarationSourceStart < sourceStart) { + sourceStart = type.declarationSourceStart; + } + types.addFirst(type); + } else if (astNode instanceof FieldDeclaration field) { + if (field.declarationSourceStart < sourceStart) { + sourceStart = field.declarationSourceStart; + } + fields.addFirst(field); + } + } + if (!methods.isEmpty() || !fields.isEmpty()) { + problemReporter().validateJavaFeatureSupport(JavaFeature.UNNAMMED_CLASSES_AND_INSTANCE_MAIN_METHODS, 0, 0); + UnnamedClass unnamedClass = new UnnamedClass(this.compilationUnit.compilationResult); + unnamedClass.methods = methods.toArray(AbstractMethodDeclaration[]::new); + unnamedClass.createDefaultConstructor(false, true); + unnamedClass.fields = fields.toArray(FieldDeclaration[]::new); + unnamedClass.memberTypes = types.toArray(TypeDeclaration[]::new); + + unnamedClass.declarationSourceStart = sourceStart; + unnamedClass.declarationSourceEnd = this.scanner.eofPosition - 1; + unnamedClass.bodyStart = sourceStart; + unnamedClass.bodyEnd = this.scanner.eofPosition - 1; + unnamedClass.sourceStart = sourceStart; + unnamedClass.sourceEnd = this.scanner.eofPosition - 1; + types.forEach(type -> type.enclosingType = unnamedClass); + this.compilationUnit.types = new TypeDeclaration[] { unnamedClass }; + } else if (types.size() > 0) { + // add types to compilation unit + this.compilationUnit.types = types.toArray(TypeDeclaration[]::new); + } else { + // empty compilation unit + } + } +} + protected void consumeInternalCompilationUnitWithTypes() { // InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports TypeDeclarations // InternalCompilationUnit ::= PackageDeclaration TypeDeclarations @@ -6803,24 +6861,24 @@ protected void consumeRule(int act) { case 101 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ consumeInternalCompilationUnit(); break; - case 102 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= TypeDeclarations"); } //$NON-NLS-1$ - consumeInternalCompilationUnitWithTypes(); break; - - case 103 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ - consumeInternalCompilationUnitWithTypes(); break; - - case 104 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$ + case 102 : if (DEBUG) { System.out.println("InternalCompilationUnit ::="); } //$NON-NLS-1$ consumeEmptyInternalCompilationUnit(); break; - case 105 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ + case 103 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ consumeInternalCompilationUnitWithModuleDeclaration(); break; - case 106 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ModuleDeclaration"); } //$NON-NLS-1$ + case 104 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ModuleDeclaration"); } //$NON-NLS-1$ consumeInternalCompilationUnitWithModuleDeclaration(); break; - case 107 : if (DEBUG) { System.out.println("ModuleDeclaration ::= ModuleHeader ModuleBody"); } //$NON-NLS-1$ + case 105 : if (DEBUG) { System.out.println("ModuleDeclaration ::= ModuleHeader ModuleBody"); } //$NON-NLS-1$ consumeModuleDeclaration(); break; + case 106 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= UnnamedClassBodyDeclarations"); } //$NON-NLS-1$ + consumeInternalCompilationUnitWithPotentialUnnamedClass(); break; + + case 107 : if (DEBUG) { System.out.println("InternalCompilationUnit ::= ImportDeclarations..."); } //$NON-NLS-1$ + consumeInternalCompilationUnitWithPotentialUnnamedClass(); break; + case 108 : if (DEBUG) { System.out.println("ModuleHeader ::= Modifiersopt ModuleModifieropt module"); } //$NON-NLS-1$ consumeModuleHeader(); break; @@ -6968,1465 +7026,1468 @@ protected void consumeRule(int act) { case 223 : if (DEBUG) { System.out.println("ClassBodyDeclarations ::= ClassBodyDeclarations..."); } //$NON-NLS-1$ consumeClassBodyDeclarations(); break; - case 227 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$ + case 228 : if (DEBUG) { System.out.println("UnnamedClassBodyDeclarations ::= ClassMemberDeclaration"); } //$NON-NLS-1$ + consumeUnnamedClassBodyDeclarations(); break; + + case 229 : if (DEBUG) { System.out.println("ClassBodyDeclaration ::= Diet NestedMethod..."); } //$NON-NLS-1$ consumeClassBodyDeclaration(); break; - case 228 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$ + case 230 : if (DEBUG) { System.out.println("Diet ::="); } //$NON-NLS-1$ consumeDiet(); break; - case 229 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$ + case 231 : if (DEBUG) { System.out.println("Initializer ::= Diet NestedMethod CreateInitializer..."); } //$NON-NLS-1$ consumeClassBodyDeclaration(); break; - case 230 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$ + case 232 : if (DEBUG) { System.out.println("CreateInitializer ::="); } //$NON-NLS-1$ consumeCreateInitializer(); break; - case 238 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ + case 240 : if (DEBUG) { System.out.println("ClassMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ consumeEmptyTypeDeclaration(); break; - case 241 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 243 : if (DEBUG) { System.out.println("FieldDeclaration ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeFieldDeclaration(); break; - case 243 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$ + case 245 : if (DEBUG) { System.out.println("VariableDeclarators ::= VariableDeclarators COMMA..."); } //$NON-NLS-1$ consumeVariableDeclarators(); break; - case 246 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$ + case 248 : if (DEBUG) { System.out.println("EnterVariable ::="); } //$NON-NLS-1$ consumeEnterVariable(); break; - case 247 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$ + case 249 : if (DEBUG) { System.out.println("ExitVariableWithInitialization ::="); } //$NON-NLS-1$ consumeExitVariableWithInitialization(); break; - case 248 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$ + case 250 : if (DEBUG) { System.out.println("ExitVariableWithoutInitialization ::="); } //$NON-NLS-1$ consumeExitVariableWithoutInitialization(); break; - case 249 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$ + case 251 : if (DEBUG) { System.out.println("ForceNoDiet ::="); } //$NON-NLS-1$ consumeForceNoDiet(); break; - case 250 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$ + case 252 : if (DEBUG) { System.out.println("RestoreDiet ::="); } //$NON-NLS-1$ consumeRestoreDiet(); break; - case 252 : if (DEBUG) { System.out.println("VariableDeclaratorId ::= UNDERSCORE"); } //$NON-NLS-1$ + case 254 : if (DEBUG) { System.out.println("VariableDeclaratorId ::= UNDERSCORE"); } //$NON-NLS-1$ consumeUnnamedVariable(); break; - case 256 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ + case 258 : if (DEBUG) { System.out.println("MethodDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ // set to true to consume a method with a body consumeMethodDeclaration(true, false); break; - case 257 : if (DEBUG) { System.out.println("MethodDeclaration ::= DefaultMethodHeader MethodBody"); } //$NON-NLS-1$ + case 259 : if (DEBUG) { System.out.println("MethodDeclaration ::= DefaultMethodHeader MethodBody"); } //$NON-NLS-1$ // set to true to consume a method with a body consumeMethodDeclaration(true, true); break; - case 258 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$ + case 260 : if (DEBUG) { System.out.println("AbstractMethodDeclaration ::= MethodHeader SEMICOLON"); } //$NON-NLS-1$ // set to false to consume a method without body consumeMethodDeclaration(false, false); break; - case 259 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$ + case 261 : if (DEBUG) { System.out.println("MethodHeader ::= MethodHeaderName FormalParameterListopt"); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 260 : if (DEBUG) { System.out.println("DefaultMethodHeader ::= DefaultMethodHeaderName..."); } //$NON-NLS-1$ + case 262 : if (DEBUG) { System.out.println("DefaultMethodHeader ::= DefaultMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 261 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$ + case 263 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt TypeParameters Type..."); } //$NON-NLS-1$ consumeMethodHeaderNameWithTypeParameters(false); break; - case 262 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); } //$NON-NLS-1$ + case 264 : if (DEBUG) { System.out.println("MethodHeaderName ::= Modifiersopt Type Identifier LPAREN"); } //$NON-NLS-1$ consumeMethodHeaderName(false); break; - case 263 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$ + case 265 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$ consumeMethodHeaderNameWithTypeParameters(false); break; - case 264 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault Type..."); } //$NON-NLS-1$ + case 266 : if (DEBUG) { System.out.println("DefaultMethodHeaderName ::= ModifiersWithDefault Type..."); } //$NON-NLS-1$ consumeMethodHeaderName(false); break; - case 265 : if (DEBUG) { System.out.println("ModifiersWithDefault ::= Modifiersopt default..."); } //$NON-NLS-1$ + case 267 : if (DEBUG) { System.out.println("ModifiersWithDefault ::= Modifiersopt default..."); } //$NON-NLS-1$ consumePushCombineModifiers(); break; - case 266 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$ + case 268 : if (DEBUG) { System.out.println("MethodHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$ consumeMethodHeaderRightParen(); break; - case 267 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$ + case 269 : if (DEBUG) { System.out.println("MethodHeaderExtendedDims ::= Dimsopt"); } //$NON-NLS-1$ consumeMethodHeaderExtendedDims(); break; - case 268 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$ + case 270 : if (DEBUG) { System.out.println("MethodHeaderThrowsClause ::= throws ClassTypeList"); } //$NON-NLS-1$ consumeMethodHeaderThrowsClause(); break; - case 269 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$ + case 271 : if (DEBUG) { System.out.println("ConstructorHeader ::= ConstructorHeaderName..."); } //$NON-NLS-1$ consumeConstructorHeader(); break; - case 270 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$ + case 272 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt TypeParameters..."); } //$NON-NLS-1$ consumeConstructorHeaderNameWithTypeParameters(); break; - case 271 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$ + case 273 : if (DEBUG) { System.out.println("ConstructorHeaderName ::= Modifiersopt Identifier LPAREN"); } //$NON-NLS-1$ consumeConstructorHeaderName(); break; - case 273 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$ + case 275 : if (DEBUG) { System.out.println("FormalParameterList ::= FormalParameterList COMMA..."); } //$NON-NLS-1$ consumeFormalParameterList(); break; - case 274 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 276 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeFormalParameter(false); break; - case 275 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 277 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeFormalParameter(true); break; - case 276 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type AT308DOTDOTDOT..."); } //$NON-NLS-1$ + case 278 : if (DEBUG) { System.out.println("FormalParameter ::= Modifiersopt Type AT308DOTDOTDOT..."); } //$NON-NLS-1$ consumeFormalParameter(true); break; - case 277 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$ + case 279 : if (DEBUG) { System.out.println("CatchFormalParameter ::= Modifiersopt CatchType..."); } //$NON-NLS-1$ consumeCatchFormalParameter(); break; - case 278 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$ + case 280 : if (DEBUG) { System.out.println("CatchType ::= UnionType"); } //$NON-NLS-1$ consumeCatchType(); break; - case 279 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$ + case 281 : if (DEBUG) { System.out.println("UnionType ::= Type"); } //$NON-NLS-1$ consumeUnionTypeAsClassType(); break; - case 280 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$ + case 282 : if (DEBUG) { System.out.println("UnionType ::= UnionType OR Type"); } //$NON-NLS-1$ consumeUnionType(); break; - case 282 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$ + case 284 : if (DEBUG) { System.out.println("ClassTypeList ::= ClassTypeList COMMA ClassTypeElt"); } //$NON-NLS-1$ consumeClassTypeList(); break; - case 283 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$ + case 285 : if (DEBUG) { System.out.println("ClassTypeElt ::= ClassType"); } //$NON-NLS-1$ consumeClassTypeElt(); break; - case 284 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$ + case 286 : if (DEBUG) { System.out.println("MethodBody ::= NestedMethod LBRACE BlockStatementsopt..."); } //$NON-NLS-1$ consumeMethodBody(); break; - case 285 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$ + case 287 : if (DEBUG) { System.out.println("NestedMethod ::="); } //$NON-NLS-1$ consumeNestedMethod(); break; - case 286 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$ + case 288 : if (DEBUG) { System.out.println("StaticInitializer ::= StaticOnly Block"); } //$NON-NLS-1$ consumeStaticInitializer(); break; - case 287 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$ + case 289 : if (DEBUG) { System.out.println("StaticOnly ::= static"); } //$NON-NLS-1$ consumeStaticOnly(); break; - case 288 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$ + case 290 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader MethodBody"); } //$NON-NLS-1$ consumeConstructorDeclaration() ; break; - case 289 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$ + case 291 : if (DEBUG) { System.out.println("ConstructorDeclaration ::= ConstructorHeader SEMICOLON"); } //$NON-NLS-1$ consumeInvalidConstructorDeclaration() ; break; - case 290 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$ + case 292 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= this LPAREN..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocation(0, THIS_CALL); break; - case 291 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$ + case 293 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments this"); } //$NON-NLS-1$ consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL); break; - case 292 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$ + case 294 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= super LPAREN..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocation(0,SUPER_CALL); break; - case 293 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$ + case 295 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= OnlyTypeArguments..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL); break; - case 294 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$ + case 296 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT super..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocation(1, SUPER_CALL); break; - case 295 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ + case 297 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL); break; - case 296 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$ + case 298 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT super LPAREN"); } //$NON-NLS-1$ consumeExplicitConstructorInvocation(2, SUPER_CALL); break; - case 297 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ + case 299 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL); break; - case 298 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$ + case 300 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT this..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocation(1, THIS_CALL); break; - case 299 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ + case 301 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Primary DOT..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL); break; - case 300 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$ + case 302 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT this LPAREN"); } //$NON-NLS-1$ consumeExplicitConstructorInvocation(2, THIS_CALL); break; - case 301 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ + case 303 : if (DEBUG) { System.out.println("ExplicitConstructorInvocation ::= Name DOT..."); } //$NON-NLS-1$ consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL); break; - case 302 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$ + case 304 : if (DEBUG) { System.out.println("InterfaceDeclaration ::= InterfaceHeader InterfaceBody"); } //$NON-NLS-1$ consumeInterfaceDeclaration(); break; - case 303 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$ + case 305 : if (DEBUG) { System.out.println("InterfaceHeader ::= InterfaceHeaderName..."); } //$NON-NLS-1$ consumeInterfaceHeader(); break; - case 304 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$ + case 306 : if (DEBUG) { System.out.println("InterfaceHeaderName ::= InterfaceHeaderName1..."); } //$NON-NLS-1$ consumeTypeHeaderNameWithTypeParameters(); break; - case 306 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$ + case 308 : if (DEBUG) { System.out.println("InterfaceHeaderName1 ::= Modifiersopt interface..."); } //$NON-NLS-1$ consumeInterfaceHeaderName1(); break; - case 307 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$ + case 309 : if (DEBUG) { System.out.println("InterfaceHeaderExtends ::= extends InterfaceTypeList"); } //$NON-NLS-1$ consumeInterfaceHeaderExtends(); break; - case 310 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$ + case 312 : if (DEBUG) { System.out.println("InterfaceMemberDeclarations ::=..."); } //$NON-NLS-1$ consumeInterfaceMemberDeclarations(); break; - case 311 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ + case 313 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= SEMICOLON"); } //$NON-NLS-1$ consumeEmptyTypeDeclaration(); break; - case 313 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$ + case 315 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$ consumeInterfaceMethodDeclaration(false); break; - case 314 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ + case 316 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= MethodHeader MethodBody"); } //$NON-NLS-1$ consumeInterfaceMethodDeclaration(false); break; - case 315 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$ + case 317 : if (DEBUG) { System.out.println("InterfaceMemberDeclaration ::= DefaultMethodHeader..."); } //$NON-NLS-1$ consumeInterfaceMethodDeclaration(true); break; - case 316 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ + case 318 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ consumeInvalidConstructorDeclaration(true); break; - case 317 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ + case 319 : if (DEBUG) { System.out.println("InvalidConstructorDeclaration ::= ConstructorHeader..."); } //$NON-NLS-1$ consumeInvalidConstructorDeclaration(false); break; - case 328 : if (DEBUG) { System.out.println("RecordDeclaration ::= RecordHeaderPart RecordBody"); } //$NON-NLS-1$ + case 330 : if (DEBUG) { System.out.println("RecordDeclaration ::= RecordHeaderPart RecordBody"); } //$NON-NLS-1$ consumeRecordDeclaration(); break; - case 329 : if (DEBUG) { System.out.println("RecordHeaderPart ::= RecordHeaderName RecordHeader..."); } //$NON-NLS-1$ + case 331 : if (DEBUG) { System.out.println("RecordHeaderPart ::= RecordHeaderName RecordHeader..."); } //$NON-NLS-1$ consumeRecordHeaderPart(); break; - case 330 : if (DEBUG) { System.out.println("RecordHeaderName ::= RecordHeaderName1 TypeParameters"); } //$NON-NLS-1$ + case 332 : if (DEBUG) { System.out.println("RecordHeaderName ::= RecordHeaderName1 TypeParameters"); } //$NON-NLS-1$ consumeRecordHeaderNameWithTypeParameters(); break; - case 332 : if (DEBUG) { System.out.println("RecordHeaderName1 ::= Modifiersopt..."); } //$NON-NLS-1$ + case 334 : if (DEBUG) { System.out.println("RecordHeaderName1 ::= Modifiersopt..."); } //$NON-NLS-1$ consumeRecordHeaderName1(); break; - case 333 : if (DEBUG) { System.out.println("RecordComponentHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$ + case 335 : if (DEBUG) { System.out.println("RecordComponentHeaderRightParen ::= RPAREN"); } //$NON-NLS-1$ consumeRecordComponentHeaderRightParen(); break; - case 334 : if (DEBUG) { System.out.println("RecordHeader ::= LPAREN RecordComponentsopt..."); } //$NON-NLS-1$ + case 336 : if (DEBUG) { System.out.println("RecordHeader ::= LPAREN RecordComponentsopt..."); } //$NON-NLS-1$ consumeRecordHeader(); break; - case 335 : if (DEBUG) { System.out.println("RecordComponentsopt ::="); } //$NON-NLS-1$ + case 337 : if (DEBUG) { System.out.println("RecordComponentsopt ::="); } //$NON-NLS-1$ consumeRecordComponentsopt(); break; - case 338 : if (DEBUG) { System.out.println("RecordComponents ::= RecordComponents COMMA..."); } //$NON-NLS-1$ + case 340 : if (DEBUG) { System.out.println("RecordComponents ::= RecordComponents COMMA..."); } //$NON-NLS-1$ consumeRecordComponents(); break; - case 340 : if (DEBUG) { System.out.println("RecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 342 : if (DEBUG) { System.out.println("RecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeRecordComponent(false); break; - case 341 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 343 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeRecordComponent(true); break; - case 342 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 344 : if (DEBUG) { System.out.println("VariableArityRecordComponent ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeRecordComponent(true); break; - case 343 : if (DEBUG) { System.out.println("RecordBody ::= LBRACE RecordBodyDeclarationopt RBRACE"); } //$NON-NLS-1$ + case 345 : if (DEBUG) { System.out.println("RecordBody ::= LBRACE RecordBodyDeclarationopt RBRACE"); } //$NON-NLS-1$ consumeRecordBody(); break; - case 344 : if (DEBUG) { System.out.println("RecordBodyDeclarationopt ::="); } //$NON-NLS-1$ + case 346 : if (DEBUG) { System.out.println("RecordBodyDeclarationopt ::="); } //$NON-NLS-1$ consumeEmptyRecordBodyDeclaration(); break; - case 347 : if (DEBUG) { System.out.println("RecordBodyDeclarations ::= RecordBodyDeclarations..."); } //$NON-NLS-1$ + case 349 : if (DEBUG) { System.out.println("RecordBodyDeclarations ::= RecordBodyDeclarations..."); } //$NON-NLS-1$ consumeRecordBodyDeclarations(); break; - case 348 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= ClassBodyDeclaration"); } //$NON-NLS-1$ + case 350 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= ClassBodyDeclaration"); } //$NON-NLS-1$ consumeRecordBodyDeclaration(); break; - case 349 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= CompactConstructorDeclaration"); } //$NON-NLS-1$ + case 351 : if (DEBUG) { System.out.println("RecordBodyDeclaration ::= CompactConstructorDeclaration"); } //$NON-NLS-1$ consumeRecordBodyDeclaration(); break; - case 350 : if (DEBUG) { System.out.println("CompactConstructorDeclaration ::=..."); } //$NON-NLS-1$ + case 352 : if (DEBUG) { System.out.println("CompactConstructorDeclaration ::=..."); } //$NON-NLS-1$ consumeCompactConstructorDeclaration(); break; - case 351 : if (DEBUG) { System.out.println("CompactConstructorHeader ::=..."); } //$NON-NLS-1$ + case 353 : if (DEBUG) { System.out.println("CompactConstructorHeader ::=..."); } //$NON-NLS-1$ consumeCompactConstructorHeader(); break; - case 352 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ + case 354 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ consumeCompactConstructorHeaderName(); break; - case 353 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ + case 355 : if (DEBUG) { System.out.println("CompactConstructorHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ consumeCompactConstructorHeaderNameWithTypeParameters(); break; - case 355 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression..."); } //$NON-NLS-1$ + case 357 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression..."); } //$NON-NLS-1$ consumeInstanceOfExpression(); break; - case 357 : if (DEBUG) { System.out.println("InstanceofRHS -> InstanceofPattern"); } //$NON-NLS-1$ + case 359 : if (DEBUG) { System.out.println("InstanceofRHS -> InstanceofPattern"); } //$NON-NLS-1$ consumeInstanceOfRHS(); break; - case 358 : if (DEBUG) { System.out.println("InstanceofClassic ::= instanceof Modifiersopt Type"); } //$NON-NLS-1$ + case 360 : if (DEBUG) { System.out.println("InstanceofClassic ::= instanceof Modifiersopt Type"); } //$NON-NLS-1$ consumeInstanceOfClassic(); break; - case 359 : if (DEBUG) { System.out.println("InstanceofPattern ::= instanceof Pattern"); } //$NON-NLS-1$ + case 361 : if (DEBUG) { System.out.println("InstanceofPattern ::= instanceof Pattern"); } //$NON-NLS-1$ consumeInstanceofPattern(); break; - case 361 : if (DEBUG) { System.out.println("Pattern -> RecordPattern"); } //$NON-NLS-1$ + case 363 : if (DEBUG) { System.out.println("Pattern -> RecordPattern"); } //$NON-NLS-1$ consumePattern(); break; - case 362 : if (DEBUG) { System.out.println("TypePattern ::= Modifiersopt Type Identifier"); } //$NON-NLS-1$ + case 364 : if (DEBUG) { System.out.println("TypePattern ::= Modifiersopt Type Identifier"); } //$NON-NLS-1$ consumeTypePattern(); break; - case 363 : if (DEBUG) { System.out.println("TypePattern ::= Modifiersopt Type UNDERSCORE"); } //$NON-NLS-1$ + case 365 : if (DEBUG) { System.out.println("TypePattern ::= Modifiersopt Type UNDERSCORE"); } //$NON-NLS-1$ consumeTypePattern(); break; - case 364 : if (DEBUG) { System.out.println("RecordPattern ::= Modifiersopt ReferenceType PushLPAREN"); } //$NON-NLS-1$ + case 366 : if (DEBUG) { System.out.println("RecordPattern ::= Modifiersopt ReferenceType PushLPAREN"); } //$NON-NLS-1$ consumeRecordPattern(); break; - case 365 : if (DEBUG) { System.out.println("ComponentPatternListopt ::="); } //$NON-NLS-1$ + case 367 : if (DEBUG) { System.out.println("ComponentPatternListopt ::="); } //$NON-NLS-1$ consumePatternListopt(); break; - case 368 : if (DEBUG) { System.out.println("ComponentPatternList ::= ComponentPatternList COMMA..."); } //$NON-NLS-1$ + case 370 : if (DEBUG) { System.out.println("ComponentPatternList ::= ComponentPatternList COMMA..."); } //$NON-NLS-1$ consumePatternList(); break; - case 376 : if (DEBUG) { System.out.println("StringTemplateExpression ::= Name DOT TemplateArgument"); } //$NON-NLS-1$ + case 378 : if (DEBUG) { System.out.println("StringTemplateExpression ::= Name DOT TemplateArgument"); } //$NON-NLS-1$ consumeTemplateExpressionWithName(); break; - case 377 : if (DEBUG) { System.out.println("StringTemplateExpression ::= Primary DOT..."); } //$NON-NLS-1$ + case 379 : if (DEBUG) { System.out.println("StringTemplateExpression ::= Primary DOT..."); } //$NON-NLS-1$ consumeTemplateExpressionWithPrimary(); break; - case 378 : if (DEBUG) { System.out.println("UnnamedPattern ::= UNDERSCORE"); } //$NON-NLS-1$ + case 380 : if (DEBUG) { System.out.println("UnnamedPattern ::= UNDERSCORE"); } //$NON-NLS-1$ consumeUnnamedPattern(); break; - case 380 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$ + case 382 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$ consumePushLeftBrace(); break; - case 381 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$ + case 383 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$ consumeEmptyArrayInitializer(); break; - case 382 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ + case 384 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ consumeArrayInitializer(); break; - case 383 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ + case 385 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ consumeArrayInitializer(); break; - case 385 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$ + case 387 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$ consumeVariableInitializers(); break; - case 386 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$ + case 388 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$ consumeBlock(); break; - case 387 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$ + case 389 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$ consumeOpenBlock() ; break; - case 388 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$ + case 390 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$ consumeBlockStatement() ; break; - case 389 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$ + case 391 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$ consumeBlockStatements() ; break; - case 397 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$ + case 399 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$ consumeInvalidInterfaceDeclaration(); break; - case 398 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$ + case 400 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$ consumeInvalidAnnotationTypeDeclaration(); break; - case 399 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$ + case 401 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$ consumeInvalidEnumDeclaration(); break; - case 400 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$ + case 402 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$ consumeLocalVariableDeclarationStatement(); break; - case 401 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$ + case 403 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$ consumeLocalVariableDeclaration(); break; - case 402 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$ + case 404 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$ consumeLocalVariableDeclaration(); break; - case 403 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$ + case 405 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$ consumePushModifiers(); break; - case 404 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$ + case 406 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$ consumePushModifiersForHeader(); break; - case 405 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$ + case 407 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$ consumePushRealModifiers(); break; - case 433 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$ + case 435 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$ consumeEmptyStatement(); break; - case 434 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$ + case 436 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$ consumeStatementLabel() ; break; - case 435 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$ + case 437 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$ consumeStatementLabel() ; break; - case 436 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$ + case 438 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$ consumeLabel() ; break; - case 437 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$ + case 439 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$ consumeExpressionStatement(); break; - case 446 : if (DEBUG) { System.out.println("PostExpressionInSwitchStatement ::="); } //$NON-NLS-1$ + case 448 : if (DEBUG) { System.out.println("PostExpressionInSwitchStatement ::="); } //$NON-NLS-1$ consumePostExpressionInSwitch(true); break; - case 447 : if (DEBUG) { System.out.println("PostExpressionInSwitchExpression ::="); } //$NON-NLS-1$ + case 449 : if (DEBUG) { System.out.println("PostExpressionInSwitchExpression ::="); } //$NON-NLS-1$ consumePostExpressionInSwitch(false); break; - case 448 : if (DEBUG) { System.out.println("PostExpressionInIf ::="); } //$NON-NLS-1$ + case 450 : if (DEBUG) { System.out.println("PostExpressionInIf ::="); } //$NON-NLS-1$ consumePostExpressionInIf(); break; - case 449 : if (DEBUG) { System.out.println("PostExpressionInWhile ::="); } //$NON-NLS-1$ + case 451 : if (DEBUG) { System.out.println("PostExpressionInWhile ::="); } //$NON-NLS-1$ consumePostExpressionInWhile(); break; - case 450 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 452 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementIfNoElse(); break; - case 451 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 453 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementIfWithElse(); break; - case 452 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$ + case 454 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$ consumeStatementIfWithElse(); break; - case 453 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 455 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementSwitch() ; break; - case 454 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$ + case 456 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$ consumeEmptySwitchBlock() ; break; - case 457 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$ + case 459 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$ consumeSwitchBlock() ; break; - case 459 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$ + case 461 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$ consumeSwitchBlockStatements() ; break; - case 461 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$ + case 463 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$ consumeSwitchBlockStatement() ; break; - case 463 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$ + case 465 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$ consumeSwitchLabels() ; break; - case 464 : if (DEBUG) { System.out.println("SwitchLabel ::= SwitchLabelCaseLhs COLON"); } //$NON-NLS-1$ + case 466 : if (DEBUG) { System.out.println("SwitchLabel ::= SwitchLabelCaseLhs COLON"); } //$NON-NLS-1$ consumeCaseLabel(); break; - case 465 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$ + case 467 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$ consumeDefaultLabel(); break; - case 468 : if (DEBUG) { System.out.println("SwitchExpression ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 470 : if (DEBUG) { System.out.println("SwitchExpression ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeSwitchExpression() ; break; - case 471 : if (DEBUG) { System.out.println("SwitchLabeledRule ::= SwitchLabeledThrowStatement"); } //$NON-NLS-1$ + case 473 : if (DEBUG) { System.out.println("SwitchLabeledRule ::= SwitchLabeledThrowStatement"); } //$NON-NLS-1$ consumeSwitchLabeledRule(); break; - case 472 : if (DEBUG) { System.out.println("SwitchLabeledExpression ::= SwitchLabelExpr Expression"); } //$NON-NLS-1$ + case 474 : if (DEBUG) { System.out.println("SwitchLabeledExpression ::= SwitchLabelExpr Expression"); } //$NON-NLS-1$ consumeSwitchLabeledExpression(); break; - case 473 : if (DEBUG) { System.out.println("SwitchLabeledBlock ::= SwitchLabelExpr Block"); } //$NON-NLS-1$ + case 475 : if (DEBUG) { System.out.println("SwitchLabeledBlock ::= SwitchLabelExpr Block"); } //$NON-NLS-1$ consumeSwitchLabeledBlock(); break; - case 474 : if (DEBUG) { System.out.println("SwitchLabeledThrowStatement ::= SwitchLabelExpr..."); } //$NON-NLS-1$ + case 476 : if (DEBUG) { System.out.println("SwitchLabeledThrowStatement ::= SwitchLabelExpr..."); } //$NON-NLS-1$ consumeSwitchLabeledThrowStatement(); break; - case 475 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= default ARROW"); } //$NON-NLS-1$ + case 477 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= default ARROW"); } //$NON-NLS-1$ consumeDefaultLabelExpr(); break; - case 476 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= SwitchLabelCaseLhs BeginCaseExpr..."); } //$NON-NLS-1$ + case 478 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= SwitchLabelCaseLhs BeginCaseExpr..."); } //$NON-NLS-1$ consumeCaseLabelExpr(); break; - case 477 : if (DEBUG) { System.out.println("SwitchLabelCaseLhs ::= case CaseLabelElements"); } //$NON-NLS-1$ + case 479 : if (DEBUG) { System.out.println("SwitchLabelCaseLhs ::= case CaseLabelElements"); } //$NON-NLS-1$ consumeSwitchLabelCaseLhs(); break; - case 479 : if (DEBUG) { System.out.println("CaseLabelElements ::= CaseLabelElements COMMA..."); } //$NON-NLS-1$ + case 481 : if (DEBUG) { System.out.println("CaseLabelElements ::= CaseLabelElements COMMA..."); } //$NON-NLS-1$ consumeCaseLabelElements(); break; - case 480 : if (DEBUG) { System.out.println("CaseLabelElement ::= ConstantExpression"); } //$NON-NLS-1$ + case 482 : if (DEBUG) { System.out.println("CaseLabelElement ::= ConstantExpression"); } //$NON-NLS-1$ consumeCaseLabelElement(CaseLabelKind.CASE_EXPRESSION); break; - case 481 : if (DEBUG) { System.out.println("CaseLabelElement ::= default"); } //$NON-NLS-1$ + case 483 : if (DEBUG) { System.out.println("CaseLabelElement ::= default"); } //$NON-NLS-1$ consumeCaseLabelElement(CaseLabelKind.CASE_DEFAULT); break; - case 482 : if (DEBUG) { System.out.println("CaseLabelElement ::= CaseLabelElementPattern"); } //$NON-NLS-1$ + case 484 : if (DEBUG) { System.out.println("CaseLabelElement ::= CaseLabelElementPattern"); } //$NON-NLS-1$ consumeCaseLabelElement(CaseLabelKind.CASE_PATTERN); break; - case 483 : if (DEBUG) { System.out.println("CaseLabelElement ::= CaseLabelElementPattern Guard"); } //$NON-NLS-1$ + case 485 : if (DEBUG) { System.out.println("CaseLabelElement ::= CaseLabelElementPattern Guard"); } //$NON-NLS-1$ consumeCaseLabelElement(CaseLabelKind.CASE_PATTERN); break; - case 484 : if (DEBUG) { System.out.println("CaseLabelElementPattern ::= BeginCaseElement Pattern"); } //$NON-NLS-1$ + case 486 : if (DEBUG) { System.out.println("CaseLabelElementPattern ::= BeginCaseElement Pattern"); } //$NON-NLS-1$ consumeCaseLabelElementPattern(); break; - case 485 : if (DEBUG) { System.out.println("Guard ::= RestrictedIdentifierWhen Expression"); } //$NON-NLS-1$ + case 487 : if (DEBUG) { System.out.println("Guard ::= RestrictedIdentifierWhen Expression"); } //$NON-NLS-1$ consumeGuard(); break; - case 486 : if (DEBUG) { System.out.println("YieldStatement ::= RestrictedIdentifierYield Expression"); } //$NON-NLS-1$ + case 488 : if (DEBUG) { System.out.println("YieldStatement ::= RestrictedIdentifierYield Expression"); } //$NON-NLS-1$ consumeStatementYield() ; break; - case 487 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 489 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementWhile() ; break; - case 488 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$ + case 490 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$ consumeStatementWhile() ; break; - case 489 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$ + case 491 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$ consumeStatementDo() ; break; - case 490 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$ + case 492 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$ consumeStatementFor() ; break; - case 491 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$ + case 493 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$ consumeStatementFor() ; break; - case 492 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$ + case 494 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$ consumeForInit() ; break; - case 496 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$ + case 498 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$ consumeStatementExpressionList() ; break; - case 497 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$ + case 499 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$ consumeSimpleAssertStatement() ; break; - case 498 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$ + case 500 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$ consumeAssertStatement() ; break; - case 499 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$ + case 501 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$ consumeStatementBreak() ; break; - case 500 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$ + case 502 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$ consumeStatementBreakWithLabel() ; break; - case 501 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$ + case 503 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$ consumeStatementContinue() ; break; - case 502 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$ + case 504 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$ consumeStatementContinueWithLabel() ; break; - case 503 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$ + case 505 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$ consumeStatementReturn() ; break; - case 504 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$ + case 506 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$ consumeStatementThrow(); break; - case 505 : if (DEBUG) { System.out.println("ThrowExpression ::= throw Expression"); } //$NON-NLS-1$ + case 507 : if (DEBUG) { System.out.println("ThrowExpression ::= throw Expression"); } //$NON-NLS-1$ consumeThrowExpression() ; break; - case 506 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$ + case 508 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$ consumeStatementSynchronized(); break; - case 507 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$ + case 509 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$ consumeOnlySynchronized(); break; - case 508 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$ + case 510 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$ consumeStatementTry(false, false); break; - case 509 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$ + case 511 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$ consumeStatementTry(true, false); break; - case 510 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ + case 512 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ consumeStatementTry(false, true); break; - case 511 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ + case 513 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ consumeStatementTry(true, true); break; - case 512 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$ + case 514 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$ consumeResourceSpecification(); break; - case 513 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$ + case 515 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$ consumeResourceOptionalTrailingSemiColon(false); break; - case 514 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$ + case 516 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$ consumeResourceOptionalTrailingSemiColon(true); break; - case 515 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$ + case 517 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$ consumeSingleResource(); break; - case 516 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$ + case 518 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$ consumeMultipleResources(); break; - case 517 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$ + case 519 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$ consumeResourceOptionalTrailingSemiColon(true); break; - case 518 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$ + case 520 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$ consumeResourceAsLocalVariableDeclaration(); break; - case 519 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$ + case 521 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$ consumeResourceAsLocalVariableDeclaration(); break; - case 520 : if (DEBUG) { System.out.println("Resource ::= Name"); } //$NON-NLS-1$ + case 522 : if (DEBUG) { System.out.println("Resource ::= Name"); } //$NON-NLS-1$ consumeResourceAsLocalVariable(); break; - case 521 : if (DEBUG) { System.out.println("Resource ::= this"); } //$NON-NLS-1$ + case 523 : if (DEBUG) { System.out.println("Resource ::= this"); } //$NON-NLS-1$ consumeResourceAsThis(); break; - case 522 : if (DEBUG) { System.out.println("Resource ::= FieldAccess"); } //$NON-NLS-1$ + case 524 : if (DEBUG) { System.out.println("Resource ::= FieldAccess"); } //$NON-NLS-1$ consumeResourceAsFieldAccess(); break; - case 524 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$ + case 526 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$ consumeExitTryBlock(); break; - case 526 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$ + case 528 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$ consumeCatches(); break; - case 527 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ + case 529 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ consumeStatementCatch() ; break; - case 529 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$ + case 531 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$ consumeLeftParen(); break; - case 530 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$ + case 532 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$ consumeRightParen(); break; - case 535 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$ + case 537 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$ consumePrimaryNoNewArrayThis(); break; - case 536 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$ + case 538 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$ consumePrimaryNoNewArray(); break; - case 537 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$ + case 539 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$ consumePrimaryNoNewArrayWithName(); break; - case 540 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$ + case 542 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$ consumePrimaryNoNewArrayNameThis(); break; - case 541 : if (DEBUG) { System.out.println("QualifiedSuperReceiver ::= Name DOT super"); } //$NON-NLS-1$ + case 543 : if (DEBUG) { System.out.println("QualifiedSuperReceiver ::= Name DOT super"); } //$NON-NLS-1$ consumeQualifiedSuperReceiver(); break; - case 542 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$ + case 544 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayName(); break; - case 543 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$ + case 545 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayArrayType(); break; - case 544 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$ + case 546 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayPrimitiveArrayType(); break; - case 545 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$ + case 547 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayPrimitiveType(); break; - case 551 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ + case 553 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ consumeReferenceExpressionTypeArgumentsAndTrunk(false); break; - case 552 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ + case 554 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ consumeReferenceExpressionTypeArgumentsAndTrunk(true); break; - case 553 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$ + case 555 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$ consumeReferenceExpressionTypeForm(true); break; - case 554 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$ + case 556 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$ consumeReferenceExpressionTypeForm(false); break; - case 555 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$ + case 557 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$ consumeReferenceExpressionGenericTypeForm(); break; - case 556 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$ + case 558 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$ consumeReferenceExpressionPrimaryForm(); break; - case 557 : if (DEBUG) { System.out.println("ReferenceExpression ::= QualifiedSuperReceiver..."); } //$NON-NLS-1$ + case 559 : if (DEBUG) { System.out.println("ReferenceExpression ::= QualifiedSuperReceiver..."); } //$NON-NLS-1$ consumeReferenceExpressionPrimaryForm(); break; - case 558 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$ + case 560 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$ consumeReferenceExpressionSuperForm(); break; - case 559 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$ + case 561 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$ consumeEmptyTypeArguments(); break; - case 561 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$ + case 563 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$ consumeIdentifierOrNew(false); break; - case 562 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$ + case 564 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$ consumeIdentifierOrNew(true); break; - case 563 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$ + case 565 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$ consumeLambdaExpression(); break; - case 564 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$ + case 566 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$ consumeNestedLambda(); break; - case 565 : if (DEBUG) { System.out.println("LambdaParameters ::= UNDERSCORE NestedLambda"); } //$NON-NLS-1$ + case 567 : if (DEBUG) { System.out.println("LambdaParameters ::= UNDERSCORE NestedLambda"); } //$NON-NLS-1$ consumeTypeElidedLambdaParameter(false); break; - case 566 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$ + case 568 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$ consumeTypeElidedLambdaParameter(false); break; - case 572 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$ + case 574 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$ consumeFormalParameterList(); break; - case 573 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$ + case 575 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$ consumeTypeElidedLambdaParameter(true); break; - case 574 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= UNDERSCORE"); } //$NON-NLS-1$ + case 576 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= UNDERSCORE"); } //$NON-NLS-1$ consumeBracketedTypeElidedUnderscoreLambdaParameter(); break; - case 577 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$ + case 579 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$ consumeElidedLeftBraceAndReturn(); break; - case 578 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$ + case 580 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$ consumeAllocationHeader(); break; - case 579 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$ + case 581 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionWithTypeArguments(); break; - case 580 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$ + case 582 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpression(); break; - case 581 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ + case 583 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; break; - case 582 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ + case 584 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualified() ; break; - case 583 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ + case 585 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualified() ; break; - case 584 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ + case 586 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; break; - case 585 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$ + case 587 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$ consumeEnterInstanceCreationArgumentList(); break; - case 586 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$ + case 588 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionName() ; break; - case 587 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$ + case 589 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$ consumeClassBodyopt(); break; - case 589 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ + case 591 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ consumeEnterAnonymousClassBody(false); break; - case 590 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$ + case 592 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$ consumeClassBodyopt(); break; - case 592 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ + case 594 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ consumeEnterAnonymousClassBody(true); break; - case 594 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$ + case 596 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$ consumeArgumentList(); break; - case 595 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$ + case 597 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$ consumeArrayCreationHeader(); break; - case 596 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$ + case 598 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$ consumeArrayCreationHeader(); break; - case 597 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ + case 599 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ consumeArrayCreationExpressionWithoutInitializer(); break; - case 598 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$ + case 600 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$ consumeArrayCreationExpressionWithInitializer(); break; - case 599 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ + case 601 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ consumeArrayCreationExpressionWithoutInitializer(); break; - case 600 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$ + case 602 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$ consumeArrayCreationExpressionWithInitializer(); break; - case 602 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$ + case 604 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$ consumeDimWithOrWithOutExprs(); break; - case 604 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$ + case 606 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$ consumeDimWithOrWithOutExpr(); break; - case 605 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$ + case 607 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$ consumeDims(); break; - case 608 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ + case 610 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ consumeOneDimLoop(false); break; - case 609 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$ + case 611 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$ consumeOneDimLoop(true); break; - case 610 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$ + case 612 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$ consumeFieldAccess(false); break; - case 611 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$ + case 613 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$ consumeFieldAccess(true); break; - case 612 : if (DEBUG) { System.out.println("FieldAccess ::= QualifiedSuperReceiver DOT Identifier"); } //$NON-NLS-1$ + case 614 : if (DEBUG) { System.out.println("FieldAccess ::= QualifiedSuperReceiver DOT Identifier"); } //$NON-NLS-1$ consumeFieldAccess(false); break; - case 613 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ + case 615 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ consumeMethodInvocationName(); break; - case 614 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$ + case 616 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$ consumeMethodInvocationNameWithTypeArguments(); break; - case 615 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$ + case 617 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$ consumeMethodInvocationPrimaryWithTypeArguments(); break; - case 616 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$ + case 618 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$ consumeMethodInvocationPrimary(); break; - case 617 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ + case 619 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ consumeMethodInvocationPrimary(); break; - case 618 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ + case 620 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ consumeMethodInvocationPrimaryWithTypeArguments(); break; - case 619 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$ + case 621 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$ consumeMethodInvocationSuperWithTypeArguments(); break; - case 620 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$ + case 622 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$ consumeMethodInvocationSuper(); break; - case 621 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$ + case 623 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$ consumeArrayAccess(true); break; - case 622 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$ + case 624 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$ consumeArrayAccess(false); break; - case 623 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$ + case 625 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$ consumeArrayAccess(false); break; - case 625 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$ + case 627 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$ consumePostfixExpression(); break; - case 628 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$ + case 630 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS,true); break; - case 629 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$ + case 631 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS,true); break; - case 630 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$ + case 632 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$ consumePushPosition(); break; - case 633 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$ + case 635 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS); break; - case 634 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$ + case 636 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS); break; - case 636 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$ + case 638 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS,false); break; - case 637 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$ + case 639 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS,false); break; - case 639 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$ + case 641 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.TWIDDLE); break; - case 640 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$ + case 642 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.NOT); break; - case 642 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$ + case 644 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$ consumeCastExpressionWithPrimitiveType(); break; - case 643 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ + case 645 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ consumeCastExpressionWithGenericsArray(); break; - case 644 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ + case 646 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ consumeCastExpressionWithQualifiedGenericsArray(); break; - case 645 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$ + case 647 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$ consumeCastExpressionLL1(); break; - case 646 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$ + case 648 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$ consumeCastExpressionLL1WithBounds(); break; - case 647 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$ + case 649 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$ consumeCastExpressionWithNameArray(); break; - case 648 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$ + case 650 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$ consumeZeroAdditionalBounds(); break; - case 652 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$ + case 654 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$ consumeOnlyTypeArgumentsForCastExpression(); break; - case 653 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$ + case 655 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$ consumeInsideCastExpression(); break; - case 654 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$ + case 656 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$ consumeInsideCastExpressionLL1(); break; - case 655 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$ + case 657 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$ consumeInsideCastExpressionLL1WithBounds (); break; - case 656 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$ + case 658 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$ consumeInsideCastExpressionWithQualifiedGenerics(); break; - case 658 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ + case 660 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MULTIPLY); break; - case 659 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ + case 661 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.DIVIDE); break; - case 660 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ + case 662 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.REMAINDER); break; - case 662 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$ + case 664 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.PLUS); break; - case 663 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$ + case 665 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MINUS); break; - case 665 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$ + case 667 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LEFT_SHIFT); break; - case 666 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$ + case 668 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); break; - case 667 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ + case 669 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); break; - case 669 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$ + case 671 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS); break; - case 670 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$ + case 672 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER); break; - case 671 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$ + case 673 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS_EQUAL); break; - case 672 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$ + case 674 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER_EQUAL); break; - case 674 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$ + case 676 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); break; - case 675 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$ + case 677 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.NOT_EQUAL); break; - case 677 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$ + case 679 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND); break; - case 679 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$ + case 681 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.XOR); break; - case 681 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$ + case 683 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR); break; - case 683 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$ + case 685 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND_AND); break; - case 685 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ + case 687 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR_OR); break; - case 687 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ + case 689 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; break; - case 690 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$ + case 692 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$ consumeAssignment(); break; - case 692 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$ + case 694 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$ ignoreExpressionAssignment(); break; - case 693 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$ + case 695 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(EQUAL); break; - case 694 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$ + case 696 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(MULTIPLY); break; - case 695 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$ + case 697 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(DIVIDE); break; - case 696 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$ + case 698 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(REMAINDER); break; - case 697 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$ + case 699 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(PLUS); break; - case 698 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$ + case 700 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(MINUS); break; - case 699 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$ + case 701 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(LEFT_SHIFT); break; - case 700 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ + case 702 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(RIGHT_SHIFT); break; - case 701 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ + case 703 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); break; - case 702 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$ + case 704 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(AND); break; - case 703 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$ + case 705 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(XOR); break; - case 704 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$ + case 706 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(OR); break; - case 705 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$ + case 707 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$ consumeExpression(); break; - case 708 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$ + case 710 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$ consumeEmptyExpression(); break; - case 713 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$ + case 715 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyClassBodyDeclarationsopt(); break; - case 714 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ + case 716 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ consumeClassBodyDeclarationsopt(); break; - case 715 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$ + case 717 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$ consumeDefaultModifiers(); break; - case 716 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$ + case 718 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$ consumeModifiers(); break; - case 717 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$ + case 719 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$ consumeEmptyBlockStatementsopt(); break; - case 719 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$ + case 721 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$ consumeEmptyDimsopt(); break; - case 721 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$ + case 723 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$ consumeEmptyArgumentListopt(); break; - case 725 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$ + case 727 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$ consumeFormalParameterListopt(); break; - case 732 : if (DEBUG) { System.out.println("ClassHeaderPermittedSubclasses ::=..."); } //$NON-NLS-1$ + case 734 : if (DEBUG) { System.out.println("ClassHeaderPermittedSubclasses ::=..."); } //$NON-NLS-1$ consumeClassHeaderPermittedSubclasses(); break; - case 735 : if (DEBUG) { System.out.println("InterfaceHeaderPermittedSubClassesAndSubInterfaces ::="); } //$NON-NLS-1$ + case 737 : if (DEBUG) { System.out.println("InterfaceHeaderPermittedSubClassesAndSubInterfaces ::="); } //$NON-NLS-1$ consumeInterfaceHeaderPermittedSubClassesAndSubInterfaces(); break; - case 736 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$ + case 738 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyInterfaceMemberDeclarationsopt(); break; - case 737 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ + case 739 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ consumeInterfaceMemberDeclarationsopt(); break; - case 738 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$ + case 740 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$ consumeNestedType(); break; - case 739 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$ + case 741 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$ consumeEmptyForInitopt(); break; - case 741 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$ + case 743 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$ consumeEmptyForUpdateopt(); break; - case 745 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$ + case 747 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$ consumeEmptyCatchesopt(); break; - case 747 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$ + case 749 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$ consumeEnumDeclaration(); break; - case 748 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$ + case 750 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$ consumeEnumHeader(); break; - case 749 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$ + case 751 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$ consumeEnumHeaderName(); break; - case 750 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$ + case 752 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$ consumeEnumHeaderNameWithTypeParameters(); break; - case 751 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$ + case 753 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$ consumeEnumBodyNoConstants(); break; - case 752 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$ + case 754 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$ consumeEnumBodyNoConstants(); break; - case 753 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$ + case 755 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$ consumeEnumBodyWithConstants(); break; - case 754 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$ + case 756 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$ consumeEnumBodyWithConstants(); break; - case 756 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$ + case 758 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$ consumeEnumConstants(); break; - case 757 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ + case 759 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ consumeEnumConstantHeaderName(); break; - case 758 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$ + case 760 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$ consumeEnumConstantHeader(); break; - case 759 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$ + case 761 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$ consumeEnumConstantWithClassBody(); break; - case 760 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$ + case 762 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$ consumeEnumConstantNoClassBody(); break; - case 761 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ + case 763 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ consumeArguments(); break; - case 762 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$ + case 764 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$ consumeEmptyArguments(); break; - case 764 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$ + case 766 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$ consumeEnumDeclarations(); break; - case 765 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$ + case 767 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyEnumDeclarations(); break; - case 767 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$ + case 769 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$ consumeEnhancedForStatement(); break; - case 768 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$ + case 770 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$ consumeEnhancedForStatement(); break; - case 769 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$ + case 771 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$ consumeEnhancedForStatementHeaderInit(false); break; - case 770 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$ + case 772 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$ consumeEnhancedForStatementHeaderInit(true); break; - case 771 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$ + case 773 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$ consumeEnhancedForStatementHeader(); break; - case 772 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$ + case 774 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$ consumeImportDeclaration(); break; - case 773 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$ + case 775 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$ consumeSingleStaticImportDeclarationName(); break; - case 774 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ + case 776 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ consumeImportDeclaration(); break; - case 775 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$ + case 777 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$ consumeStaticImportOnDemandDeclarationName(); break; - case 776 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ + case 778 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ consumeTypeArguments(); break; - case 777 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ + case 779 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ consumeOnlyTypeArguments(); break; - case 779 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ + case 781 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ consumeTypeArgumentList1(); break; - case 781 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$ + case 783 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$ consumeTypeArgumentList(); break; - case 782 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$ + case 784 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$ consumeTypeArgument(); break; - case 786 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$ + case 788 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$ consumeReferenceType1(); break; - case 787 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ + case 789 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ consumeTypeArgumentReferenceType1(); break; - case 789 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ + case 791 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ consumeTypeArgumentList2(); break; - case 792 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$ + case 794 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$ consumeReferenceType2(); break; - case 793 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ + case 795 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ consumeTypeArgumentReferenceType2(); break; - case 795 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ + case 797 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ consumeTypeArgumentList3(); break; - case 798 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ + case 800 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ consumeReferenceType3(); break; - case 799 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$ + case 801 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$ consumeWildcard(); break; - case 800 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$ + case 802 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$ consumeWildcardWithBounds(); break; - case 801 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$ + case 803 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$ consumeWildcardBoundsExtends(); break; - case 802 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$ + case 804 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$ consumeWildcardBoundsSuper(); break; - case 803 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$ + case 805 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$ consumeWildcard1(); break; - case 804 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 806 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard1WithBounds(); break; - case 805 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$ + case 807 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$ consumeWildcardBounds1Extends(); break; - case 806 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$ + case 808 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$ consumeWildcardBounds1Super(); break; - case 807 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$ + case 809 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$ consumeWildcard2(); break; - case 808 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 810 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard2WithBounds(); break; - case 809 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$ + case 811 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$ consumeWildcardBounds2Extends(); break; - case 810 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$ + case 812 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$ consumeWildcardBounds2Super(); break; - case 811 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 813 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard3(); break; - case 812 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 814 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard3WithBounds(); break; - case 813 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$ + case 815 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$ consumeWildcardBounds3Extends(); break; - case 814 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$ + case 816 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$ consumeWildcardBounds3Super(); break; - case 815 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt Identifier"); } //$NON-NLS-1$ + case 817 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt Identifier"); } //$NON-NLS-1$ consumeTypeParameterHeader(); break; - case 816 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$ + case 818 : 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$ + case 820 : 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$ + case 822 : 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$ + case 823 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ consumeTypeParameterWithExtendsAndBounds(); break; - case 823 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$ + case 825 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$ consumeAdditionalBoundList(); break; - case 824 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$ + case 826 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$ consumeAdditionalBound(); break; - case 826 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ + case 828 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ consumeTypeParameterList1(); break; - case 827 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$ + case 829 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$ consumeTypeParameter1(); break; - case 828 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ + case 830 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ consumeTypeParameter1WithExtends(); break; - case 829 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ + case 831 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ consumeTypeParameter1WithExtendsAndBounds(); break; - case 831 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$ + case 833 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$ consumeAdditionalBoundList1(); break; - case 832 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$ + case 834 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$ consumeAdditionalBound1(); break; - case 838 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$ + case 840 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS); break; - case 839 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$ + case 841 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS); break; - case 842 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$ + case 844 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.TWIDDLE); break; - case 843 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$ + case 845 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.NOT); break; - case 846 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ + case 848 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MULTIPLY); break; - case 847 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$ + case 849 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.MULTIPLY); break; - case 848 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ + case 850 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.DIVIDE); break; - case 849 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$ + case 851 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.DIVIDE); break; - case 850 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ + case 852 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.REMAINDER); break; - case 851 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$ + case 853 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.REMAINDER); break; - case 853 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ + case 855 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.PLUS); break; - case 854 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$ + case 856 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.PLUS); break; - case 855 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ + case 857 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MINUS); break; - case 856 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$ + case 858 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.MINUS); break; - case 858 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ + case 860 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LEFT_SHIFT); break; - case 859 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$ + case 861 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT); break; - case 860 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ + case 862 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); break; - case 861 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$ + case 863 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT); break; - case 862 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ + case 864 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); break; - case 863 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$ + case 865 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT); break; - case 865 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ + case 867 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS); break; - case 866 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$ + case 868 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.LESS); break; - case 867 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ + case 869 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER); break; - case 868 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$ + case 870 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.GREATER); break; - case 869 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ + case 871 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS_EQUAL); break; - case 870 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$ + case 872 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL); break; - case 871 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ + case 873 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER_EQUAL); break; - case 872 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$ + case 874 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL); break; - case 874 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name InstanceofRHS"); } //$NON-NLS-1$ + case 876 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name InstanceofRHS"); } //$NON-NLS-1$ consumeInstanceOfExpressionWithName(); break; - case 875 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$ + case 877 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$ consumeInstanceOfExpression(); break; - case 877 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ + case 879 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); break; - case 878 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$ + case 880 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL); break; - case 879 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ + case 881 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.NOT_EQUAL); break; - case 880 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$ + case 882 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL); break; - case 882 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$ + case 884 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND); break; - case 883 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$ + case 885 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.AND); break; - case 885 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ + case 887 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.XOR); break; - case 886 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$ + case 888 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.XOR); break; - case 888 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ + case 890 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR); break; - case 889 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$ + case 891 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.OR); break; - case 891 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$ + case 893 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND_AND); break; - case 892 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$ + case 894 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.AND_AND); break; - case 894 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$ + case 896 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR_OR); break; - case 895 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$ + case 897 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.OR_OR); break; - case 897 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$ + case 899 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; break; - case 898 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$ + case 900 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$ consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ; break; - case 902 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ + case 904 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderName() ; break; - case 903 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ + case 905 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; break; - case 904 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ + case 906 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; break; - case 905 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ + case 907 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderName() ; break; - case 906 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ + case 908 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeader() ; break; - case 907 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ + case 909 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclaration() ; break; - case 909 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ + case 911 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyAnnotationTypeMemberDeclarationsopt() ; break; - case 910 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ + case 912 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclarationsopt() ; break; - case 912 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ + case 914 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclarations() ; break; - case 913 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ + case 915 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ consumeMethodHeaderNameWithTypeParameters(true); break; - case 914 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 916 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeMethodHeaderName(true); break; - case 915 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ + case 917 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ consumeEmptyMethodHeaderDefaultValue() ; break; - case 916 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ + case 918 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ consumeMethodHeaderDefaultValue(); break; - case 917 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ + case 919 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 918 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ + case 920 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclaration() ; break; - case 926 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableName"); } //$NON-NLS-1$ + case 928 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableName"); } //$NON-NLS-1$ consumeAnnotationName() ; break; - case 927 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ + case 929 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ consumeNormalAnnotation(false) ; break; - case 928 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ + case 930 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ consumeEmptyMemberValuePairsopt() ; break; - case 931 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ + case 933 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ consumeMemberValuePairs() ; break; - case 932 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ + case 934 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ consumeMemberValuePair() ; break; - case 933 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ + case 935 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ consumeEnterMemberValue() ; break; - case 934 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ + case 936 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ consumeExitMemberValue() ; break; - case 936 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ + case 938 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ consumeMemberValueAsName() ; break; - case 939 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 941 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeMemberValueArrayInitializer() ; break; - case 940 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 942 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeMemberValueArrayInitializer() ; break; - case 941 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 943 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeEmptyMemberValueArrayInitializer() ; break; - case 942 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 944 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeEmptyMemberValueArrayInitializer() ; break; - case 943 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ + case 945 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ consumeEnterMemberValueArrayInitializer() ; break; - case 945 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ + case 947 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ consumeMemberValues() ; break; - case 946 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ + case 948 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ consumeMarkerAnnotation(false) ; break; - case 947 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$ + case 949 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$ consumeSingleMemberAnnotationMemberValue() ; break; - case 948 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ + case 950 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ consumeSingleMemberAnnotation(false) ; break; - case 949 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ + case 951 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ consumeRecoveryMethodHeaderNameWithTypeParameters(); break; - case 950 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 952 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeRecoveryMethodHeaderName(); break; - case 951 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$ + case 953 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$ consumeRecoveryMethodHeaderNameWithTypeParameters(); break; - case 952 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$ + case 954 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$ consumeRecoveryMethodHeaderName(); break; - case 953 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ + case 955 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 954 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ + case 956 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; } @@ -14247,6 +14308,9 @@ public int automatonState() { return this.stack[this.stateStackTop]; } public boolean automatonWillShift(int token, int lastAction) { + if (lastAction == ERROR_ACTION) { + return false; + } 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; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java index 403e15bdf15..d9e5e94b301 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java @@ -22,20 +22,20 @@ public interface ParserBasicInformation { ERROR_SYMBOL = 140, MAX_NAME_LENGTH = 53, - NUM_STATES = 1248, + NUM_STATES = 1262, NT_OFFSET = 140, SCOPE_UBOUND = 321, SCOPE_SIZE = 322, - LA_STATE_OFFSET = 18335, + LA_STATE_OFFSET = 18370, MAX_LA = 1, - NUM_RULES = 954, + NUM_RULES = 956, NUM_TERMINALS = 140, - NUM_NON_TERMINALS = 439, - NUM_SYMBOLS = 579, - START_STATE = 1002, - EOFT_SYMBOL = 64, - EOLT_SYMBOL = 64, - ACCEPT_ACTION = 18334, - ERROR_ACTION = 18335; + NUM_NON_TERMINALS = 440, + NUM_SYMBOLS = 580, + START_STATE = 1508, + EOFT_SYMBOL = 38, + EOLT_SYMBOL = 38, + ACCEPT_ACTION = 18369, + ERROR_ACTION = 18370; } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java index a4a8ec6fb0f..dcc1f2bb6df 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java @@ -72,7 +72,7 @@ static int getRestrictedKeyword(String text) { // BEGIN_AUTOGENERATED_REGION int TokenNameIdentifier = 22, - TokenNameabstract = 42, + TokenNameabstract = 44, TokenNameassert = 82, TokenNameboolean = 106, TokenNamebreak = 83, @@ -86,11 +86,11 @@ static int getRestrictedKeyword(String text) { TokenNamedefault = 77, TokenNamedo = 85, TokenNamedouble = 110, - TokenNameelse = 124, + TokenNameelse = 123, TokenNameenum = 75, TokenNameextends = 93, - TokenNamefalse = 55, - TokenNamefinal = 43, + TokenNamefalse = 56, + TokenNamefinal = 45, TokenNamefinally = 117, TokenNamefloat = 111, TokenNamefor = 86, @@ -102,32 +102,32 @@ static int getRestrictedKeyword(String text) { TokenNameint = 113, TokenNameinterface = 74, TokenNamelong = 114, - TokenNamenative = 44, + TokenNamenative = 46, TokenNamenew = 40, - TokenNamenon_sealed = 45, - TokenNamenull = 56, + TokenNamenon_sealed = 47, + TokenNamenull = 57, TokenNamepackage = 91, - TokenNameprivate = 46, - TokenNameprotected = 47, - TokenNamepublic = 48, + TokenNameprivate = 48, + TokenNameprotected = 49, + TokenNamepublic = 50, TokenNamereturn = 88, TokenNameshort = 115, - TokenNamestatic = 36, - TokenNamestrictfp = 49, - TokenNamesuper = 37, + TokenNamestatic = 39, + TokenNamestrictfp = 51, + TokenNamesuper = 36, TokenNameswitch = 65, - TokenNamesynchronized = 39, - TokenNamethis = 38, + TokenNamesynchronized = 41, + TokenNamethis = 37, TokenNamethrow = 79, TokenNamethrows = 118, - TokenNametransient = 50, - TokenNametrue = 57, + TokenNametransient = 52, + TokenNametrue = 58, TokenNametry = 89, TokenNamevoid = 116, - TokenNamevolatile = 51, + TokenNamevolatile = 53, TokenNamewhile = 80, TokenNamemodule = 119, - TokenNameopen = 120, + TokenNameopen = 124, TokenNamerequires = 125, TokenNametransitive = 131, TokenNameexports = 126, @@ -136,15 +136,15 @@ static int getRestrictedKeyword(String text) { TokenNameuses = 128, TokenNameprovides = 129, TokenNamewith = 137, - TokenNameIntegerLiteral = 58, - TokenNameLongLiteral = 59, - TokenNameFloatingPointLiteral = 60, - TokenNameDoubleLiteral = 61, - TokenNameCharacterLiteral = 62, - TokenNameStringLiteral = 53, - TokenNameTextBlock = 54, - TokenNameStringTemplate = 121, - TokenNameTextBlockTemplate = 122, + TokenNameIntegerLiteral = 59, + TokenNameLongLiteral = 60, + TokenNameFloatingPointLiteral = 61, + TokenNameDoubleLiteral = 62, + TokenNameCharacterLiteral = 63, + TokenNameStringLiteral = 54, + TokenNameTextBlock = 55, + TokenNameStringTemplate = 120, + TokenNameTextBlockTemplate = 121, TokenNamePLUS_PLUS = 2, TokenNameMINUS_MINUS = 3, TokenNameEQUAL_EQUAL = 19, @@ -181,7 +181,7 @@ static int getRestrictedKeyword(String text) { TokenNameLESS = 11, TokenNameLPAREN = 24, TokenNameRPAREN = 25, - TokenNameLBRACE = 52, + TokenNameLBRACE = 42, TokenNameRBRACE = 33, TokenNameLBRACKET = 6, TokenNameRBRACKET = 69, @@ -192,10 +192,10 @@ static int getRestrictedKeyword(String text) { TokenNameDOT = 1, TokenNameEQUAL = 78, TokenNameAT = 35, - TokenNameELLIPSIS = 123, + TokenNameELLIPSIS = 122, TokenNameARROW = 105, TokenNameCOLON_COLON = 7, - TokenNameBeginLambda = 63, + TokenNameBeginLambda = 64, TokenNameBeginIntersectionCast = 70, TokenNameBeginTypeArguments = 90, TokenNameElidedSemicolonAndRightBrace = 72, @@ -204,11 +204,11 @@ static int getRestrictedKeyword(String text) { TokenNameBeginCaseExpr = 73, TokenNameRestrictedIdentifierYield = 81, TokenNameRestrictedIdentifierrecord = 76, - TokenNameRestrictedIdentifiersealed = 41, + TokenNameRestrictedIdentifiersealed = 43, TokenNameRestrictedIdentifierpermits = 130, TokenNameBeginCaseElement = 133, TokenNameRestrictedIdentifierWhen = 134, TokenNameUNDERSCORE = 34, - TokenNameEOF = 64, + TokenNameEOF = 38, TokenNameERROR = 140; } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser1.rsc index 696ea2979ce..7edacef7f3d 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser1.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser1.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser12.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser12.rsc index c7f0a0906f8..4b7c62bc163 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser12.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser12.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser13.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser13.rsc index efd1bc39c35..dc7ebd28260 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser13.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser13.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser14.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser14.rsc index 5151401eab2..9cf4ba8761a 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser14.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser14.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser15.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser15.rsc index 6c7c1388f11..c8227d51044 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser15.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser15.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser16.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser16.rsc index 3415571e2dc..49226f40493 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser16.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser16.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser17.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser17.rsc index 3e768c26c48..3d536ebab6d 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser17.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser17.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser18.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser18.rsc index 3fd0acf2edb..afbec6dabca 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser18.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser18.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser19.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser19.rsc index d63e98d5514..423b9a7028d 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser19.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser19.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser2.rsc index 0a6175d5e02..234922d14b0 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser2.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser2.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser20.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser20.rsc index 7466f8c0a66..2b23f6fb36d 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser20.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser20.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser21.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser21.rsc index 0d651c0230b..02e398dcba0 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser21.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser21.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser22.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser22.rsc index 60da9de8cb8..7c9e139b047 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser22.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser22.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser23.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser23.rsc index 1623902ec44..84edd5a11b9 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser23.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser23.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser24.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser24.rsc index 28bd6c8947b..01b5963b7e2 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser24.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser24.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser3.rsc index 6ce99f82ce4..49d66c6104f 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser3.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser3.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser4.rsc index 013f62fb9f9..39a375e2bde 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser4.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser4.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser5.rsc index e450b3f8957..86ce01ce095 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser5.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser5.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser6.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser6.rsc index dfcb5bc33a2..971db9ed734 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser6.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser6.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser7.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser7.rsc index 9c5f262ac45..1e62f1f1757 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser7.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser7.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser8.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser8.rsc index d121534c042..2ef5760473f 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser8.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser8.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser9.rsc b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser9.rsc index 754b7037856..57ba5865c2f 100644 Binary files a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser9.rsc and b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/parser9.rsc differ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/readableNames.props b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/readableNames.props index 9d81d5b97ca..c01cc557b81 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/readableNames.props +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/readableNames.props @@ -380,6 +380,7 @@ UnaryExpressionNotPlusMinus=Expression UnaryExpressionNotPlusMinus_NotName=Expression UnaryExpression_NotName=Expression UnionType=UnionType +UnnamedClassBodyDeclarations=UnnamedClassBodyDeclarations UnnamedPattern=UnnamedPattern UnqualifiedClassBodyopt=ClassBody UnqualifiedEnterAnonymousClassBody=EnterAnonymousClassBody diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug562420Test.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug562420Test.java index 90f691a6c7b..77564425203 100644 --- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug562420Test.java +++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Bug562420Test.java @@ -63,8 +63,10 @@ public void testBuilderRegression() throws JavaModelException, Exception { env.getJavaProject(projectPath).setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, "1.8"); fullBuild(); expectingProblemsFor(projectPath, - "Problem : Syntax error on token \".\", , expected [ resource : range : <28,29> category : <20> severity : <2>]\n" + - "Problem : Syntax error on token \".\", = expected [ resource : range : <47,48> category : <20> severity : <2>]\n" + - "Problem : Syntax error on token \"module\", interface expected [ resource : range : <0,6> category : <20> severity : <2>]"); + """ + Problem : Syntax error on token ".", = expected [ resource : range : <47,48> category : <20> severity : <2>] + Problem : Syntax error on token "{", ( expected [ resource : range : <12,13> category : <20> severity : <2>] + Problem : Syntax error on token "}", delete this token [ resource : range : <63,64> category : <20> severity : <2>] + Problem : Syntax error on token(s), misplaced construct(s) [ resource : range : <0,33> category : <20> severity : <2>]"""); } } \ No newline at end of file diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java index 3b11d2f87ff..eec70f38520 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java @@ -107,6 +107,68 @@ public void runComplianceParserTest( this.runNegativeTest(testFiles, expected18ProblemLog); } } +public void runComplianceParserTest( + String[] testFiles, + String expected1_3ProblemLog, + String expected1_4ProblemLog, + String expected1_5ProblemLog, + String expected1_6ProblemLog, + String expected1_7ProblemLog, + String expected1_8ProblemLog, + String expected9ProblemLog, + String expected10ProblemLog, + String expected11ProblemLog, + String expected12ProblemLog, + String expected13ProblemLog, + String expected14ProblemLog, + String expected15ProblemLog, + String expected16ProblemLog, + String expected17ProblemLog, + String expected18ProblemLog, + String expected19ProblemLog, + String expected20ProblemLog, + String expected21ProblemLog + ){ + if (this.complianceLevel == ClassFileConstants.JDK1_3) { + this.runNegativeTest(testFiles, expected1_3ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK1_4) { + this.runNegativeTest(testFiles, expected1_4ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK1_5) { + this.runNegativeTest(testFiles, expected1_5ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK1_6) { + this.runNegativeTest(testFiles, expected1_6ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK1_7) { + this.runNegativeTest(testFiles, expected1_7ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK1_8) { + this.runNegativeTest(testFiles, expected1_8ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK9) { + this.runNegativeTest(testFiles, expected9ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK10) { + this.runNegativeTest(testFiles, expected10ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK11) { + this.runNegativeTest(testFiles, expected11ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK12) { + this.runNegativeTest(testFiles, expected12ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK13) { + this.runNegativeTest(testFiles, expected13ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK14) { + this.runNegativeTest(testFiles, expected14ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK15) { + this.runNegativeTest(testFiles, expected15ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK16) { + this.runNegativeTest(testFiles, expected16ProblemLog); + } else if (this.complianceLevel == ClassFileConstants.JDK17) { + this.runNegativeTest(testFiles, expected17ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK18) { + this.runNegativeTest(testFiles, expected18ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK19) { + this.runNegativeTest(testFiles, expected19ProblemLog); + } else if(this.complianceLevel == ClassFileConstants.JDK20) { + this.runNegativeTest(testFiles, expected20ProblemLog); + } else { + this.runNegativeTest(testFiles, expected21ProblemLog); + } + } public void test0001() { String[] testFiles = new String[] { "X.java", @@ -186,18 +248,21 @@ public void test0002() { // TODO: Fix this and Enable public void test0003() { String[] testFiles = new String[] { - "X.java", - "public enum X {\n" + - "}\n" - }; - - String expected13ProblemLog = - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " public enum X {\n" + - " ^^^^\n" + - "Syntax error on token \"enum\", class expected\n" + - "----------\n"; + "x/X.java", """ + package x; + public enum X { + } + """ + }; + + String expected13ProblemLog = """ + ---------- + 1. ERROR in x\\X.java (at line 2) + public enum X { + ^^^^ + Syntax error on token "enum", class expected + ---------- + """; String expected14ProblemLog = expected13ProblemLog; @@ -655,14 +720,19 @@ public void test0014() { "}\n" }; - String expected13ProblemLog = - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " public enum X \n" + - "}\n" + - " ^^^^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n"; + String expected13ProblemLog = """ + ---------- + 1. WARNING in X.java (at line 1) + public enum X\s + ^^^^ + 'enum' should not be used as an identifier, since it is a reserved keyword from source level 1.5 on + ---------- + 2. ERROR in X.java (at line 2) + } + ^ + Syntax error on token "}", ; expected + ---------- + """; String expected14ProblemLog = expected13ProblemLog; @@ -1154,16 +1224,18 @@ public void _test0024() { } public void test0025() { String[] testFiles = new String[] { - "X.java", - "static aaa.*;\n" + - "public class X {\n" + - "}\n" + - "\n" + "x/X.java", """ + package x; + static aaa.*; + public class X { + } + + """ }; String expected13ProblemLog = "----------\n" + - "1. ERROR in X.java (at line 1)\n" + + "1. ERROR in x\\X.java (at line 2)\n" + " static aaa.*;\n" + " ^^^^^^\n" + "Syntax error on token \"static\", import expected\n" + @@ -1173,10 +1245,10 @@ public void test0025() { String expected15ProblemLog = "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " static aaa.*;\n" + - " ^^^^^^\n" + - "Syntax error on token \"static\", import expected before this token\n" + + "1. ERROR in x\\X.java (at line 1)\n" + + " package x;\n" + + " ^\n" + + "Syntax error on token \";\", import expected after this token\n" + "----------\n"; runComplianceParserTest( @@ -1604,33 +1676,25 @@ public void test0034() { "}\n" }; - String expected13ProblemLog = - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " public class X extends Y {\n" + - " ^\n" + - "Syntax error on token \"<\", { expected\n" + - "----------\n" + - "2. ERROR in X.java (at line 1)\n" + - " public class X extends Y {\n" + - " ^^^^^^^^^^^^^^^^^^^^^\n" + - "Syntax error on tokens, InterfaceHeaderName expected instead\n" + - "----------\n" + - "3. ERROR in X.java (at line 1)\n" + - " public class X extends Y {\n" + - " ^^^^^^\n" + - "extnds cannot be resolved to a type\n" + - "----------\n" + - "4. ERROR in X.java (at line 1)\n" + - " public class X extends Y {\n" + - " ^^^^^^\n" + - "Syntax error on token \"String\", delete this token\n" + - "----------\n" + - "5. ERROR in X.java (at line 3)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete ClassBody\n" + - "----------\n"; + String expected13ProblemLog = """ + ---------- + 1. ERROR in X.java (at line 1) + public class X extends Y { + ^^^^^^^^^^^^^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 2. ERROR in X.java (at line 1) + public class X extends Y { + ^^^^^^^^^^^^^^^^^^ + Syntax error on tokens, ClassHeaderName expected instead + ---------- + 3. ERROR in X.java (at line 1) + public class X extends Y { + ^^^^^^ + extnds cannot be resolved to a type + ---------- + """; + String expected14ProblemLog = expected13ProblemLog; @@ -1967,90 +2031,62 @@ public void test0042() { "}\n" }; - String expected13ProblemLog = - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " void ___eval() {\n" + - " ^^^^^^^^^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "2. ERROR in X.java (at line 2)\n" + - " new Runnable() {\n" + - " int ___run() throws Throwable {\n" + - " return blah;\n" + - " }\n" + - " private String blarg;\n" + - " public void run() {\n" + - " }\n" + - " };\n" + - "}\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n"; - String expected14ProblemLog = - expected13ProblemLog; - - String expected15ProblemLog = - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " void ___eval() {\n" + - " ^^^^\n" + - "Syntax error on token \"void\", @ expected\n" + - "----------\n" + - "2. ERROR in X.java (at line 1)\n" + - " void ___eval() {\n" + - " ^\n" + - "Syntax error on token \")\", delete this token\n" + - "----------\n" + - "3. ERROR in X.java (at line 9)\n" + - " };\n" + - "}\n" + - " ^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "4. ERROR in X.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete ClassBody\n" + - "----------\n" + - "5. ERROR in X.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete MemberValue\n" + - "----------\n" + - "6. ERROR in X.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \")\" to complete Modifiers\n" + - "----------\n" + - "7. ERROR in X.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"enum Identifier\" to complete EnumHeader\n" + - "----------\n" + - "8. ERROR in X.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"EnumBody\" to complete CompilationUnit\n" + - "----------\n"; - - String expectedJ14ProblemLog = - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " void ___eval() {\n" + - " ^^^^\n" + - "Syntax error on token \"void\", record expected\n" + - "----------\n" + - "2. ERROR in X.java (at line 2)\n" + - " new Runnable() {\n" + - " ^^^\n" + - "Syntax error on token \"new\", record expected\n" + - "----------\n"; - runComplianceParserTest( - testFiles, - expected13ProblemLog, - expected14ProblemLog, - (this.complianceLevel < ClassFileConstants.JDK14 ? expected15ProblemLog : expectedJ14ProblemLog) + String expected16ProblemLog = """ + ---------- + 1. ERROR in X.java (at line 1) + void ___eval() { + ^ + The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above + ---------- + 2. ERROR in X.java (at line 4) + return blah; + ^^^^ + blah cannot be resolved to a variable + ---------- + """; + + String expected1_3ProblemLog = expected16ProblemLog + """ + 3. ERROR in X.java (at line 14) + public static void main(String[] args) { + ^^^^^^^^^^^^^^^^^^^ + The method main cannot be declared static; static methods can only be declared in a static or top level type + ---------- + """; + + String expected21ProblemLog = """ + ---------- + 1. ERROR in X.java (at line 1) + void ___eval() { + ^ + Unnamed Classes and Instance Main Methods is a preview feature and disabled by default. Use --enable-preview to enable + ---------- + 2. ERROR in X.java (at line 4) + return blah; + ^^^^ + blah cannot be resolved to a variable + ---------- + """; + runComplianceParserTest( + testFiles, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected1_3ProblemLog, + expected16ProblemLog, + expected16ProblemLog, + expected16ProblemLog, + expected16ProblemLog, + expected16ProblemLog, + expected21ProblemLog ); } /* @@ -2058,21 +2094,23 @@ public void test0042() { */ public void test0043() { String[] testFiles = new String[] { - "X.java", - "public class X {\n" + - "}\n" + - "public static void foo(){}\n" + - "\n" + "x/X.java", """ + package x; + public class X { + } + public static void foo(){} + + """ }; String expected13ProblemLog = "----------\n" + - "1. ERROR in X.java (at line 2)\n" + + "1. ERROR in x\\X.java (at line 3)\n" + " }\n" + " ^\n" + "Syntax error on token \"}\", delete this token\n" + "----------\n" + - "2. ERROR in X.java (at line 3)\n" + + "2. ERROR in x\\X.java (at line 4)\n" + " public static void foo(){}\n" + " ^\n" + "Syntax error, insert \"}\" to complete ClassBody\n" + @@ -2127,11 +2165,6 @@ public void test0044() { "3. ERROR in X.java (at line 9)\n" + " super(\"SUCCESS\");\n" + " ^^^^^^\n" + - "Syntax error, type parameters are only available if source level is 1.5 or greater\n" + - "----------\n" + - "4. ERROR in X.java (at line 9)\n" + - " super(\"SUCCESS\");\n" + - " ^^^^^^\n" + "Syntax error, parameterized types are only available if source level is 1.5 or greater\n" + "----------\n"; String expected14ProblemLog = diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java index ba1bf6ec9dc..99780ee4bb1 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/DietRecoveryTest.java @@ -794,72 +794,6 @@ public void test06() { expectedFullUnitToString, expectedCompletionDietUnitToString, testName); } -/* - * Attaching orphan methods and fields - */ - -public void test07() { - - String s = - "public class X { \n" - + " void foo() { \n" - + " System.out.println(); \n" - + " } \n" - + "} \n" - + " void bar(){ \n" - + " } \n" - + " int x; \n" - + " void baz(){ \n" - + " } \n" - + " int y; \n"; - - String expectedDietUnitToString = - "public class X {\n" + - " {\n" + - " }\n" + - " int x;\n" + - " int y;\n" + - " public X() {\n" + - " }\n" + - " void foo() {\n" + - " }\n" + - " void bar() {\n" + - " }\n" + - " void baz() {\n" + - " }\n" + - "}\n"; - - String expectedDietPlusBodyUnitToString = - "public class X {\n" + - " {\n" + - " }\n" + - " int x;\n" + - " int y;\n" + - " public X() {\n" + - " super();\n" + - " }\n" + - " void foo() {\n" + - " System.out.println();\n" + - " }\n" + - " void bar() {\n" + - " }\n" + - " void baz() {\n" + - " }\n" + - "}\n"; - - String expectedFullUnitToString = expectedDietUnitToString; - - String expectedCompletionDietUnitToString = expectedDietUnitToString; - - String testName = ""; - checkParse( - s.toCharArray(), - expectedDietUnitToString, - expectedDietPlusBodyUnitToString, - expectedDietPlusBodyUnitToString, - expectedFullUnitToString, - expectedCompletionDietUnitToString, testName); -} /* * Properly attaching fields/methods to member type */ @@ -4375,30 +4309,6 @@ public void test68() { * Unit reduced to a method declaration */ -public void test69() { - - String s = - " int foo(){ \n" + - " System.out.println(); \n" + - " } \n"; - - String expectedDietUnitToString = ""; - - String expectedDietPlusBodyUnitToString = expectedDietUnitToString; - - String expectedFullUnitToString = expectedDietUnitToString; - - String expectedCompletionDietUnitToString = expectedDietUnitToString; - - String testName = ""; - checkParse( - s.toCharArray(), - expectedDietUnitToString, - expectedDietPlusBodyUnitToString, - expectedDietPlusBodyUnitToString, - expectedFullUnitToString, - expectedCompletionDietUnitToString, testName); -} /* * Unit reduced to a constructor declaration */ @@ -4427,58 +4337,6 @@ public void test70() { expectedFullUnitToString, expectedCompletionDietUnitToString, testName); } -/* - * Unit reduced to a field declaration - */ - -public void test71() { - - String s = - " String str = new String();"; - - String expectedDietUnitToString = ""; - - String expectedDietPlusBodyUnitToString = expectedDietUnitToString; - - String expectedFullUnitToString = expectedDietUnitToString; - - String expectedCompletionDietUnitToString = expectedDietUnitToString; - - String testName = ""; - checkParse( - s.toCharArray(), - expectedDietUnitToString, - expectedDietPlusBodyUnitToString, - expectedDietPlusBodyUnitToString, - expectedFullUnitToString, - expectedCompletionDietUnitToString, testName); -} -/* - * Unit reduced to a field declaration with array initializer - */ - -public void test72() { - - String s = - " String[] str = { \"hello\" };"; - - String expectedDietUnitToString = ""; - - String expectedDietPlusBodyUnitToString = expectedDietUnitToString; - - String expectedFullUnitToString = expectedDietUnitToString; - - String expectedCompletionDietUnitToString = expectedDietUnitToString; - - String testName = ""; - checkParse( - s.toCharArray(), - expectedDietUnitToString, - expectedDietPlusBodyUnitToString, - expectedDietPlusBodyUnitToString, - expectedFullUnitToString, - expectedCompletionDietUnitToString, testName); -} /* * Should not pick-up any constructor with no arg */ @@ -6194,72 +6052,144 @@ public void _test101() { } public void test102() { String s = - "void ___eval() { \n"+ - "new Runnable(){ \n"+ - "void ___run() throws Throwable { \n"+ - "return blah; \n"+ - "} \n"+ - "private String blarg; \n"+ - "public void run (){ \n"+ - " class Local { \n" + - " void baz() { \n"+ - " } \n" + - " } \n"+ - "} \n"+ - "} \n"+ - ";} \n"+ - "public class Hello{ \n"+ - "private static int x; \n"+ - "private String blah; \n"+ - "public static void main (String[] args){ \n"+ - "} \n"+ - "public void hello (){ \n"+ - "} \n"+ - "public boolean blah (){ \n"+ - "return false;} \n"+ - "public void foo (){ \n"+ - "} \n"+ - "} \n"; - - String expectedDietUnitToString = - "public class Hello {\n" + - " private static int x;\n" + - " private String blah;\n" + - " public Hello() {\n" + - " }\n" + - " () {\n" + - " }\n" + - " public static void main(String[] args) {\n" + - " }\n" + - " public void hello() {\n" + - " }\n" + - " public boolean blah() {\n" + - " }\n" + - " public void foo() {\n" + - " }\n" + - "}\n" ; - - String expectedDietPlusBodyUnitToString = - "public class Hello {\n" + - " private static int x;\n" + - " private String blah;\n" + - " public Hello() {\n" + - " super();\n" + - " }\n" + - " () {\n" + - " }\n" + - " public static void main(String[] args) {\n" + - " }\n" + - " public void hello() {\n" + - " }\n" + - " public boolean blah() {\n" + - " return false;\n" + - " }\n" + - " public void foo() {\n" + - " }\n" + - "}\n"; - - String expectedFullUnitToString = expectedDietUnitToString; + """ + void ___eval() {\t + new Runnable(){\t + void ___run() throws Throwable {\t + return blah;\t + }\t + private String blarg;\t + public void run (){\t + class Local {\s + void baz() {\t + }\t + }\t\s + }\t + }\t + ;}\t + public class Hello{\t + private static int x;\t + private String blah;\t + public static void main (String[] args){\t + }\t + public void hello (){\t + }\t + public boolean blah (){\t + return false;}\t + public void foo (){\t + }\t + }\t + """; + + String expectedDietUnitToString = """ +final class > { + public class Hello { + private static int x; + private String blah; + () { + } + public Hello() { + } + public static void main(String[] args) { + } + public void hello() { + } + public boolean blah() { + } + public void foo() { + } + } + >() { + } + void ___eval() { + } +} +"""; + + String expectedDietPlusBodyUnitToString = """ +final class > { + public class Hello { + private static int x; + private String blah; + () { + } + public Hello() { + super(); + } + public static void main(String[] args) { + } + public void hello() { + } + public boolean blah() { + return false; + } + public void foo() { + } + } + >() { + super(); + } + void ___eval() { + new Runnable() { + private String blarg; + void ___run() throws Throwable { + return blah; + } + public void run() { + class Local { + Local() { + super(); + } + void baz() { + } + } + } + }; + } +} +"""; + + String expectedFullUnitToString = """ +final class > { + public class Hello { + private static int x; + private String blah; + () { + } + public Hello() { + super(); + } + public static void main(String[] args) { + } + public void hello() { + } + public boolean blah() { + return false; + } + public void foo() { + } + } + >() { + } + void ___eval() { + new Runnable() { + private String blarg; + void ___run() throws Throwable { + return blah; + } + public void run() { + class Local { + Local() { + super(); + } + void baz() { + } + } + } + }; + } +} +"""; String expectedCompletionDietUnitToString = expectedDietUnitToString; diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java index 6ddb6bdb416..eba8e24387e 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ModuleDeclarationSyntaxTest.java @@ -164,18 +164,20 @@ public void test0008() throws IOException { "module @Marker com.greetings {\n" + " requires org.astro;" + "}\n"; - String errorMsg = - "----------\n" + - "1. ERROR in module-info (at line 1)\n" + - " module @Marker com.greetings {\n" + - " ^^^^^^\n" + - "Syntax error on token(s), misplaced construct(s)\n" + - "----------\n" + - "2. ERROR in module-info (at line 1)\n" + - " module @Marker com.greetings {\n"+ - " ^^^^^^\n"+ - "Syntax error on token \"Marker\", module expected after this token\n" + - "----------\n"; + String errorMsg = """ + ---------- + 1. ERROR in module-info (at line 1) + module @Marker com.greetings { + ^^^^^^ + Syntax error on token "module", delete this token + ---------- + 2. ERROR in module-info (at line 1) + module @Marker com.greetings { + ^^^^^^^^^^^^^^^^^^^^^ + Syntax error on tokens, ModuleHeader expected instead + ---------- + """; + CompilerOptions options = new CompilerOptions(getCompilerOptions()); options.complianceLevel = ClassFileConstants.JDK9; options.sourceLevel = ClassFileConstants.JDK9; @@ -187,23 +189,25 @@ public void test0009() throws IOException { "module com.greetings {\n" + " requires @Marker org.astro;\n" + "}\n"; - String errorMsg = - "----------\n" + - "1. ERROR in module-info (at line 1)\n" + - " module com.greetings {\n requires @Marker org.astro;\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Syntax error on token(s), misplaced construct(s)\n" + - "----------\n" + - "2. ERROR in module-info (at line 2)\n" + - " requires @Marker org.astro;\n"+ - " ^^^^^^\n"+ - "Syntax error on token \"Marker\", package expected after this token\n" + - "----------\n"+ - "3. ERROR in module-info (at line 3)\n"+ - " }\n" + - " ^\n" + - "Syntax error on token \"}\", delete this token\n" + - "----------\n"; + String errorMsg = """ + ---------- + 1. ERROR in module-info (at line 1) + module com.greetings { + requires @Marker org.astro; + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 2. ERROR in module-info (at line 2) + requires @Marker org.astro; + ^ + Syntax error on token(s), misplaced construct(s) + ---------- + 3. ERROR in module-info (at line 3) + } + ^ + Syntax error on token "}", delete this token + ---------- + """; CompilerOptions options = new CompilerOptions(getCompilerOptions()); options.complianceLevel = ClassFileConstants.JDK9; options.sourceLevel = ClassFileConstants.JDK9; @@ -233,23 +237,25 @@ public void test0011() throws IOException { "module com.greetings {\n" + " exports @Marker com.greetings;\n" + "}\n"; - String errorMsg = - "----------\n" + - "1. ERROR in module-info (at line 1)\n" + - " module com.greetings {\n exports @Marker com.greetings;\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Syntax error on token(s), misplaced construct(s)\n" + - "----------\n" + - "2. ERROR in module-info (at line 2)\n" + - " exports @Marker com.greetings;\n"+ - " ^^^^^^\n"+ - "Syntax error on token \"Marker\", package expected after this token\n" + - "----------\n"+ - "3. ERROR in module-info (at line 3)\n"+ - " }\n" + - " ^\n" + - "Syntax error on token \"}\", delete this token\n" + - "----------\n"; + String errorMsg = """ + ---------- + 1. ERROR in module-info (at line 1) + module com.greetings { + exports @Marker com.greetings; + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 2. ERROR in module-info (at line 2) + exports @Marker com.greetings; + ^ + Syntax error on token(s), misplaced construct(s) + ---------- + 3. ERROR in module-info (at line 3) + } + ^ + Syntax error on token "}", delete this token + ---------- + """; CompilerOptions options = new CompilerOptions(getCompilerOptions()); options.complianceLevel = ClassFileConstants.JDK9; options.sourceLevel = ClassFileConstants.JDK9; diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java index ee0297ad637..c701306b2bf 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java @@ -4517,11 +4517,14 @@ public void test63() { "int x;\n"; String expectedUnitToString = - "public class X {\n" + "final class {\n" + + "\tpublic class X {\n" + + "\t\tjava.lang.Object(0)\n" + + "\t\tint foo() {}\n" + + "\t}\n" + "\tint x;\n" + "\tjava.lang.Object(0)\n" - + "\tint foo() {}\n" - + "}"; + +"}"; String testName = "test63: full parse"; fullParse(s,testName); @@ -4545,7 +4548,14 @@ public void test63() { assertEquals("Invalid declaration source start for field x", 60, fields[0].getDeclarationSourceStart()); assertEquals("Invalid declaration source end for field x", 65, fields[0].getDeclarationSourceEnd()); - SourceMethod[] methods = this.currentType.getMethods(); + SourceType[] types = this.currentType.getMemberTypes(); + assertTrue("invalid member types", types != null); + assertEquals("has one member type", 1, types.length); + + assertEquals("Invalid member type declaration start", 0, types[0].getDeclarationSourceStart()); + assertEquals("Invalid member type declaration start", 47, types[0].getDeclarationSourceEnd()); + + SourceMethod[] methods = this.currentType.getMemberTypes()[0].getMethods(); assertTrue(" invalid methods ", methods != null); assertEquals("has one method", 1, methods.length); @@ -4554,9 +4564,6 @@ public void test63() { assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName()); - SourceType[] members = this.currentType.getMemberTypes(); - assertTrue(" invalid members ", members == null); - assertEquals( "Invalid source " + testName, expectedUnitToString, @@ -4571,10 +4578,13 @@ public void test64() { "int x;\n"; String expectedUnitToString = - "public class X {\n" - + "\tint x;\n" - + "\tint foo() {}\n" - + "}"; + "final class {\n" + + "\tpublic class X {\n" + + "\t\tint foo() {}\n" + + "\t}\n" + + "\tint x;\n" + +"}"; + String testName = "test64: diet parse"; dietParse(s,testName); @@ -4598,7 +4608,14 @@ public void test64() { assertEquals("Invalid declaration source start for field x", 60, fields[0].getDeclarationSourceStart()); assertEquals("Invalid declaration source end for field x", 65, fields[0].getDeclarationSourceEnd()); - SourceMethod[] methods = this.currentType.getMethods(); + SourceType[] types = this.currentType.getMemberTypes(); + assertTrue("invalid member types", types != null); + assertEquals("has one member type", 1, types.length); + + assertEquals("Invalid member type declaration start", 0, types[0].getDeclarationSourceStart()); + assertEquals("Invalid member type declaration start", 47, types[0].getDeclarationSourceEnd()); + + SourceMethod[] methods = this.currentType.getMemberTypes()[0].getMethods(); assertTrue(" invalid methods ", methods != null); assertEquals("has one method", 1, methods.length); @@ -4607,9 +4624,6 @@ public void test64() { assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName()); - SourceType[] members = this.currentType.getMemberTypes(); - assertTrue(" invalid members ", members == null); - assertEquals( "Invalid source " + testName, expectedUnitToString, @@ -4624,9 +4638,10 @@ public void test65() { "int x();\n"; String expectedUnitToString = - "public class X {\n" - + "\t{}\n" - + "\tint foo() {}\n" + "final class {\n" + + "\tpublic class X {\n" + + "\t\tint foo() {}\n" + + "\t}\n" + "\tint x() {}\n" + "}"; @@ -4646,28 +4661,29 @@ public void test65() { assertTrue("has no superinterfaces " , this.currentType.getInterfaceNames() == null); SourceField[] fields = this.currentType.getFields(); - assertTrue(" invalid fields ", fields != null); - assertEquals(" invalid fields length ", 1, fields.length); - - assertEquals("Invalid declaration source start for initializer", 47, fields[0].getDeclarationSourceStart()); - assertEquals("Invalid declaration source end for initializer", 47, fields[0].getDeclarationSourceEnd()); + assertTrue(" invalid fields ", fields == null); SourceMethod[] methods = this.currentType.getMethods(); assertTrue(" invalid methods ", methods != null); - assertEquals("has two methods", 2, methods.length); + assertEquals("has one method", 1, methods.length); - assertEquals("Invalid declaration source start for method foo", 27, methods[0].getDeclarationSourceStart()); - assertEquals("Invalid declaration source end for method foo", 37, methods[0].getDeclarationSourceEnd()); + assertEquals("Invalid declaration source start for method x", 60, methods[0].getDeclarationSourceStart()); + assertEquals("Invalid declaration source end for method x", 67, methods[0].getDeclarationSourceEnd()); - assertEquals("Invalid declaration source start for method x", 60, methods[1].getDeclarationSourceStart()); - assertEquals("Invalid declaration source end for method x", 67, methods[1].getDeclarationSourceEnd()); + assertEquals(" Invalid actual name for method x", "x", methods[0].getActualName()); - assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName()); + SourceType[] members = this.currentType.getMemberTypes(); + assertTrue(" invalid members ", members != null); + assertEquals(" has one member type ", 1, members.length); - assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName()); + SourceMethod[] memberMethods = members[0].getMethods(); + assertTrue(" invalid member methods ", memberMethods != null); + assertEquals(" has one member method ", 1, memberMethods.length); - SourceType[] members = this.currentType.getMemberTypes(); - assertTrue(" invalid members ", members == null); + assertEquals("Invalid declaration source start for method foo", 27, memberMethods[0].getDeclarationSourceStart()); + assertEquals("Invalid declaration source end for method foo", 37, memberMethods[0].getDeclarationSourceEnd()); + + assertEquals(" Invalid actual name for method foo", "foo", memberMethods[0].getActualName()); assertEquals( "Invalid source " + testName, @@ -4683,8 +4699,10 @@ public void test66() { "int x();\n"; String expectedUnitToString = - "public interface X {\n" - + "\tint foo() {}\n" + "final class {\n" + + "\tpublic interface X {\n" + + "\t\tint foo() {}\n" + + "\t}\n" + "\tint x() {}\n" + "}"; @@ -4708,20 +4726,25 @@ public void test66() { SourceMethod[] methods = this.currentType.getMethods(); assertTrue(" invalid methods ", methods != null); - assertEquals("has two methods", 2, methods.length); + assertEquals("has one method", 1, methods.length); - assertEquals("Invalid declaration source start for method foo", 30, methods[0].getDeclarationSourceStart()); - assertEquals("Invalid declaration source end for method foo", 41, methods[0].getDeclarationSourceEnd()); + assertEquals("Invalid declaration source start for method x", 64, methods[0].getDeclarationSourceStart()); + assertEquals("Invalid declaration source end for method x", 71, methods[0].getDeclarationSourceEnd()); - assertEquals("Invalid declaration source start for method x", 64, methods[1].getDeclarationSourceStart()); - assertEquals("Invalid declaration source end for method x", 71, methods[1].getDeclarationSourceEnd()); + assertEquals(" Invalid actual name for method x", "x", methods[0].getActualName()); - assertEquals(" Invalid actual name for method foo", "foo", methods[0].getActualName()); + SourceType[] members = this.currentType.getMemberTypes(); + assertTrue(" invalid members ", members != null); + assertEquals(" has 1 member type ", 1, members.length); - assertEquals(" Invalid actual name for method x", "x", methods[1].getActualName()); + SourceMethod[] memberMethods = members[0].getMethods(); + assertTrue("invalid member type methods", memberMethods != null); + assertEquals("member type has one method", 1, memberMethods.length); - SourceType[] members = this.currentType.getMemberTypes(); - assertTrue(" invalid members ", members == null); + assertEquals("Invalid declaration source start for method foo", 30, memberMethods[0].getDeclarationSourceStart()); + assertEquals("Invalid declaration source end for method foo", 41, memberMethods[0].getDeclarationSourceEnd()); + + assertEquals(" Invalid actual name for method foo", "foo", memberMethods[0].getActualName()); assertEquals( "Invalid source " + testName, diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/UnnamedClassTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/UnnamedClassTest.java new file mode 100644 index 00000000000..215f127c22c --- /dev/null +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/UnnamedClassTest.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * Copyright (c) 2023 Red Hat, Inc. and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.jdt.core.tests.compiler.parser; + +import java.util.Locale; +import java.util.stream.Stream; + +import org.eclipse.jdt.core.tests.compiler.regression.AbstractRegressionTest9; +import org.eclipse.jdt.internal.compiler.CompilationResult; +import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; +import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; +import org.eclipse.jdt.internal.compiler.ast.UnnamedClass; +import org.eclipse.jdt.internal.compiler.batch.CompilationUnit; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; +import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; +import org.eclipse.jdt.internal.compiler.parser.Parser; +import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; +import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; +import org.junit.Test; + +public class UnnamedClassTest extends AbstractRegressionTest9 { + public static boolean optimizeStringLiterals = false; + public static long sourceLevel = ClassFileConstants.JDK21; //$NON-NLS-1$ + + public UnnamedClassTest(String testName){ + super(testName); + } + + public static Class testClass() { + return UnnamedClassTest.class; + } + + public static junit.framework.Test suite() { + return buildMinimalComplianceTestSuite(testClass(), F_21); + } + + private CompilationUnitDeclaration parse(String source, String testName) { + this.complianceLevel = ClassFileConstants.JDK21; + /* using regular parser in DIET mode */ + CompilerOptions options = new CompilerOptions(getCompilerOptions()); + options.enablePreviewFeatures = true; + Parser parser = + new Parser( + new ProblemReporter( + DefaultErrorHandlingPolicies.proceedWithAllProblems(), + options, + new DefaultProblemFactory(Locale.getDefault())), + optimizeStringLiterals); + ICompilationUnit sourceUnit = new CompilationUnit(source.toCharArray(), testName, null); + CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0); + return parser.parse(sourceUnit, compilationResult); + } + + private UnnamedClass unnamedClass(CompilationUnitDeclaration cu) { + return cu == null || cu.types == null ? null : + Stream.of(cu.types).filter(UnnamedClass.class::isInstance).map(UnnamedClass.class::cast).findAny().orElse(null); + } + + @Test + public void testParseExplicitClass() { + CompilationUnitDeclaration res = parse("public class A {}", "A.java"); + assertFalse(res.compilationResult.hasErrors()); + assertNull(unnamedClass(res)); + } + + @Test + public void testParseOnlyMain() { + CompilationUnitDeclaration res = parse("void main() {}", "A.java"); + assertFalse(res.hasErrors()); + UnnamedClass unnamedClass = unnamedClass(res); + assertNotNull(unnamedClass); + assertTrue(Stream.of(unnamedClass.methods).anyMatch(m -> m instanceof MethodDeclaration method && "main".equals(new String(method.selector)))); + // should generated A.class (unnamed) + } + + @Test + public void testParseMixedMethodAndTypes() { + CompilationUnitDeclaration res = parse(""" + void hello() {} + public class B {} + void main() {} + """, "A.java"); + assertFalse(res.compilationResult.hasErrors()); + // hello, main, and the implicit constructor + assertEquals(3, unnamedClass(res).methods.length); + // should generated A.class (unnamed) and A$B.class + assertEquals(1, res.types[0].memberTypes.length); + } +} diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java index 387d9c69893..0de64724f2e 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_3.java @@ -2595,25 +2595,24 @@ public void test079() { " }\n" + "}\n" }, - "----------\n" + - "1. ERROR in Hello.java (at line 1)\n" + - " void ___eval() {\n" + - " ^^^^^^^^^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "2. ERROR in Hello.java (at line 2)\n" + - " new Runnable() {\n" + - " int ___run() throws Throwable {\n" + - " return blah;\n" + - " }\n" + - " private String blarg;\n" + - " public void run() {\n" + - " }\n" + - " };\n" + - "}\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + """ + ---------- + 1. ERROR in Hello.java (at line 1) + void ___eval() { + ^ + The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above + ---------- + 2. ERROR in Hello.java (at line 4) + return blah; + ^^^^ + blah cannot be resolved to a variable + ---------- + 3. ERROR in Hello.java (at line 14) + public static void main(String[] args) { + ^^^^^^^^^^^^^^^^^^^ + The method main cannot be declared static; static methods can only be declared in a static or top level type + ---------- + """ ); } /* diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java index 3a230b585b4..5515a1aa680 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_4.java @@ -2622,25 +2622,24 @@ public void test079() { " }\n" + "}\n" }, - "----------\n" + - "1. ERROR in Hello.java (at line 1)\n" + - " void ___eval() {\n" + - " ^^^^^^^^^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "2. ERROR in Hello.java (at line 2)\n" + - " new Runnable() {\n" + - " int ___run() throws Throwable {\n" + - " return blah;\n" + - " }\n" + - " private String blarg;\n" + - " public void run() {\n" + - " }\n" + - " };\n" + - "}\n" + - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + """ + ---------- + 1. ERROR in Hello.java (at line 1) + void ___eval() { + ^ + The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above + ---------- + 2. ERROR in Hello.java (at line 4) + return blah; + ^^^^ + blah cannot be resolved to a variable + ---------- + 3. ERROR in Hello.java (at line 14) + public static void main(String[] args) { + ^^^^^^^^^^^^^^^^^^^ + The method main cannot be declared static; static methods can only be declared in a static or top level type + ---------- + """ ); } /* diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java index 6192c7a5b97..35c00527f34 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/Compliance_1_5.java @@ -2724,60 +2724,39 @@ public void test078() { // TODO: Enable after Bug 552769 is fixed public void test079() { - String expectedErrorLog = "----------\n" + - "1. ERROR in Hello.java (at line 1)\n" + - " void ___eval() {\n" + - " ^^^^\n" + - "Syntax error on token \"void\", @ expected\n" + - "----------\n" + - "2. ERROR in Hello.java (at line 1)\n" + - " void ___eval() {\n" + - " ^\n" + - "Syntax error on token \")\", delete this token\n" + - "----------\n" + - "3. ERROR in Hello.java (at line 9)\n" + - " };\n" + - "}\n" + - " ^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "4. ERROR in Hello.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete ClassBody\n" + - "----------\n" + - "5. ERROR in Hello.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete MemberValue\n" + - "----------\n" + - "6. ERROR in Hello.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \")\" to complete Modifiers\n" + - "----------\n" + - "7. ERROR in Hello.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"enum Identifier\" to complete EnumHeader\n" + - "----------\n" + - "8. ERROR in Hello.java (at line 23)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"EnumBody\" to complete CompilationUnit\n" + - "----------\n"; - String expectedErrorLog_J14 = "----------\n" + - "1. ERROR in Hello.java (at line 1)\n" + - " void ___eval() {\n" + - " ^^^^\n" + - "Syntax error on token \"void\", record expected\n" + - "----------\n" + - "2. ERROR in Hello.java (at line 2)\n" + - " new Runnable() {\n" + - " ^^^\n" + - "Syntax error on token \"new\", record expected\n" + - "----------\n"; - + String expectedErrorLog = "----------\n" + + "1. ERROR in Hello.java (at line 1)\n" + + " void ___eval() {\n" + + " ^\n" + + "The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above\n" + + "----------\n" + + "2. ERROR in Hello.java (at line 4)\n" + + " return blah;\n" + + " ^^^^\n" + + "blah cannot be resolved to a variable\n" + + "----------\n"; + if (this.complianceLevel < ClassFileConstants.JDK16) { + expectedErrorLog += "3. ERROR in Hello.java (at line 14)\n" + + " public static void main(String[] args) {\n" + + " ^^^^^^^^^^^^^^^^^^^\n" + + "The method main cannot be declared static; static methods can only be declared in a static or top level type\n" + + "----------\n"; + } + if (this.complianceLevel == ClassFileConstants.JDK21) { + expectedErrorLog = """ + ---------- + 1. ERROR in Hello.java (at line 1) + void ___eval() { + ^ + Unnamed Classes and Instance Main Methods is a preview feature and disabled by default. Use --enable-preview to enable + ---------- + 2. ERROR in Hello.java (at line 4) + return blah; + ^^^^ + blah cannot be resolved to a variable + ---------- + """; + } this.runNegativeTest( new String[] { "Hello.java", @@ -2805,8 +2784,7 @@ public void test079() { " }\n" + "}\n" }, - this.complianceLevel < ClassFileConstants.JDK14 ? - expectedErrorLog :expectedErrorLog_J14 + expectedErrorLog ); } /* diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java index bdb553db758..c15236a43bd 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_3.java @@ -691,37 +691,44 @@ public void test022() { " */\n" + " public class X {}" }, - "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " * @param Type parameter 2\n" + - " ^^^\n" + - "Javadoc: Invalid param tag name\n" + - "----------\n" + - "2. ERROR in X.java (at line 4)\n" + - " * @param Type parameter 2\n" + - " ^^^\n" + - "Javadoc: Invalid param tag name\n" + - "----------\n" + - "3. ERROR in X.java (at line 5)\n" + - " * @param Type parameter 1\n" + - " ^^^\n" + - "Javadoc: Invalid param tag name\n" + - "----------\n" + - "4. ERROR in X.java (at line 7)\n" + - " public class X {}\n" + - " ^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "5. ERROR in X.java (at line 7)\n" + - " public class X {}\n" + - " ^\n" + - "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" + - "----------\n" + - "6. ERROR in X.java (at line 7)\n" + - " public class X {}\n" + - " ^^^^^^\n" + - "extend cannot be resolved to a type\n" + - "----------\n" + """ + ---------- + 1. ERROR in X.java (at line 3) + * @param Type parameter 2 + ^^^ + Javadoc: Invalid param tag name + ---------- + 2. ERROR in X.java (at line 4) + * @param Type parameter 2 + ^^^ + Javadoc: Invalid param tag name + ---------- + 3. ERROR in X.java (at line 5) + * @param Type parameter 1 + ^^^ + Javadoc: Invalid param tag name + ---------- + 4. ERROR in X.java (at line 7) + public class X {} + ^^^^^^^^^^^^^^^^^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 5. ERROR in X.java (at line 7) + public class X {} + ^^^^^^ + extend cannot be resolved to a type + ---------- + 6. ERROR in X.java (at line 7) + public class X {} + ^ + Syntax error on token ">", = expected + ---------- + 7. ERROR in X.java (at line 7) + public class X {} + ^ + Syntax error, insert ";" to complete CompilationUnit + ---------- + """ ); } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java index 62950975b4c..75d97648f26 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_4.java @@ -692,37 +692,44 @@ public void test022() { " */\n" + " public class X {}" }, - "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " * @param Type parameter 2\n" + - " ^^^\n" + - "Javadoc: Invalid param tag name\n" + - "----------\n" + - "2. ERROR in X.java (at line 4)\n" + - " * @param Type parameter 2\n" + - " ^^^\n" + - "Javadoc: Invalid param tag name\n" + - "----------\n" + - "3. ERROR in X.java (at line 5)\n" + - " * @param Type parameter 1\n" + - " ^^^\n" + - "Javadoc: Invalid param tag name\n" + - "----------\n" + - "4. ERROR in X.java (at line 7)\n" + - " public class X {}\n" + - " ^^^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "5. ERROR in X.java (at line 7)\n" + - " public class X {}\n" + - " ^\n" + - "Syntax error, insert \"ClassBody\" to complete CompilationUnit\n" + - "----------\n" + - "6. ERROR in X.java (at line 7)\n" + - " public class X {}\n" + - " ^^^^^^\n" + - "extend cannot be resolved to a type\n" + - "----------\n" + """ + ---------- + 1. ERROR in X.java (at line 3) + * @param Type parameter 2 + ^^^ + Javadoc: Invalid param tag name + ---------- + 2. ERROR in X.java (at line 4) + * @param Type parameter 2 + ^^^ + Javadoc: Invalid param tag name + ---------- + 3. ERROR in X.java (at line 5) + * @param Type parameter 1 + ^^^ + Javadoc: Invalid param tag name + ---------- + 4. ERROR in X.java (at line 7) + public class X {} + ^^^^^^^^^^^^^^^^^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 5. ERROR in X.java (at line 7) + public class X {} + ^^^^^^ + extend cannot be resolved to a type + ---------- + 6. ERROR in X.java (at line 7) + public class X {} + ^ + Syntax error on token ">", = expected + ---------- + 7. ERROR in X.java (at line 7) + public class X {} + ^ + Syntax error, insert ";" to complete CompilationUnit + ---------- + """ ); } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java index 0560d878ab8..83c0e0b2dc3 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java @@ -3825,28 +3825,30 @@ public void testBug500170b() { runNegativeModuleTest(files, buffer, "", - "----------\n" + - "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1)\n" + - " module mod.one { \n" + - " ^^^^^^\n" + - "Syntax error on token \"module\", package expected\n" + - "----------\n" + - "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1)\n" + - " module mod.one { \n" + - " ^^^^^^^^^^^^^^\n" + - "Syntax error on token(s), misplaced construct(s)\n" + - "----------\n" + - "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2)\n" + - " requires java.sql;\n" + - " ^\n" + - "Syntax error on token \".\", , expected\n" + - "----------\n" + - "4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3)\n" + - " }\n" + - " ^\n" + - "Syntax error on token \"}\", delete this token\n" + - "----------\n" + - "4 problems (4 errors)\n", + """ + ---------- + 1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1) + module mod.one {\s + ^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 1) + module mod.one {\s + ^^^^^^^^^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 2) + requires java.sql; + ^ + Syntax error on token ".", , expected + ---------- + 4. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/src/mod.one/module-info.java (at line 3) + } + ^ + Syntax error on token "}", delete this token + ---------- + 4 problems (4 errors) + """, false, "modules are not supported"); } @@ -4223,24 +4225,30 @@ public void testReleaseOption14() { "module-info.java", "module mod.one { \n" + "}" - }, + }, " --release 8 \"" + OUTPUT_DIR + File.separator + "module-info.java\" ", - "", - "----------\n" + - "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1)\n" + - " module mod.one { \n" + - " ^^^^^^\n" + - "Syntax error on token \"module\", package expected\n" + - "----------\n" + - "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1)\n" + - " module mod.one { \n" + - "}\n" + - " ^^^^\n" + - "Syntax error on tokens, delete these tokens\n" + - "----------\n" + - "2 problems (2 errors)\n", - true, - /*not tested with javac*/""); + "", + """ + ---------- + 1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1) + module mod.one {\s + ^^^^^^ + Syntax error on token(s), misplaced construct(s) + ---------- + 2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1) + module mod.one {\s + ^^^ + Syntax error, insert "Identifier (" to complete MethodHeaderName + ---------- + 3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/module-info.java (at line 1) + module mod.one {\s + ^^^ + Syntax error, insert ")" to complete MethodDeclaration + ---------- + 3 problems (3 errors) + """, + true, + /*not tested with javac*/""); } // Test from https://bugs.eclipse.org/bugs/show_bug.cgi?id=526997 public void testReleaseOption15() { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java index 4c0ecf876a6..fca40cd4fdd 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RecordsRestrictedClassTest.java @@ -8104,8 +8104,13 @@ public void testBug566846_1() { "----------\n" + "1. ERROR in X.java (at line 1)\n" + " public record X;\n" + + " ^\n" + + "The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above\n" + + "----------\n" + + "2. ERROR in X.java (at line 1)\n" + + " public record X;\n" + " ^^^^^^\n" + - "Syntax error on token \"record\", package expected\n" + + "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + "----------\n", null, true, @@ -8121,20 +8126,15 @@ public void testBug566846_2() { + "record R1;\n" }, "----------\n" + - "1. ERROR in X.java (at line 2)\n" + - " } \n" + + "1. ERROR in X.java (at line 1)\n" + + " public class X {\n" + " ^\n" + - "Syntax error on token \"}\", delete this token\n" + + "The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above\n" + "----------\n" + "2. ERROR in X.java (at line 3)\n" + " record R1;\n" + " ^^^^^^\n" + "\'record\' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + - "----------\n" + - "3. ERROR in X.java (at line 3)\n" + - " record R1;\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete ClassBody\n" + "----------\n", null, true, @@ -8632,12 +8632,17 @@ public void testBug571765_001() { "module-info.java", "public record R() {}\n", }, - "----------\n" + + "----------\n" + "1. ERROR in module-info.java (at line 1)\n" + " public record R() {}\n" + + " ^\n" + + "The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above\n" + + "----------\n" + + "2. ERROR in module-info.java (at line 1)\n" + + " public record R() {}\n" + " ^^^^^^\n" + - "Syntax error on token \"record\", record expected\n" + - "----------\n"); + "'record' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + + "----------\n"); } public void testBug571905_01() throws Exception { runConformTest( diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java index 7321384dd5d..5dc410c4e3f 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SealedTypesTests.java @@ -5187,12 +5187,17 @@ public void testBug566846_001() { "X.java", "record X;\n", }, - "----------\n" + - "1. ERROR in X.java (at line 1)\n" + - " record X;\n" + - " ^^^^^^\n" + - "Syntax error on token \"record\", package expected\n" + - "----------\n", + "----------\n" + + "1. ERROR in X.java (at line 1)\n" + + " record X;\n" + + " ^\n" + + "The preview feature Unnamed Classes and Instance Main Methods is only available with source level 21 and above\n" + + "----------\n" + + "2. ERROR in X.java (at line 1)\n" + + " record X;\n" + + " ^^^^^^\n" + + "'record' is not a valid type name; it is a restricted identifier and not allowed as a type identifier in Java 16\n" + + "----------\n", null, true, options diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java index 9538665de8d..eeb4878d6a6 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java @@ -25,6 +25,7 @@ import java.util.ArrayList; +import org.eclipse.jdt.core.tests.compiler.parser.UnnamedClassTest; import org.eclipse.jdt.core.tests.compiler.util.HashtableOfObjectTest; import org.eclipse.jdt.core.tests.compiler.util.JrtUtilTest; import org.eclipse.jdt.core.tests.dom.StandAloneASTParserTest; @@ -241,6 +242,7 @@ public static Test suite() { since_21.add(NullAnnotationTests21.class); since_21.add(StringTemplateTest.class); since_21.add(BatchCompilerTest_21.class); + since_21.add(UnnamedClassTest.class); // Build final test suite TestSuite all = new TestSuite(TestAll.class.getName()); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java index 04c834b7813..b0547e66ef1 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST3Test.java @@ -7534,8 +7534,8 @@ public void test0316() throws JavaModelException { assertNotNull("No result", result); //$NON-NLS-1$ assertTrue("Not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ CompilationUnit compilationUnit = (CompilationUnit) result; - assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$ - assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getMessages().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getProblems().length); //$NON-NLS-1$ } /** diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java index ad61e2e21b8..7fc44c8e49f 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST4Test.java @@ -7534,8 +7534,8 @@ public void test0316() throws JavaModelException { assertNotNull("No result", result); //$NON-NLS-1$ assertTrue("Not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ CompilationUnit compilationUnit = (CompilationUnit) result; - assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$ - assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getMessages().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getProblems().length); //$NON-NLS-1$ } /** diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java index 5c4b222dad4..2be6c954821 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterAST8Test.java @@ -7532,8 +7532,8 @@ public void test0316() throws JavaModelException { assertNotNull("No result", result); //$NON-NLS-1$ assertTrue("Not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ CompilationUnit compilationUnit = (CompilationUnit) result; - assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$ - assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getMessages().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getProblems().length); //$NON-NLS-1$ } /** diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java index 933575c9107..0ebbd2b5b12 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest.java @@ -7698,8 +7698,8 @@ public void test0316() throws JavaModelException { assertNotNull("No result", result); //$NON-NLS-1$ assertTrue("Not a compilation unit", result instanceof CompilationUnit); //$NON-NLS-1$ CompilationUnit compilationUnit = (CompilationUnit) result; - assertEquals("Wrong size", 2, compilationUnit.getMessages().length); //$NON-NLS-1$ - assertEquals("Wrong size", 2, compilationUnit.getProblems().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getMessages().length); //$NON-NLS-1$ + assertEquals("Wrong size", 3, compilationUnit.getProblems().length); //$NON-NLS-1$ } /** diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java index f4aaf2041de..eda39541196 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTStructuralPropertyTest.java @@ -371,7 +371,7 @@ public void testNodeClassForType() { // oops - guess that's not valid } } - assertEquals("Wrong last known type", 117, hi); // last known one + assertEquals("Wrong last known type", 118, hi); // last known one assertEquals("Wrong number of distinct types", hi, classes.size()); // all classes are distinct } } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java index eca69cd6dea..72513d5d9a4 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTTest.java @@ -25,13 +25,110 @@ import java.util.List; import java.util.Map; -import junit.framework.AssertionFailedError; -import junit.framework.Test; - import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.dom.*; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTMatcher; +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.ASTVisitor; +import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; +import org.eclipse.jdt.core.dom.Annotation; +import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration; +import org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration; +import org.eclipse.jdt.core.dom.AnonymousClassDeclaration; +import org.eclipse.jdt.core.dom.ArrayAccess; +import org.eclipse.jdt.core.dom.ArrayCreation; +import org.eclipse.jdt.core.dom.ArrayInitializer; +import org.eclipse.jdt.core.dom.ArrayType; +import org.eclipse.jdt.core.dom.AssertStatement; +import org.eclipse.jdt.core.dom.Assignment; +import org.eclipse.jdt.core.dom.Block; +import org.eclipse.jdt.core.dom.BlockComment; +import org.eclipse.jdt.core.dom.BodyDeclaration; +import org.eclipse.jdt.core.dom.BooleanLiteral; +import org.eclipse.jdt.core.dom.BreakStatement; +import org.eclipse.jdt.core.dom.CastExpression; +import org.eclipse.jdt.core.dom.CatchClause; +import org.eclipse.jdt.core.dom.CharacterLiteral; +import org.eclipse.jdt.core.dom.ClassInstanceCreation; +import org.eclipse.jdt.core.dom.Comment; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.ConditionalExpression; +import org.eclipse.jdt.core.dom.ConstructorInvocation; +import org.eclipse.jdt.core.dom.ContinueStatement; +import org.eclipse.jdt.core.dom.Dimension; +import org.eclipse.jdt.core.dom.DoStatement; +import org.eclipse.jdt.core.dom.EmptyStatement; +import org.eclipse.jdt.core.dom.EnhancedForStatement; +import org.eclipse.jdt.core.dom.EnumConstantDeclaration; +import org.eclipse.jdt.core.dom.EnumDeclaration; +import org.eclipse.jdt.core.dom.Expression; +import org.eclipse.jdt.core.dom.ExpressionStatement; +import org.eclipse.jdt.core.dom.FieldAccess; +import org.eclipse.jdt.core.dom.FieldDeclaration; +import org.eclipse.jdt.core.dom.ForStatement; +import org.eclipse.jdt.core.dom.IExtendedModifier; +import org.eclipse.jdt.core.dom.IfStatement; +import org.eclipse.jdt.core.dom.ImportDeclaration; +import org.eclipse.jdt.core.dom.InfixExpression; +import org.eclipse.jdt.core.dom.Initializer; +import org.eclipse.jdt.core.dom.InstanceofExpression; +import org.eclipse.jdt.core.dom.Javadoc; +import org.eclipse.jdt.core.dom.LabeledStatement; +import org.eclipse.jdt.core.dom.LineComment; +import org.eclipse.jdt.core.dom.MarkerAnnotation; +import org.eclipse.jdt.core.dom.MemberRef; +import org.eclipse.jdt.core.dom.MemberValuePair; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.MethodInvocation; +import org.eclipse.jdt.core.dom.MethodRef; +import org.eclipse.jdt.core.dom.MethodRefParameter; +import org.eclipse.jdt.core.dom.Modifier; +import org.eclipse.jdt.core.dom.ModuleDeclaration; +import org.eclipse.jdt.core.dom.Name; +import org.eclipse.jdt.core.dom.NormalAnnotation; +import org.eclipse.jdt.core.dom.NullLiteral; +import org.eclipse.jdt.core.dom.NumberLiteral; +import org.eclipse.jdt.core.dom.PackageDeclaration; +import org.eclipse.jdt.core.dom.ParameterizedType; +import org.eclipse.jdt.core.dom.ParenthesizedExpression; +import org.eclipse.jdt.core.dom.PostfixExpression; +import org.eclipse.jdt.core.dom.PrefixExpression; +import org.eclipse.jdt.core.dom.PrimitiveType; +import org.eclipse.jdt.core.dom.QualifiedName; +import org.eclipse.jdt.core.dom.QualifiedType; +import org.eclipse.jdt.core.dom.ReturnStatement; +import org.eclipse.jdt.core.dom.SimpleName; +import org.eclipse.jdt.core.dom.SimpleType; +import org.eclipse.jdt.core.dom.SingleMemberAnnotation; +import org.eclipse.jdt.core.dom.SingleVariableDeclaration; +import org.eclipse.jdt.core.dom.Statement; +import org.eclipse.jdt.core.dom.StringLiteral; +import org.eclipse.jdt.core.dom.SuperConstructorInvocation; +import org.eclipse.jdt.core.dom.SuperFieldAccess; +import org.eclipse.jdt.core.dom.SuperMethodInvocation; +import org.eclipse.jdt.core.dom.SwitchCase; +import org.eclipse.jdt.core.dom.SwitchStatement; +import org.eclipse.jdt.core.dom.SynchronizedStatement; +import org.eclipse.jdt.core.dom.TagElement; +import org.eclipse.jdt.core.dom.TextElement; +import org.eclipse.jdt.core.dom.ThisExpression; +import org.eclipse.jdt.core.dom.ThrowStatement; +import org.eclipse.jdt.core.dom.TryStatement; +import org.eclipse.jdt.core.dom.Type; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.core.dom.TypeDeclarationStatement; +import org.eclipse.jdt.core.dom.TypeLiteral; +import org.eclipse.jdt.core.dom.TypeParameter; +import org.eclipse.jdt.core.dom.VariableDeclarationExpression; +import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.core.dom.VariableDeclarationStatement; +import org.eclipse.jdt.core.dom.WhileStatement; +import org.eclipse.jdt.core.dom.WildcardType; import org.eclipse.jdt.internal.core.dom.util.DOMASTUtil; +import junit.framework.AssertionFailedError; +import junit.framework.Test; + // testing @SuppressWarnings({"rawtypes", "unchecked"}) @@ -9507,7 +9604,8 @@ public void testNodeTypeConstants() throws Exception { ASTNode.ENHANCED_FOR_WITH_RECORD_PATTERN, ASTNode.STRING_TEMPLATE_EXPRESSION, ASTNode.STRING_FRAGMENT, - ASTNode.STRING_TEMPLATE_COMPONENT + ASTNode.STRING_TEMPLATE_COMPONENT, + ASTNode.UNNAMED_CLASS }; // assert that nodeType values are correct: diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java index 1aa6c7445a3..44be7f80f15 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModuleBuilderTests.java @@ -8580,10 +8580,11 @@ public void testReleaseOption10() throws Exception { IMarker[] markers = p.getProject().findMarkers(null, true, IResource.DEPTH_INFINITE); sortMarkers(markers); String expected = - "Syntax error on token \"module\", package expected\n" + - "Syntax error on token(s), misplaced construct(s)\n" + - "Syntax error on token \".\", , expected\n" + - "Syntax error on token \"}\", delete this token"; + """ + Syntax error on token(s), misplaced construct(s) + Syntax error on token(s), misplaced construct(s) + Syntax error on token ".", , expected + Syntax error on token "}", delete this token"""; assertMarkers("Unexpected markers", expected, markers); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java index fbfb8f163c1..1f5f193552f 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeHierarchyTests.java @@ -23,8 +23,6 @@ import java.util.Arrays; import java.util.HashMap; -import junit.framework.Test; - import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IncrementalProjectBuilder; @@ -50,6 +48,8 @@ import org.eclipse.jdt.core.tests.model.Semaphore.TimeOutException; import org.eclipse.jdt.core.tests.util.Util; +import junit.framework.Test; + @SuppressWarnings("rawtypes") public class TypeHierarchyTests extends ModifyingResourceTests { /** @@ -446,7 +446,7 @@ public void testBinaryInWrongPackage() throws CoreException { ); getProject("P").build(IncrementalProjectBuilder.FULL_BUILD, null); waitForAutoBuild(); - getFile("/P/bin/p/X.class").copy(new Path("/P/lib/X.class"), false, null); + getFile("/P/bin/p/.class").copy(new Path("/P/lib/X.class"), false, null); ITypeHierarchy hierarchy = getClassFile("P", "/P/lib", "", "X.class").getType().newSupertypeHierarchy(null); assertHierarchyEquals( "Focus: X [in X.class [in [in lib [in P]]]]\n" + @@ -2032,24 +2032,27 @@ public void testResilienceToMissingBinaries() throws CoreException { createFolder("/P/src/tools/"); createFile( "/P/src/tools/DisplayTestResult2.java", - "pakage tools;\n" + + "package tools;\n" + "import servlet.*;\n" + "public class DisplayTestResult2 extends TmrServlet2 {\n" + - "}" + "}\n" + + "obscruction" ); createFolder("/P/src/servlet/"); createFile( "/P/src/servlet/TmrServlet2.java", - "pakage servlet;\n" + + "package servlet;\n" + "public class TmrServlet2 extends TmrServlet {\n" + - "}" + "}\n" + + "obstruction" ); createFile( "/P/src/servlet/TmrServlet.java", - "pakage servlet;\n" + + "package servlet;\n" + "import gk.*;\n" + "public class TmrServlet extends GKServlet {\n" + - "}" + "}\n" + + "obstruction" ); IType type = getCompilationUnit("P", "src", "tools", "DisplayTestResult2.java").getType("DisplayTestResult2"); ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null); @@ -3381,12 +3384,13 @@ public void testBug457813() throws CoreException { "public class X extends aspose.b.a.a {\n" + "}" ); - IType type = getCompilationUnit("P", "src", "hierarchy", "X.java").getType("X"); + IType type = getCompilationUnit("P", "src", "hierarchy", "X.java").getType(""); assertTrue("Type should exist!", type.exists()); ITypeHierarchy hierarchy = type.newTypeHierarchy(null); // when bug occurred a stack overflow happened here... assertHierarchyEquals( - "Focus: X [in X.java [in hierarchy [in src [in P]]]]\n" + + "Focus: [in X.java [in hierarchy [in src [in P]]]]\n" + "Super types:\n" + + " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" + "Sub types:\n", hierarchy); } finally { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java index d511e6d2207..efdca085207 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java @@ -222,6 +222,81 @@ protected void buildBodyDeclarations( convert(typeDeclaration.javadoc, typeDecl); } + protected void buildBodyDeclarations( + org.eclipse.jdt.internal.compiler.ast.UnnamedClass unnamedClass, + UnnamedClass newUnnamedClass, + boolean isInterface) { + // add body declaration in the lexical order + org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] members = unnamedClass.memberTypes; + org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = unnamedClass.fields; + org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = unnamedClass.methods; + + int fieldsLength = fields == null? 0 : fields.length; + int methodsLength = methods == null? 0 : methods.length; + int membersLength = members == null ? 0 : members.length; + int fieldsIndex = 0; + int methodsIndex = 0; + int membersIndex = 0; + + while ((fieldsIndex < fieldsLength) + || (membersIndex < membersLength) + || (methodsIndex < methodsLength)) { + org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; + org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; + org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; + + int position = Integer.MAX_VALUE; + int nextDeclarationType = -1; + if (fieldsIndex < fieldsLength) { + nextFieldDeclaration = fields[fieldsIndex]; + if (nextFieldDeclaration.declarationSourceStart < position) { + position = nextFieldDeclaration.declarationSourceStart; + nextDeclarationType = 0; // FIELD + } + } + if (methodsIndex < methodsLength) { + nextMethodDeclaration = methods[methodsIndex]; + if (nextMethodDeclaration.declarationSourceStart < position) { + position = nextMethodDeclaration.declarationSourceStart; + nextDeclarationType = 1; // METHOD + } + } + if (membersIndex < membersLength) { + nextMemberDeclaration = members[membersIndex]; + if (nextMemberDeclaration.declarationSourceStart < position) { + position = nextMemberDeclaration.declarationSourceStart; + nextDeclarationType = 2; // MEMBER + } + } + switch (nextDeclarationType) { + case 0 : + if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) { + newUnnamedClass.bodyDeclarations().add(convert(nextFieldDeclaration)); + } else { + checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, newUnnamedClass.bodyDeclarations()); + } + fieldsIndex++; + break; + case 1 : + methodsIndex++; + if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { + newUnnamedClass.bodyDeclarations().add(convert(isInterface, nextMethodDeclaration)); + } + break; + case 2 : + membersIndex++; + ASTNode node = convert(nextMemberDeclaration); + if (node == null) { + newUnnamedClass.setFlags(newUnnamedClass.getFlags() | ASTNode.MALFORMED); + } else { + newUnnamedClass.bodyDeclarations().add(node); + } + } + } + // Convert javadoc + convert(unnamedClass.javadoc, newUnnamedClass); + } + protected void buildBodyDeclarations( org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration, RecordDeclaration recordDeclaration, @@ -3405,6 +3480,8 @@ public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typ return null; } return convertToRecordDeclaration(typeDeclaration); + } else if (typeDeclaration instanceof org.eclipse.jdt.internal.compiler.ast.UnnamedClass unnamedClass) { + return convertToUnnamedClass(unnamedClass); } checkCanceled(); TypeDeclaration typeDecl = new TypeDeclaration(this.ast); @@ -3484,6 +3561,20 @@ public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typ return typeDecl; } + private ASTNode convertToUnnamedClass(org.eclipse.jdt.internal.compiler.ast.UnnamedClass unnamedClass) { + UnnamedClass typeDecl = new UnnamedClass(this.ast); + ASTNode oldReferenceContext = this.referenceContext; + this.referenceContext = typeDecl; + typeDecl.setSourceRange(unnamedClass.declarationSourceStart, unnamedClass.bodyEnd - unnamedClass.declarationSourceStart + 1); + + buildBodyDeclarations(unnamedClass, typeDecl, false); + if (this.resolveBindings) { + recordNodes(typeDecl, unnamedClass); + } + this.referenceContext = oldReferenceContext; + return typeDecl; + } + public TypeParameter convert(org.eclipse.jdt.internal.compiler.ast.TypeParameter typeParameter) { final TypeParameter typeParameter2 = new TypeParameter(this.ast); final SimpleName simpleName = new SimpleName(this.ast); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java index 102be3378b1..ae98501797c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java @@ -3249,4 +3249,19 @@ public boolean match(StringTemplateComponent node, Object other) { } return false; } + /** + * Returns whether the given node and the other object match. + * @param node the node to check + * @param other the other object + * @since 3.37 + */ + public boolean match(UnnamedClass node, Object other) { + if (!(other instanceof UnnamedClass)) { + return false; + } + UnnamedClass o = (UnnamedClass) other; + return (safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) + && safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations())); + } + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java index c201047ec66..8bb3bc88b4f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java @@ -1099,6 +1099,13 @@ public abstract class ASTNode { */ public static final int STRING_TEMPLATE_COMPONENT = 117; + /** + * @see UnnamedClass + * @since 3.37 + * @noreference This field is not intended to be referenced by clients. + */ + public static final int UNNAMED_CLASS = 118; + /** * Returns the node class for the corresponding node type. * @@ -1345,6 +1352,8 @@ public static Class nodeClassForType(int nodeType) { return StringFragment.class; case STRING_TEMPLATE_COMPONENT : return StringTemplateComponent.class; + case UNNAMED_CLASS : + return UnnamedClass.class; } throw new IllegalArgumentException(); } @@ -2076,7 +2085,7 @@ ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean ge * @since 3.0 */ List internalGetChildListProperty(ChildListPropertyDescriptor property) { - throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ + throw new RuntimeException("Node does not have this property" + property.toString()); //$NON-NLS-1$ } /** diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java index b003eb14f5c..e617948c3f5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java @@ -2150,6 +2150,23 @@ public boolean visit(StringTemplateComponent node) { return true; } + /** + * Visits the given type-specific AST node. + *

+ * The default implementation does nothing and returns true. + * Subclasses may reimplement. + *

+ * + * @param unnamedClass the unnamedClass to visit + * @return true if the children of this node should be + * visited, and false if the children of this node should + * be skipped + * @since 3.37 + */ + public boolean visit(UnnamedClass unnamedClass) { + return true; + } + /** * End of visit the given type-specific AST node. *

@@ -3604,4 +3621,17 @@ public void endVisit(StringFragment node) { public void endVisit(StringTemplateComponent node) { // default implementation: do nothing } + /** + * End of visit the given type-specific AST node. + *

+ * The default implementation does nothing. Subclasses may reimplement. + *

+ * + * @param node the node to visit + * @since 3.37 + */ + public void endVisit(UnnamedClass node) { + // default implementation: do nothing + } + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java index 4e22ecd5b08..731456ff158 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java @@ -13,8 +13,6 @@ *******************************************************************************/ package org.eclipse.jdt.core.dom; -import java.util.List; - /** * Abstract subclass for type declaration, enum declaration, * and annotation type declaration AST node types. @@ -28,7 +26,7 @@ * @since 3.0 */ @SuppressWarnings("rawtypes") -public abstract class AbstractTypeDeclaration extends BodyDeclaration { +public abstract class AbstractTypeDeclaration extends AbstractUnnamedTypeDeclaration { /** * The type name; lazily initialized; defaults to a unspecified, @@ -37,32 +35,6 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { */ SimpleName typeName = null; - /** - * The body declarations (element type: {@link BodyDeclaration}). - * Defaults to an empty list. - * @since 2.0 (originally declared on {@link TypeDeclaration}) - */ - ASTNode.NodeList bodyDeclarations; - - /** - * Returns structural property descriptor for the "bodyDeclarations" property - * of this node (element type: {@link BodyDeclaration}). - * - * @return the property descriptor - */ - abstract ChildListPropertyDescriptor internalBodyDeclarationsProperty(); - - /** - * Returns structural property descriptor for the "bodyDeclarations" property - * of this node (element type: {@link BodyDeclaration}). - * - * @return the property descriptor - * @since 3.1 - */ - public final ChildListPropertyDescriptor getBodyDeclarationsProperty() { - return internalBodyDeclarationsProperty(); - } - /** * Returns structural property descriptor for the "name" property * of this node (child type: {@link SimpleName}). @@ -82,16 +54,6 @@ public final ChildPropertyDescriptor getNameProperty() { return internalNameProperty(); } - /** - * Creates and returns a structural property descriptor for the - * "bodyDeclaration" property declared on the given concrete node type (element type: {@link BodyDeclaration}). - * - * @return the property descriptor - */ - static final ChildListPropertyDescriptor internalBodyDeclarationPropertyFactory(Class nodeClass) { - return new ChildListPropertyDescriptor(nodeClass, "bodyDeclarations", BodyDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - } - /** * Creates and returns a structural property descriptor for the * "name" property declared on the given concrete node type (child type: {@link SimpleName}). @@ -115,7 +77,6 @@ static final ChildPropertyDescriptor internalNamePropertyFactory(Class nodeClass */ AbstractTypeDeclaration(AST ast) { super(ast); - this.bodyDeclarations = new ASTNode.NodeList(internalBodyDeclarationsProperty()); } /** @@ -161,70 +122,6 @@ public void setName(SimpleName typeName) { postReplaceChild(oldChild, typeName, p); } - /** - * Returns the live ordered list of body declarations of this type - * declaration. - * - * @return the live list of body declarations - * (element type: {@link BodyDeclaration}) - * @since 2.0 (originally declared on {@link TypeDeclaration}) - */ - public List bodyDeclarations() { - return this.bodyDeclarations; - } - - /** - * Returns whether this type declaration is a package member (that is, - * a top-level type). - *

- * Note that this is a convenience method that simply checks whether - * this node's parent is a compilation unit node. - *

- * - * @return true if this type declaration is a child of - * a compilation unit node, and false otherwise - * @since 2.0 (originally declared on {@link TypeDeclaration}) - */ - public boolean isPackageMemberTypeDeclaration() { - ASTNode parent = getParent(); - return (parent instanceof CompilationUnit); - } - - /** - * Returns whether this type declaration is a type member. - *

- * Note that this is a convenience method that simply checks whether - * this node's parent is a type declaration node or an anonymous - * class declaration. - *

- * - * @return true if this type declaration is a child of - * a type declaration node or an anonymous class declaration node, - * and false otherwise - * @since 2.0 (originally declared on {@link TypeDeclaration}) - */ - public boolean isMemberTypeDeclaration() { - ASTNode parent = getParent(); - return (parent instanceof AbstractTypeDeclaration) - || (parent instanceof AnonymousClassDeclaration); - } - - /** - * Returns whether this type declaration is a local type. - *

- * Note that this is a convenience method that simply checks whether - * this node's parent is a type declaration statement node. - *

- * - * @return true if this type declaration is a child of - * a type declaration statement node, and false otherwise - * @since 2.0 (originally declared on TypeDeclaration) - */ - public boolean isLocalTypeDeclaration() { - ASTNode parent = getParent(); - return (parent instanceof TypeDeclarationStatement); - } - /** * Resolves and returns the binding for the type declared in this type * declaration. @@ -252,7 +149,7 @@ public final ITypeBinding resolveBinding() { @Override int memSize() { - return super.memSize() + 2 * 4; + return super.memSize() + 4; } } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractUnnamedTypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractUnnamedTypeDeclaration.java new file mode 100644 index 00000000000..3e1076bf0f3 --- /dev/null +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractUnnamedTypeDeclaration.java @@ -0,0 +1,121 @@ +package org.eclipse.jdt.core.dom; + +import java.util.List; + +/** + * @since 3.37 + */ +@SuppressWarnings("rawtypes") +public abstract class AbstractUnnamedTypeDeclaration extends BodyDeclaration { + + /** + * The body declarations (element type: {@link BodyDeclaration}). + * Defaults to an empty list. + * @since 2.0 (originally declared on {@link TypeDeclaration}) + */ + ASTNode.NodeList bodyDeclarations; + + /** + * Returns structural property descriptor for the "bodyDeclarations" property + * of this node (element type: {@link BodyDeclaration}). + * + * @return the property descriptor + */ + abstract ChildListPropertyDescriptor internalBodyDeclarationsProperty(); + + public AbstractUnnamedTypeDeclaration(AST ast) { + super(ast); + this.bodyDeclarations = new ASTNode.NodeList(internalBodyDeclarationsProperty()); + } + + /** + * Returns the live ordered list of body declarations of this type + * declaration. + * + * @return the live list of body declarations + * (element type: {@link BodyDeclaration}) + * @since 2.0 (originally declared on {@link TypeDeclaration}) + */ + public List bodyDeclarations() { + return this.bodyDeclarations; + } + + /** + * Creates and returns a structural property descriptor for the + * "bodyDeclaration" property declared on the given concrete node type (element type: {@link BodyDeclaration}). + * + * @return the property descriptor + */ + static final ChildListPropertyDescriptor internalBodyDeclarationPropertyFactory(Class nodeClass) { + return new ChildListPropertyDescriptor(nodeClass, "bodyDeclarations", BodyDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ + } + + /** + * Returns structural property descriptor for the "bodyDeclarations" property + * of this node (element type: {@link BodyDeclaration}). + * + * @return the property descriptor + * @since 3.1 (originally declared on {@link AbstractTypeDeclaration}) + */ + public final ChildListPropertyDescriptor getBodyDeclarationsProperty() { + return internalBodyDeclarationsProperty(); + } + + /** + * Returns whether this type declaration is a package member (that is, + * a top-level type). + *

+ * Note that this is a convenience method that simply checks whether + * this node's parent is a compilation unit node. + *

+ * + * @return true if this type declaration is a child of + * a compilation unit node, and false otherwise + * @since 2.0 (originally declared on {@link TypeDeclaration}) + */ + public boolean isPackageMemberTypeDeclaration() { + ASTNode parent = getParent(); + return (parent instanceof CompilationUnit); + } + + /** + * Returns whether this type declaration is a type member. + *

+ * Note that this is a convenience method that simply checks whether + * this node's parent is a type declaration node or an anonymous + * class declaration. + *

+ * + * @return true if this type declaration is a child of + * a type declaration node or an anonymous class declaration node, + * and false otherwise + * @since 2.0 (originally declared on {@link TypeDeclaration}) + */ + public boolean isMemberTypeDeclaration() { + ASTNode parent = getParent(); + return (parent instanceof AbstractTypeDeclaration) + || (parent instanceof AnonymousClassDeclaration); + } + + /** + * Returns whether this type declaration is a local type. + *

+ * Note that this is a convenience method that simply checks whether + * this node's parent is a type declaration statement node. + *

+ * + * @return true if this type declaration is a child of + * a type declaration statement node, and false otherwise + * @since 2.0 (originally declared on TypeDeclaration) + */ + public boolean isLocalTypeDeclaration() { + ASTNode parent = getParent(); + return (parent instanceof TypeDeclarationStatement); + } + + @Override + int memSize() { + return super.memSize() + 4; + } + +} diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java index 8fd63242075..87ac3d24ba1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java @@ -109,12 +109,12 @@ public class CompilationUnit extends ASTNode { private static final List PROPERTY_DESCRIPTORS_9_0; /** - * The "types" structural property of this node type (element type: {@link AbstractTypeDeclaration}). + * The "types" structural property of this node type (element type: {@link AbstractUnnamedTypeDeclaration}). * * @since 3.0 */ public static final ChildListPropertyDescriptor TYPES_PROPERTY = - new ChildListPropertyDescriptor(CompilationUnit.class, "types", AbstractTypeDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ + new ChildListPropertyDescriptor(CompilationUnit.class, "types", AbstractUnnamedTypeDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ static { List properyList = new ArrayList(4); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnnamedClass.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnnamedClass.java new file mode 100644 index 00000000000..0ad175505ba --- /dev/null +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/UnnamedClass.java @@ -0,0 +1,164 @@ +package org.eclipse.jdt.core.dom; + +import java.util.ArrayList; +import java.util.List; + +/** + * @since 3.37 + */ +public class UnnamedClass extends AbstractUnnamedTypeDeclaration { + + @Deprecated + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + internalModifiersPropertyFactory(UnnamedClass.class); + + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + internalModifiers2PropertyFactory(UnnamedClass.class); + + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + internalJavadocPropertyFactory(UnnamedClass.class); + + public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = + internalBodyDeclarationPropertyFactory(UnnamedClass.class); + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + * @since 3.0 + */ + private static final List PROPERTY_DESCRIPTORS_2_0; + + /** + * A list of property descriptors (element type: + * {@link StructuralPropertyDescriptor}), + * or null if uninitialized. + * @since 3.1 + */ + private static final List PROPERTY_DESCRIPTORS_3_0; + + static { + List propertyList = new ArrayList<>(8); + createPropertyList(UnnamedClass.class, propertyList); + addProperty(BODY_DECLARATIONS_PROPERTY, propertyList); + addProperty(JAVADOC_PROPERTY, propertyList); + addProperty(MODIFIERS_PROPERTY, propertyList); + PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); + + propertyList = new ArrayList<>(8); + createPropertyList(UnnamedClass.class, propertyList); + addProperty(BODY_DECLARATIONS_PROPERTY, propertyList); + addProperty(JAVADOC_PROPERTY, propertyList); + addProperty(MODIFIERS2_PROPERTY, propertyList); + PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); + } + + UnnamedClass(AST ast) { + super(ast); + } + + @Override + SimplePropertyDescriptor internalModifiersProperty() { + return MODIFIERS_PROPERTY; + } + + @Override + ChildListPropertyDescriptor internalModifiers2Property() { + return MODIFIERS2_PROPERTY; + } + + @Override + ChildPropertyDescriptor internalJavadocProperty() { + return JAVADOC_PROPERTY; + } + + @Override + List internalStructuralPropertiesForType(int apiLevel) { + if (apiLevel == AST.JLS2_INTERNAL) { + return PROPERTY_DESCRIPTORS_2_0; + } + return PROPERTY_DESCRIPTORS_3_0; + } + + @Override + int getNodeType0() { + return UNNAMED_CLASS; + } + + @Override + boolean subtreeMatch0(ASTMatcher matcher, Object other) { + return matcher.match(this, other); + } + + @Override + ASTNode clone0(AST target) { + UnnamedClass result = new UnnamedClass(target); + result.setSourceRange(getStartPosition(), getLength()); + result.setJavadoc( + (Javadoc) ASTNode.copySubtree(target, getJavadoc())); + result.bodyDeclarations().addAll( + ASTNode.copySubtrees(target, bodyDeclarations())); + return result; + } + + @Override + void accept0(ASTVisitor visitor) { + boolean visitChildren = visitor.visit(this); + if (visitChildren) { + acceptChild(visitor, getJavadoc()); + acceptChildren(visitor, this.bodyDeclarations); + } + visitor.endVisit(this); + } + + @Override + int treeSize() { + return memSize() + this.bodyDeclarations.listSize(); + } + + @Override + final ChildListPropertyDescriptor internalBodyDeclarationsProperty() { + return BODY_DECLARATIONS_PROPERTY; + } + + @Override + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { + if (property == JAVADOC_PROPERTY) { + if (get) { + return getJavadoc(); + } else { + setJavadoc((Javadoc) child); + return null; + } + } + // allow default implementation to flag the error + return super.internalGetSetChildProperty(property, get, child); + } + + @Override + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { + if (property == MODIFIERS2_PROPERTY) { + return modifiers(); + } + if (property == BODY_DECLARATIONS_PROPERTY) { + return bodyDeclarations(); + } + // allow default implementation to flag the error + return super.internalGetChildListProperty(property); + } + + @Override + final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { + if (property == MODIFIERS_PROPERTY) { + if (get) { + return getModifiers(); + } else { + internalSetModifiers(value); + return 0; + } + } + // allow default implementation to flag the error + return super.internalGetSetIntProperty(property, get, value); + } + +} diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java index 4abbb026119..fc1cf0188d8 100644 --- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java +++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/LineBreaksPreparator.java @@ -73,6 +73,7 @@ import org.eclipse.jdt.core.dom.ThrowStatement; import org.eclipse.jdt.core.dom.TryStatement; import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.core.dom.UnnamedClass; import org.eclipse.jdt.core.dom.VariableDeclarationExpression; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.core.dom.WhileStatement; @@ -182,7 +183,7 @@ private void handleBodyDeclarations(List bodyDeclarations) { } if (previous != null) { ASTNode parent = previous.getParent(); - if (!(parent instanceof TypeDeclaration && this.tm.isFake((TypeDeclaration) parent))) { + if (!(parent instanceof TypeDeclaration && this.tm.isFake((TypeDeclaration) parent) || parent instanceof UnnamedClass)) { Token lastToken = this.tm.lastTokenIn(parent, -1); putBlankLinesBefore(lastToken, this.options.blank_lines_after_last_class_body_declaration); } @@ -775,4 +776,10 @@ public void finishUp() { token.setIndent(currentIndent * this.options.indentation_size); } } + + @Override + public boolean visit(UnnamedClass node) { + handleBodyDeclarations(node.bodyDeclarations()); + return true; + } } diff --git a/org.eclipse.jdt.core/jdtCompilerAdapter.jar b/org.eclipse.jdt.core/jdtCompilerAdapter.jar deleted file mode 100644 index b436019212e..00000000000 Binary files a/org.eclipse.jdt.core/jdtCompilerAdapter.jar and /dev/null differ