diff options
author | Jay Arthanareeswaran | 2019-12-20 06:03:25 +0000 |
---|---|---|
committer | Jay Arthanareeswaran | 2020-01-20 11:50:53 +0000 |
commit | 812ce14a4f745f02fbd1f5a93ecd4101bf3894ac (patch) | |
tree | 203117db222ad931f7b4ce182fbb657da8fbadba | |
parent | 5119d711a6734c6b92e7dd43247e69f5d72ad73c (diff) | |
download | eclipse.jdt.core-812ce14a4f745f02fbd1f5a93ecd4101bf3894ac.tar.gz eclipse.jdt.core-812ce14a4f745f02fbd1f5a93ecd4101bf3894ac.tar.xz eclipse.jdt.core-812ce14a4f745f02fbd1f5a93ecd4101bf3894ac.zip |
Change-Id: Ia7200135c91d4a0b3d281a8b6049da03407e7d2a
Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
45 files changed, 2420 insertions, 487 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java index f47faab42f..d13de86f5a 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -117,10 +117,10 @@ public abstract class AbstractRegressionTest extends AbstractCompilerTest implem .map(e -> e.getKey() + "=" + e.getValue()) .toArray(String[]::new); - protected class Runner { + public class Runner { boolean shouldFlushOutputDirectory = true; // input: - String[] testFiles; + public String[] testFiles; String[] dependantFiles; String[] classLibraries; boolean libsOnModulePath; @@ -140,14 +140,14 @@ public abstract class AbstractRegressionTest extends AbstractCompilerTest implem JavacTestOptions javacTestOptions; // execution: boolean forceExecution; - String[] vmArguments; - String expectedOutputString; + public String[] vmArguments; + public String expectedOutputString; String expectedErrorString; ASTVisitor visitor; - + public Runner() {} @SuppressWarnings("synthetic-access") - protected void runConformTest() { + public void runConformTest() { runTest(this.shouldFlushOutputDirectory, this.testFiles, this.dependantFiles != null ? this.dependantFiles : new String[] {}, @@ -1872,6 +1872,11 @@ protected static class JavacTestOptions { JavacTestOptions.DEFAULT /* default javac test options */, charset); } + protected void runConformTest(String[] testFiles, String expectedOutput, Map<String, String> customOptions, String[] vmArguments) { + runConformTest(testFiles, expectedOutput, customOptions, vmArguments, RUN_JAVAC ? /* javac test options */ + new JavacTestOptions("-source 1.4") : + JavacTestOptions.DEFAULT); + } protected void runConformTest(String[] testFiles, String expectedOutput, Map<String, String> customOptions, String[] vmArguments, JavacTestOptions javacOptions) { runTest( // test directory preparation @@ -1894,28 +1899,6 @@ protected static class JavacTestOptions { // javac options javacOptions); } - protected void runConformTest(String[] testFiles, String expectedOutput, Map<String, String> customOptions, String[] vmArguments) { - runTest( - // test directory preparation - true /* flush output directory */, - testFiles /* test files */, - // compiler options - null /* no class libraries */, - customOptions /* no custom options */, - false /* do not perform statements recovery */, - null /* no custom requestor */, - // compiler results - false /* expecting no compiler errors */, - null /* do not check compiler log */, - // runtime options - false /* do not force execution */, - vmArguments /* no vm arguments */, - // runtime results - expectedOutput /* expected output string */, - null /* do not check error string */, - // javac options - JavacTestOptions.DEFAULT /* default javac test options */); - } protected void runConformTest( String[] testFiles, String[] dependantFiles, @@ -2750,7 +2733,16 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti String[] classLibraries, boolean shouldFlushOutputDirectory, Map customOptions) { - runNegativeTest(testFiles, expectedCompilerLog, classLibraries, shouldFlushOutputDirectory, null, customOptions); + runNegativeTest(testFiles, expectedCompilerLog, classLibraries, shouldFlushOutputDirectory, null, customOptions, JavacTestOptions.DEFAULT); + } + protected void runNegativeTest( + String[] testFiles, + String expectedCompilerLog, + String[] classLibraries, + boolean shouldFlushOutputDirectory, + String[] vmArguments, + Map customOptions) { + runNegativeTest(testFiles, expectedCompilerLog, classLibraries, shouldFlushOutputDirectory, vmArguments, customOptions, JavacTestOptions.DEFAULT); } protected void runNegativeTest( String[] testFiles, @@ -2758,7 +2750,8 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti String[] classLibraries, boolean shouldFlushOutputDirectory, String[] vmArguments, - Map customOptions) { + Map customOptions, + JavacTestOptions javacOptions) { runTest( // test directory preparation shouldFlushOutputDirectory /* should flush output directory */, @@ -2783,7 +2776,7 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti null /* do not check output string */, null /* do not check error string */, // javac options - JavacTestOptions.DEFAULT /* default javac test options */); + javacOptions); } protected void runNegativeTest( boolean skipJavac, @@ -3442,7 +3435,7 @@ protected void runNegativeTest(boolean skipJavac, JavacTestOptions javacTestOpti } } // javac part - if (RUN_JAVAC && javacTestOptions != JavacTestOptions.SKIP) { + if (RUN_JAVAC) { runJavac(testFiles, expectingCompilerErrors, expectedCompilerLog, expectedJavacOutputString, expectedErrorString, shouldFlushOutputDirectory, javacTestOptions, vmArguments, classLibraries, libsOnModulePath); diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java new file mode 100644 index 0000000000..d688bfaaf0 --- /dev/null +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/PatternMatching14Test.java @@ -0,0 +1,1491 @@ +/******************************************************************************* + * Copyright (c) 2020 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.tests.compiler.regression; + +import java.util.Map; + +import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; + +import junit.framework.Test; + +public class PatternMatching14Test extends AbstractRegressionTest { + + private static final JavacTestOptions JAVAC_OPTIONS = new JavacTestOptions("-source 14 --enable-preview"); + static { +// TESTS_NUMBERS = new int [] { 40 }; +// TESTS_RANGE = new int[] { 1, -1 }; +// TESTS_NAMES = new String[] { "test022" }; + } + + public static Class<?> testClass() { + return PatternMatching14Test.class; + } + public static Test suite() { + return buildMinimalComplianceTestSuite(testClass(), F_14); + } + public PatternMatching14Test(String testName){ + super(testName); + } + // Enables the tests to run individually + protected Map<String, String> getCompilerOptions(boolean preview) { + Map<String, String> defaultOptions = super.getCompilerOptions(); + defaultOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_14); + defaultOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_14); + defaultOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_14); + defaultOptions.put(CompilerOptions.OPTION_EnablePreviews, + preview ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); + defaultOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING); + return defaultOptions; + } + + @Override + protected void runConformTest(String[] testFiles, String expectedOutput, Map<String, String> customOptions) { + runConformTest(testFiles, expectedOutput, customOptions, new String[] {"--enable-preview"}, JAVAC_OPTIONS); + } + protected void runNegativeTest( + String[] testFiles, + String expectedCompilerLog, + String javacLog, + String[] classLibraries, + boolean shouldFlushOutputDirectory, + Map<String, String> customOptions) { + Runner runner = new Runner(); + runner.testFiles = testFiles; + runner.expectedCompilerLog = expectedCompilerLog; + runner.javacTestOptions = JAVAC_OPTIONS; + runner.customOptions = customOptions; + runner.expectedJavacOutputString = javacLog; + runner.runNegativeTest(); + } + public void test001() { + Map<String, String> options = getCompilerOptions(false); + runNegativeTest( + new String[] { + "X1.java", + "public class X1 {\n" + + " public void foo(Object obj) {\n" + + " if (obj instanceof String s) {\n" + + " }\n " + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X1.java (at line 3)\n" + + " if (obj instanceof String s) {\n" + + " ^^^^^^^^\n" + + "Instanceof Pattern is a preview feature and disabled by default. Use --enable-preview to enable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test002() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X2.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X2 {\n" + + " public void foo(Integer obj) {\n" + + " if (obj instanceof String s) {\n" + + " }\n " + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X2.java (at line 4)\n" + + " if (obj instanceof String s) {\n" + + " ^^^^^^^^^^^^^^^^^^^^^^^\n" + + "Incompatible conditional operand types Integer and String\n" + + "----------\n", + "", + null, + true, + options); + } + public void test003() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X3.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X3 {\n" + + " public void foo(Number num) {\n" + + " if (num instanceof Integer s) {\n" + + " } else if (num instanceof String) {\n" + + " }\n " + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X3.java (at line 5)\n" + + " } else if (num instanceof String) {\n" + + " ^^^^^^^^^^^^^^^^^^^^^\n" + + "Incompatible conditional operand types Number and String\n" + + "----------\n", + "", + null, + true, + options); + } + public void test004() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X4.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X4 {\n" + + " public void foo(Object obj) {\n" + + " String s = null;\n" + + " if (obj instanceof Integer s) {\n" + + " } else if (obj instanceof String) {\n" + + " }\n " + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X4.java (at line 5)\n" + + " if (obj instanceof Integer s) {\n" + + " ^\n" + + "Duplicate local variable s\n" + + "----------\n", + "", + null, + true, + options); + } + public void test005() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X5.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X5 {\n" + + "@SuppressWarnings(\"preview\")\n" + + " public static void foo(Object obj) {\n" + + " if (obj instanceof Integer i) {\n" + + " System.out.print(i);\n" + + " } else if (obj instanceof String s) {\n" + + " System.out.print(s);\n" + + " }\n " + + " }\n" + + " public static void main(String[] obj) {\n" + + " foo(100);\n" + + " }\n" + + "}\n", + }, + "100", + options); + } + public void test006() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X6.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X6 {\n" + + " public static void foo(Object obj) {\n" + + " if (obj instanceof Integer i) {\n" + + " System.out.print(i);\n" + + " } else if (obj instanceof String s) {\n" + + " System.out.print(s);\n" + + " }\n " + + " }\n" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "abcd", + options); + } + public void test006a() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X6a.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X6a {\n" + + " public static void foo(Object obj) {\n" + + " if (obj != null) {\n" + + " if (obj instanceof Integer i) {\n" + + " System.out.print(i);\n" + + " } else if (obj instanceof String s) {\n" + + " System.out.print(i);\n" + + " }\n " + + " }\n " + + " System.out.print(i);\n" + + " }\n" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X6a.java (at line 8)\n" + + " System.out.print(i);\n" + + " ^\n" + + "i cannot be resolved to a variable\n" + + "----------\n" + + "2. ERROR in X6a.java (at line 11)\n" + + " System.out.print(i);\n" + + " ^\n" + + "i cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test006b() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X6b.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X6b {\n" + + " public static void foo(Object obj) {\n" + + " if (obj != null) {\n" + + " if (obj instanceof Integer i) {\n" + + " System.out.print(i);\n" + + " } else if (obj instanceof String s) {\n" + + " System.out.print(i);\n" + + " }\n " + + " }\n " + + " System.out.print(s);\n" + + " }\n" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X6b.java (at line 8)\n" + + " System.out.print(i);\n" + + " ^\n" + + "i cannot be resolved to a variable\n" + + "----------\n" + + "2. ERROR in X6b.java (at line 11)\n" + + " System.out.print(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test006c() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X6c.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X6c {\n" + + " public static void foo(Object obj) {\n" + + " if (obj instanceof Integer i) {\n" + + " System.out.print(i);\n" + + " } else if (obj instanceof String s) {\n" + + " System.out.print(i);\n" + + " }\n " + + " }\n" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X6c.java (at line 7)\n" + + " System.out.print(i);\n" + + " ^\n" + + "i cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test006d() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X6d.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X6d {\n" + + " public static void foo(Object obj) {\n" + + " if (obj instanceof Integer i) {\n" + + " System.out.print(i);\n" + + " } else {\n" + + " System.out.print(i);\n" + + " }\n " + + " }\n" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X6d.java (at line 7)\n" + + " System.out.print(i);\n" + + " ^\n" + + "i cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test007() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X7.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X7 {\n" + + " public static void foo(Object obj) {\n" + + " if (obj instanceof Integer i) {\n" + + " System.out.print(i);\n" + + " } else if (obj instanceof String s) {\n" + + " System.out.print(i);\n" + + " }\n " + + " }\n" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X7.java (at line 7)\n" + + " System.out.print(i);\n" + + " ^\n" + + "i cannot be resolved to a variable\n" + + "----------\n", + "X7.java:4: warning: [preview] pattern matching in instanceof is a preview feature and may be removed in a future release.\n" + + " if (obj instanceof Integer i) {\n" + + " ^\n" + + "X7.java:6: warning: [preview] pattern matching in instanceof is a preview feature and may be removed in a future release.\n" + + " } else if (obj instanceof String s) {\n" + + " ^\n" + + "X7.java:7: error: cannot find symbol\n" + + " System.out.print(i);\n" + + " ^\n" + + " symbol: variable i\n" + + " location: class X7\n" + + "1 error\n" + + "2 warnings", + null, + true, + options); + } + public void test008() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X8.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X8 {\n" + + " public static void foo(Object b) {\n" + + " Object c = null;\n" + + " if (b != c) {\n" + + " if ((b instanceof String s) && (s.length() != 0))\n" + + " System.out.println(\"s:\" + s);\n" + + " else \n" + + " System.out.println(\"b:\" + b);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(100);\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "b:100\n" + + "s:abcd", + options); + } + public void test009() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X9.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X9 {\n" + + " public static void foo(Object b) {\n" + + " Object c = null;\n" + + " if (b != c) {\n" + + " if ((b instanceof String s) && (s.length() != 0))\n" + + " System.out.println(\"s:\" + s);\n" + + " else if ((b instanceof Integer i2))\n" + + " System.out.println(\"i2:\" + i2);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(100);\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "i2:100\n" + + "s:abcd", + options); + } + public void test010() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X10.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X10 {\n" + + " public static void foo(Object b) {\n" + + " Object c = null;\n" + + " if (b != c) {\n" + + " if (b != null && (b instanceof String s))\n" + + " System.out.println(\"s:\" + s);\n" + + " else " + + " System.out.println(\"b:\" + b);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(100);\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "b:100\n" + + "s:abcd", + options); + } + public void test011() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X11.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X11 {\n" + + " public static void foo(Object b) {\n" + + " Object c = null;\n" + + " if (b == null && (b instanceof String s)) {\n" + + " } else {" + + " }\n" + + " System.out.println(s);\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(100);\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X11.java (at line 7)\n" + + " System.out.println(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test012() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X12.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X12 {\n" + + " public static void foo(Object b) {\n" + + " Object c = null;\n" + + " if (b != c) {\n" + + " if (b == null && (b instanceof String s)) {\n" + + " System.out.println(\"s:\" + s);\n" + + " } else { " + + " System.out.println(\"b:\" + b);\n" + + " }\n" + + " s = null;\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(100);\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X12.java (at line 10)\n" + + " s = null;\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test013() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X13.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X13 {\n" + + " public static void foo(Object b) {\n" + + " Object c = null;\n" + + " if (b != c) {\n" + + " if (b == null && (b instanceof String s))\n" + + " System.out.println(\"s:\" + s);\n" + + " else " + + " System.out.println(\"b:\" + b);\n" + + " System.out.println(s);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(100);\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X13.java (at line 9)\n" + + " System.out.println(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test014() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X14.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X14 {\n" + + " public static void foo(Object o) {\n" + + " if (!(o instanceof String s)) {\n" + + " System.out.print(\"then:\" + s);\n" + + " } else {\n" + + " System.out.print(\"else:\" + s);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X14.java (at line 5)\n" + + " System.out.print(\"then:\" + s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test014a() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X14.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X14 {\n" + + " public static void foo(Object o) {\n" + + " if (!(o instanceof String s)) {\n" + + " System.out.print(\"then:\" + s);\n" + + " } else {\n" + + " System.out.print(\"else:\" + s);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X14.java (at line 5)\n" + + " System.out.print(\"then:\" + s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test014b() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X14.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X14 {\n" + + " public static void foo(Object o) {\n" + + " if (!!(o instanceof String s)) {\n" + + " System.out.print(\"then:\" + s);\n" + + " } else {\n" + + " System.out.print(\"else:\" + s);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X14.java (at line 7)\n" + + " System.out.print(\"else:\" + s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test014c() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X14.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X14 {\n" + + " public static void foo(Object o) {\n" + + " if (o == null) {\n" + + " System.out.print(\"null\");\n" + + " } else if(!(o instanceof String s)) {\n" + + " System.out.print(\"else:\" + s);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X14.java (at line 7)\n" + + " System.out.print(\"else:\" + s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test014d() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X14.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X14 {\n" + + " public static void foo(Object o) {\n" + + " if (o == null) {\n" + + " System.out.print(\"null\");\n" + + " } else if(!!(o instanceof String s)) {\n" + + " System.out.print(\"else:\" + s);\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "else:abcd", + options); + } + public void test014e() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X14a.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X14a {\n" + + " public static void foo(Object o) {\n" + + " if (!(!(o instanceof String s))) {\n" + + " System.out.print(\"s:\" + s);\n" + + " } else {\n" + + " }\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "s:abcd", + options); + } + /* + * Test that when pattern tests for false and if doesn't complete + * normally, then the variable is available beyond the if statement + */ + public void test015() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X15.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X15 {\n" + + " public static void foo(Object o) {\n" + + " if (!(o instanceof String s)) {\n" + + " throw new IllegalArgumentException();\n" + + " } else {\n" + + " System.out.print(\"s:\" + s);\n" + + " }\n" + + " System.out.print(s);\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "s:abcdabcd", + options); + } + /* + * Test that when pattern tests for false and if doesn't complete + * normally, then the variable is available beyond the if statement + */ + public void test015a() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X15a.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X15a {\n" + + " public static void foo(Object o) {\n" + + " if (!(o instanceof String s)) {\n" + + " throw new IllegalArgumentException();\n" + + " }\n" + + " System.out.print(s);\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "abcd", + options); + } + /* + * Test that when pattern tests for false and if completes + * normally, then the variable is not available beyond the if statement + */ + public void test015b() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X15b.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X15b {\n" + + " public static void foo(Object o) {\n" + + " if (!(o instanceof String s)) {\n" + + " //throw new IllegalArgumentException();\n" + + " } else {\n" + + " System.out.print(\"s:\" + s);\n" + + " }\n" + + " System.out.print(s);\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(\"abcd\");\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X15b.java (at line 9)\n" + + " System.out.print(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test016() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X16.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X16 {\n" + + " public static void foo(Object o) {\n" + + " boolean b = (o instanceof String[] s && s.length == 1);\n" + + " System.out.print(b);\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(new String[]{\"one\"});\n" + + " }\n" + + "}\n", + }, + "true", + options); + } + public void test017() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X17.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X17 {\n" + + " public static void foo(Object o) {\n" + + " boolean b = (o instanceof String[] s && s.length == 1);\n" + + " System.out.print(s[0]);\n" + + " }" + + " public static void main(String[] obj) {\n" + + " foo(new String[]{\"one\"});\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X17.java (at line 5)\n" + + " System.out.print(s[0]);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + /* Test that the scopes of pattern variable in a block doesn't affect + * another outside but declared after the block + */ + public void test018() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X18.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X18 {\n" + + " public static void main(String[] obj) {\n" + + " boolean a = true;\n" + + " {\n" + + " boolean b = (obj instanceof String[] s && s.length == 0);\n" + + " System.out.print(b + \",\");\n" + + " }\n" + + " boolean b = a ? false : (obj instanceof String[] s && s.length == 0);\n" + + " System.out.print(b);\n" + + " }\n" + + "}\n", + }, + "true,false", + options); + } + /* Test that the scopes of pattern variable in a block doesn't affect + * another outside but declared before the block + */ + public void test019() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X19.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X19 {\n" + + " public static void main(String[] obj) {\n" + + " boolean a = true;\n" + + " boolean b = a ? false : (obj instanceof String[] s && s.length == 0);\n" + + " System.out.print(b + \",\");\n" + + " {\n" + + " b = (obj instanceof String[] s && s.length == 0);\n" + + " System.out.print(b);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "false,true", + options); + } + /* Test that we allow consequent pattern expressions in the same statement + */ + public void test020() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X20.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X20 {\n" + + " public static void main(String[] o) {\n" + + " boolean b = (o instanceof String[] s) && s instanceof String[] s2;\n" + + " System.out.print(b);\n" + + " }\n" + + "}\n", + }, + "true", + options); + } + /* Test that we allow consequent pattern expressions in the same statement + */ + public void test021() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X21.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X21 {\n" + + " public static void main(String[] o) {\n" + + " boolean b = (o instanceof String[] s) && s instanceof String[] s2;\n" + + " System.out.print(s);\n" + + " System.out.print(s2);\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X21.java (at line 5)\n" + + " System.out.print(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n" + + "2. ERROR in X21.java (at line 6)\n" + + " System.out.print(s2);\n" + + " ^^\n" + + "s2 cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + /* Test that we allow pattern expressions in a while statement + */ + public void test022() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X22.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X22 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object o) {\n" + + " while ((o instanceof String s) && s.length() > 0) {\n" + + " o = s.substring(0, s.length() - 1);\n" + + " System.out.println(s);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "one\non\no", + options); + } + /* Test pattern expressions in a while statement with break + */ + public void test023() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X23.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X23 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object o) {\n" + + " while (!(o instanceof String s) && s.length() > 0) {\n" + + " System.out.println(s);\n" + + " break;\n" + + " }\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X23.java (at line 7)\n" + + " while (!(o instanceof String s) && s.length() > 0) {\n" + + " ^\n" + + "s cannot be resolved\n" + + "----------\n" + + "2. ERROR in X23.java (at line 8)\n" + + " System.out.println(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + /* Test pattern expressions in a while statement with no break + */ + public void test023a() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X23.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X23 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object o) {\n" + + " while (!(o instanceof String s) && s.length() > 0) {\n" + + " System.out.println(s);\n" + + " //break;\n" + + " }\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X23.java (at line 7)\n" + + " while (!(o instanceof String s) && s.length() > 0) {\n" + + " ^\n" + + "s cannot be resolved\n" + + "----------\n" + + "2. ERROR in X23.java (at line 8)\n" + + " System.out.println(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + options); + } + public void test024a() { + Map<String, String> options = getCompilerOptions(true); + runConformTest( + new String[] { + "X24a.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X24a {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object o) {\n" + + " while (!(o instanceof String s)) {\n" + + " throw new IllegalArgumentException();\n" + + " }\n" + + " System.out.println(s);\n" + + " }\n" + + "}\n", + }, + "one", + options); + } + /* Test that we reject two patter variables with same name in the same + * equals expression + */ + public void test025() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X25.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X25 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\", \"two\");\n" + + " }\n" + + " public static void foo(Object o, Object p) {\n" + + " if ((o instanceof String s) != p instanceof String s) {\n" + + " System.out.print(\"s:\" + s);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X25.java (at line 7)\n" + + " if ((o instanceof String s) != p instanceof String s) {\n" + + " ^\n" + + "Duplicate local variable s\n" + + "----------\n", + "", + null, + true, + options); + } + /* Test that we reject two patter variables with same name in the same + * equals expression + */ + public void test026() { + Map<String, String> options = getCompilerOptions(true); + runNegativeTest( + new String[] { + "X26.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X26 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\", \"two\");\n" + + " }\n" + + " public static void foo(Object o, Object p) {\n" + + " if ((o instanceof String s) == p instanceof String s) {\n" + + " System.out.print(\"s:\" + s);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X26.java (at line 7)\n" + + " if ((o instanceof String s) == p instanceof String s) {\n" + + " ^\n" + + "Duplicate local variable s\n" + + "----------\n", + "", + null, + true, + options); + } + public void test027() { + runConformTest( + new String[] { + "X27.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X27 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " for(int i = 0; (obj instanceof String[] s && s.length > 0 && i < s.length); i++) {\n" + + " System.out.println(s[i]);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "", + getCompilerOptions(true)); + } + public void test028() { + runConformTest( + new String[] { + "X28.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X28 {\n" + + " public static void main(String[] o) {\n" + + " foo(new String[] {\"one\", \"two\"});\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " for(int i = 0; (obj instanceof String[] s && s.length > 0 && i < s.length); i++) {\n" + + " System.out.println(s[i]);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "one\ntwo", + getCompilerOptions(true)); + } + public void test029() { + runConformTest( + new String[] { + "X29.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X29 {\n" + + " public static void main(String[] o) {\n" + + " foo(new String[] {\"one\", \"two\"});\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " for(int i = 0; (obj instanceof String[] s) && s.length > 0 && i < s.length; i = (s != null ? i + 1 : i)) {\n" + + " System.out.println(s[i]);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "one\ntwo", + getCompilerOptions(true)); + } + /* + * Test that pattern variables are accepted in initialization of + * a for statement + * TODO: Javac rejects this + */ + public void test030() { + runConformTest( + new String[] { + "X30.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X30 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " for(int i = 0, length = (obj instanceof String s) ? s.length() : 0; i < length; i++) {\n" + + " System.out.print(s.charAt(i));\n" + + " }\n" + + " }\n" + + "}\n", + }, + "one", + getCompilerOptions(true)); + } + public void test031() { + runNegativeTest( + new String[] { + "X31.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X31 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" + + " System.out.println(s[i]);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X31.java (at line 7)\n" + + " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n" + + "2. ERROR in X31.java (at line 7)\n" + + " for(int i = 0; !(obj instanceof String[] s) && s.length > 0 && i < s.length; i++) {\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n" + + "3. ERROR in X31.java (at line 8)\n" + + " System.out.println(s[i]);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + getCompilerOptions(true)); + } + public void test032() { + runConformTest( + new String[] { + "X32.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X32 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " String res = null;\n" + + " int i = 0;\n" + + " switch(i) {\n" + + " case 0:\n" + + " res = (obj instanceof String s) ? s : null;\n" + + " default:\n" + + " break;\n" + + " }\n" + + " System.out.println(res);\n" + + " }\n" + + "}\n", + }, + "one", + getCompilerOptions(true)); + } + /* + * FAILURE: Javac rejects this code, but we accept. + */ + public void test033() { + runConformTest( + new String[] { + "X33.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X33 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " String res = null;\n" + + " int i = 0;\n" + + " switch(i) {\n" + + " case 0:\n" + + " res = (obj instanceof String s) ? s : null;\n" + + " res = s.substring(1);\n" + + " default:\n" + + " break;\n" + + " }\n" + + " System.out.println(res);\n" + + " }\n" + + "}\n", + }, + "ne", + getCompilerOptions(true)); + } + public void test034() { + runNegativeTest( + new String[] { + "X34.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X34 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " int i = 0;\n" + + " String result = switch(i) {\n" + + " case 0 -> {\n" + + " result = (obj instanceof String s) ? s : null;\n" + + " yield result;\n" + + " }\n" + + " default -> {\n" + + " yield result;\n" + + " }\n" + + " };\n" + + " System.out.println(result);\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X34.java (at line 14)\n" + + " yield result;\n" + + " ^^^^^^\n" + + "The local variable result may not have been initialized\n" + + "----------\n", + "", + null, + true, + getCompilerOptions(true)); + } + public void test035() { + runNegativeTest( + new String[] { + "X35.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X35 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " int i = 0;\n" + + " String result = switch(i) {\n" + + " case 0 -> {\n" + + " result = (obj instanceof String s) ? s : null;\n" + + " yield s;\n" + + " }\n" + + " default -> {\n" + + " yield s;\n" + + " }\n" + + " };\n" + + " System.out.println(result);\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X35.java (at line 11)\n" + + " yield s;\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n" + + "2. ERROR in X35.java (at line 14)\n" + + " yield s;\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + "", + null, + true, + getCompilerOptions(true)); + } + public void test036() { + runConformTest( + new String[] { + "X36.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X36 {\n" + + " public static void main(String[] o) {\n" + + " foo(\"one\");\n" + + " }\n" + + " public static void foo(Object obj) {\n" + + " int i = 0;\n" + + " String result = switch(i) {\n" + + " default -> {\n" + + " result = (obj instanceof String s) ? s : null;\n" + + " yield result;\n" + + " }\n" + + " };\n" + + " System.out.println(result);\n" + + " }\n" + + "}\n", + }, + "one", + getCompilerOptions(true)); + } + public void test037() { + runNegativeTest( + new String[] { + "X37.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X37 {\n" + + " public static void main(String[] o) {\n" + + " foo(new String[] {\"abcd\"});\n" + + " }\n" + + " public static void foo(Object[] obj) {\n" + + " for(int i = 0; (obj[i] instanceof String s) && s.length() > 0 ; i++) {\n" + + " System.out.println(s[i]);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X37.java (at line 8)\n" + + " System.out.println(s[i]);\n" + + " ^^^^\n" + + "The type of the expression must be an array type but it resolved to String\n" + + "----------\n", + null, + true, + getCompilerOptions(true)); + } + public void test038() { + runNegativeTest( + new String[] { + "X38.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X38 {\n" + + " public static void main(String[] o) {\n" + + " foo(new String[] {\"abcd\"});\n" + + " }\n" + + " public static void foo(Object[] obj) {\n" + + " for(int i = 0; (obj[i] instanceof String s) && s.length() > 0 ; i++) {\n" + + " throw new IllegalArgumentException();\n" + + " }\n" + + " System.out.println(s);\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X38.java (at line 10)\n" + + " System.out.println(s);\n" + + " ^\n" + + "s cannot be resolved to a variable\n" + + "----------\n", + null, + true, + getCompilerOptions(true)); + } + /* + * Failing with VerifyError + */ + public void _test039() { + runConformTest( + new String[] { + "X39.java", + "@SuppressWarnings(\"preview\")\n" + + "public class X39 {\n" + + " public static void main(String[] o) {\n" + + " foo(new String[] {\"one\"});;\n" + + " }\n" + + " public static void foo(Object[] obj) {\n" + + " for(int i = 0; i < obj.length && (obj[i] instanceof String s) && i < s.length(); i++) {\n" + + " System.out.println(s);\n" + + " }\n" + + " }\n" + + "}\n", + }, + "one", + getCompilerOptions(true)); + } +}
\ No newline at end of file diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java index dd34764133..ce0b2b0c61 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 IBM Corporation and others. + * Copyright (c) 2020 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at 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 5af8bb7fa5..2fbef8fe60 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -196,6 +196,7 @@ public static Test suite() { ArrayList since_14 = new ArrayList(); since_14.add(SwitchExpressionsYieldTest.class); since_14.add(RecordsRestrictedClassTest.class); + since_14.add(PatternMatching14Test.class); // Build final test suite TestSuite all = new TestSuite(TestAll.class.getName()); diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java index 66a6adb113..2bd0f31c60 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AND_AND_Expression.java @@ -282,6 +282,7 @@ public class AND_AND_Expression extends BinaryExpression { */ @Override public TypeBinding resolveType(BlockScope scope) { + resolvePatternVariable(scope, true); TypeBinding result = super.resolveType(scope); // check whether comparing identical expressions Binding leftDirect = Expression.getDirectBinding(this.left); diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java index 8334619f19..6a7a3cbcb3 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java @@ -341,6 +341,7 @@ public abstract class ASTNode implements TypeConstants, TypeIds { // for all reference context entries. public static final int HasFunctionalInterfaceTypes = ASTNode.Bit22; + public static final int HasInstancePatternExpression = ASTNode.Bit15; public static final Argument [] NO_ARGUMENTS = new Argument [0]; diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java index 2d41fd440b..52a4c8adae 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java @@ -345,8 +345,11 @@ public abstract class AbstractMethodDeclaration } } if (this.statements != null) { - for (int i = 0, max = this.statements.length; i < max; i++) - this.statements[i].generateCode(this.scope, codeStream); + for (Statement stmt : this.statements) { + stmt.generateCode(this.scope, codeStream); + if ((stmt.bits & ASTNode.HasInstancePatternExpression) != 0) + stmt.exitPatternVariableScope(codeStream); + } } // if a problem got reported during code gen, then trigger problem method creation if (this.ignoreFurtherInvestigation) { @@ -650,8 +653,14 @@ public abstract class AbstractMethodDeclaration public void resolveStatements() { if (this.statements != null) { - for (int i = 0, length = this.statements.length; i < length; i++) { - this.statements[i].resolve(this.scope); + for (int i = 0, length = this.statements.length; i < length; i++) { + Statement stmt = this.statements[i]; + stmt.lookForPatternVariables(this.scope); + if ((stmt.bits & ASTNode.HasInstancePatternExpression) == 0) { + stmt.resolve(this.scope); + } else { + stmt.resolve(stmt.patternScope); + } } } else if ((this.bits & UndocumentedEmptyBlock) != 0) { if (!this.isConstructor() || this.arguments != null) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=319626 diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java index c0c41aeaf5..86033e1cf7 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contribution for @@ -1803,6 +1807,21 @@ public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output } @Override +public void initializePatternVariables(BlockScope scope, CodeStream codeStream) { + this.left.initializePatternVariables(scope, codeStream); + this.right.initializePatternVariables(scope, codeStream); +} +@Override +public void resolvePatternVariable(BlockScope scope, boolean trueFalse) { + this.left.resolvePatternVariable(scope, trueFalse); + this.right.resolvePatternVariable(scope, trueFalse); +} +@Override +public void generatePatternVariable(BlockScope currentScope, CodeStream codeStream) { + this.left.generatePatternVariable(currentScope, codeStream); + this.right.generatePatternVariable(currentScope, codeStream); +} +@Override public TypeBinding resolveType(BlockScope scope) { // keep implementation in sync with CombinedBinaryExpression#resolveType // and nonRecursiveResolveTypeUpwards diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java index 8ae3201152..4e970face0 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Block.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contributions for @@ -79,8 +83,10 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { } int pc = codeStream.position; if (this.statements != null) { - for (int i = 0, max = this.statements.length; i < max; i++) { - this.statements[i].generateCode(this.scope, codeStream); + for (Statement stmt : this.statements) { + stmt.generateCode(this.scope, codeStream); + if ((stmt.bits & ASTNode.HasInstancePatternExpression) != 0) + stmt.exitPatternVariableScope(codeStream); } } // for local variable debug attributes if (this.scope != currentScope) { // was really associated with its own scope @@ -122,7 +128,13 @@ public void resolve(BlockScope upperScope) { ? upperScope : new BlockScope(upperScope, this.explicitDeclarations); for (int i = 0, length = this.statements.length; i < length; i++) { - this.statements[i].resolve(this.scope); + final Statement stmt = this.statements[i]; + stmt.lookForPatternVariables(this.scope); + if ((stmt.bits & ASTNode.HasInstancePatternExpression) == 0) { + stmt.resolve(this.scope); + } else { + stmt.resolve(stmt.patternScope); + } } } } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java index 1210f0a237..12fbf324ea 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephen Herrmann <stephan@cs.tu-berlin.de> - Contributions for @@ -446,6 +450,13 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, } @Override + public void initializePatternVariables(BlockScope scope, CodeStream codeStream) { + this.condition.initializePatternVariables(this.patternScope, codeStream); + this.valueIfTrue.initializePatternVariables(this.patternScope, codeStream); + this.valueIfFalse.initializePatternVariables(this.patternScope, codeStream); + } + + @Override public TypeBinding resolveType(BlockScope scope) { // JLS3 15.25 LookupEnvironment env = scope.environment(); @@ -464,7 +475,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, if (this.constant != Constant.NotAConstant) { this.constant = Constant.NotAConstant; - + this.condition.resolvePatternVariable(scope, true); TypeBinding conditionType = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN); this.condition.computeConversion(scope, TypeBinding.BOOLEAN, conditionType); diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java index d7bf39d587..a6706b9286 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contributions for @@ -774,7 +778,15 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean throw new ShouldNotImplement(Messages.ast_missingCode); } } - +public void resolvePatternVariable(BlockScope scope, boolean trueFalse) { + // Nothing by default +} +public void initializePatternVariables(BlockScope scope, CodeStream codeStream) { + // Nothing by default +} +public void generatePatternVariable(BlockScope currentScope, CodeStream codeStream) { + // Nothing by default +} /** * Default generation of a boolean value * @param currentScope diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java index 8f96fa7288..56a5c6aec0 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contributions for @@ -261,6 +265,9 @@ public class ForStatement extends Statement { this.initializations[i].generateCode(this.scope, codeStream); } } + if (this.condition != null && (this.bits & ASTNode.HasInstancePatternExpression) != 0) { + this.condition.initializePatternVariables(currentScope, codeStream); + } Constant cst = this.condition == null ? null : this.condition.optimizedBooleanConstant(); boolean isConditionOptimizedFalse = cst != null && (cst != Constant.NotAConstant && cst.booleanValue() == false); if (isConditionOptimizedFalse) { @@ -328,6 +335,7 @@ public class ForStatement extends Statement { } } // May loose some local variable initializations : affecting the local variable attributes + // This is causing PatternMatching14Test.test039() to fail if (this.preCondInitStateIndex != -1) { codeStream.removeNotDefinitelyAssignedVariables(currentScope, this.preCondInitStateIndex); } @@ -394,22 +402,60 @@ public class ForStatement extends Statement { } @Override - public void resolve(BlockScope upperScope) { + public void lookForPatternVariables(BlockScope outerScope) { + if (this.condition == null) + return; + this.condition.traverse(new ASTVisitor() { + @Override + public boolean visit( + InstanceOfExpression instanceOfExpression, + BlockScope sc) { + if (instanceOfExpression.elementVariable != null) { + ForStatement.this.bits |= ASTNode.HasInstancePatternExpression; + } + return false; // mission finished, exit + } + }, outerScope); + this.patternScope = new BlockScope(outerScope); + } + @Override + public void resolve(BlockScope upperScope) { + boolean hasPatternVariable = (this.bits & ASTNode.HasInstancePatternExpression) != 0; + if (hasPatternVariable) + upperScope = (BlockScope) upperScope.parent; // use the scope that will hold the init declarations this.scope = (this.bits & ASTNode.NeededScope) != 0 ? new BlockScope(upperScope) : upperScope; if (this.initializations != null) for (int i = 0, length = this.initializations.length; i < length; i++) this.initializations[i].resolve(this.scope); if (this.condition != null) { + if (hasPatternVariable) { + this.scope = this.patternScope = new BlockScope(this.scope); + this.condition.resolvePatternVariable(this.scope, true); + } + } + + if (this.condition != null) { TypeBinding type = this.condition.resolveTypeExpecting(this.scope, TypeBinding.BOOLEAN); this.condition.computeConversion(this.scope, type, type); } if (this.increments != null) for (int i = 0, length = this.increments.length; i < length; i++) this.increments[i].resolve(this.scope); - if (this.action != null) - this.action.resolve(this.scope); + if (this.action != null) { + BlockScope falseScope = null; + BlockScope trueScope = null; + if (hasPatternVariable) { + trueScope = this.patternScope; + if (this.action.doesNotCompleteNormally()) { + falseScope = upperScope; + } + } + this.action.resolve(hasPatternVariable ? trueScope : this.scope); + if (falseScope != null) + this.condition.resolvePatternVariable(falseScope, false); + } } @Override diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java index d8373d718a..11aae31732 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -202,6 +202,10 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { } // generate then statement this.thenStatement.generateCode(currentScope, codeStream); + boolean hasPatternVariable = (this.bits & ASTNode.HasInstancePatternExpression) != 0; + if (hasPatternVariable) { + this.exitPatternVariableScope(codeStream); + } // jump around the else statement if (hasElsePart) { if ((this.bits & ASTNode.ThenExit) == 0) { @@ -274,15 +278,63 @@ public StringBuffer printStatement(int indent, StringBuffer output) { } return output; } - @Override -public void resolve(BlockScope scope) { - TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN); - this.condition.computeConversion(scope, type, type); - if (this.thenStatement != null) - this.thenStatement.resolve(scope); - if (this.elseStatement != null) - this.elseStatement.resolve(scope); +public void lookForPatternVariables(BlockScope scope) { + this.condition.traverse(new ASTVisitor() { + @Override + public boolean visit( + InstanceOfExpression instanceOfExpression, + BlockScope sc) { + if (instanceOfExpression.elementVariable != null) { + IfStatement.this.bits |= ASTNode.HasInstancePatternExpression; + IfStatement.this.patternScope = new BlockScope(scope); + } + return false; // mission finished, exit + } + }, scope); +} +@Override +public void resolve(BlockScope outerScope) { + boolean hasPatternVariable = (this.bits & ASTNode.HasInstancePatternExpression) != 0; + BlockScope trueScope = null; + if (hasPatternVariable) { + trueScope = this.patternScope; + //new BlockScope((BlockScope) outerScope.parent); + this.condition.resolvePatternVariable(trueScope, true); + } + TypeBinding type = this.condition.resolveTypeExpecting(hasPatternVariable ? trueScope : outerScope, TypeBinding.BOOLEAN); + this.condition.computeConversion(hasPatternVariable ? trueScope : outerScope, type, type); + if (this.thenStatement != null) { + this.thenStatement.resolve(hasPatternVariable ? trueScope : outerScope); + } + if (hasPatternVariable) { + BlockScope falseScope = null; + if (this.thenStatement.doesNotCompleteNormally()) { + falseScope = (BlockScope) outerScope.parent; + } else { + falseScope = new BlockScope((BlockScope) outerScope.parent); + } + this.condition.resolvePatternVariable(falseScope, false); + outerScope = falseScope; + } + if (this.elseStatement != null) { + this.elseStatement.traverse(new ASTVisitor() { + @Override + public boolean visit( + InstanceOfExpression instanceOfExpression, + BlockScope sc) { + if (instanceOfExpression.elementVariable != null) { + IfStatement.this.elseStatement.bits |= ASTNode.HasInstancePatternExpression; + } + return false; + } + }, outerScope); + if ((this.elseStatement.bits & ASTNode.HasInstancePatternExpression) != 0) { + this.elseStatement.patternScope = new BlockScope(outerScope); + this.elseStatement.resolve(this.elseStatement.patternScope); + } else + this.elseStatement.resolve(outerScope); + } } @Override diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java index 96e26646d2..d6993e2d4d 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contribution for @@ -35,6 +39,8 @@ public class InstanceOfExpression extends OperatorExpression { public Expression expression; public TypeReference type; + public LocalDeclaration elementVariable; + boolean isInitialized; public InstanceOfExpression(Expression expression, TypeReference type) { this.expression = expression; @@ -44,9 +50,20 @@ public InstanceOfExpression(Expression expression, TypeReference type) { this.sourceStart = expression.sourceStart; this.sourceEnd = type.sourceEnd; } +public InstanceOfExpression(Expression expression, LocalDeclaration local) { + this.expression = expression; + this.elementVariable = local; + this.type = this.elementVariable.type; + this.bits |= INSTANCEOF << OperatorSHIFT; + this.sourceStart = expression.sourceStart; + this.sourceEnd = local.declarationSourceEnd; +} @Override public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { + if (this.elementVariable != null) { + flowInfo.markAsDefinitelyAssigned(this.elementVariable.binding); + } LocalVariableBinding local = this.expression.localVariableBinding(); if (local != null && (local.type.tagBits & TagBits.IsBaseType) == 0) { flowInfo = this.expression.analyseCode(currentScope, flowContext, flowInfo). @@ -67,7 +84,28 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl return this.expression.analyseCode(currentScope, flowContext, flowInfo). unconditionalInits(); } - +@Override +public void generateOptimizedBoolean(BlockScope currentScope, CodeStream codeStream, BranchLabel trueLabel, BranchLabel falseLabel, boolean valueRequired) { + super.generateOptimizedBoolean(currentScope, codeStream, trueLabel, falseLabel, valueRequired); + generatePatternVariable(currentScope, codeStream); +// if (this.elementVariable != null) { +// int position = codeStream.position; +// codeStream.load(this.expression.localVariableBinding()); +// codeStream.checkcast(this.type, this.type.resolvedType, position); +// codeStream.store(this.elementVariable.binding, false); +// codeStream.recordPositionsFrom(position, this.sourceEnd); +// } +} +@Override +public void generatePatternVariable(BlockScope currentScope, CodeStream codeStream) { +// if (this.elementVariable != null) { +// int position = codeStream.position; +// codeStream.load(this.expression.localVariableBinding()); +// codeStream.checkcast(this.type, this.type.resolvedType, position); +// codeStream.store(this.elementVariable.binding, false); +// codeStream.recordPositionsFrom(position, this.sourceEnd); +// } +} /** * Code generation for instanceOfExpression * @@ -77,9 +115,29 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl */ @Override public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired) { + initializePatternVariables(currentScope, codeStream); + int pc = codeStream.position; this.expression.generateCode(currentScope, codeStream, true); codeStream.instance_of(this.type, this.type.resolvedType); + if (this.elementVariable != null) { + BranchLabel actionLabel = new BranchLabel(codeStream); + codeStream.dup(); + codeStream.ifeq(actionLabel); + // Kludge + if (this.expression instanceof ArrayReference) { + ArrayReference array = (ArrayReference) this.expression; + codeStream.load(array.receiver.localVariableBinding()); + array.position.generateCode(currentScope, codeStream, true); + codeStream.arrayAt(array.resolvedType.id); + } else { + codeStream.load(this.expression.localVariableBinding()); + } + codeStream.checkcast(this.type, this.type.resolvedType, codeStream.position); + codeStream.store(this.elementVariable.binding, false); + codeStream.recordPositionsFrom(codeStream.position, this.sourceEnd); + actionLabel.place(); + } if (valueRequired) { codeStream.generateImplicitConversion(this.implicitConversion); } else { @@ -91,12 +149,43 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean @Override public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { this.expression.printExpression(indent, output).append(" instanceof "); //$NON-NLS-1$ - return this.type.print(0, output); + return this.elementVariable == null ? this.type.print(0, output) : this.elementVariable.printAsExpression(0, output); } @Override +public void initializePatternVariables(BlockScope currentScope, CodeStream codeStream) { + if (this.elementVariable != null) { + if(!this.isInitialized) { + this.isInitialized = true; + codeStream.aconst_null(); + codeStream.store(this.elementVariable.binding, false); +// int position = codeStream.position; +// codeStream.addVisibleLocalVariable(this.elementVariable.binding); +// this.elementVariable.binding.recordInitializationStartPC(position); + } + int position = codeStream.position; + codeStream.addVisibleLocalVariable(this.elementVariable.binding); + this.elementVariable.binding.recordInitializationStartPC(position); + } + //generatePatternVariable(currentScope, codeStream); +} +@Override +public void resolvePatternVariable(BlockScope scope, boolean inScope) { + if (!inScope) return; + if (this.elementVariable != null && this.elementVariable.binding == null) { + this.patternScope = scope; + this.elementVariable.resolve(scope); + // Why cant this be done in the constructor? + this.type = this.elementVariable.type; + } +} +@Override public TypeBinding resolveType(BlockScope scope) { +// resolvePatternVariable(scope, scope); this.constant = Constant.NotAConstant; + if (this.type == null && this.elementVariable != null) { + this.type = this.elementVariable.type; + } TypeBinding checkedType = this.type.resolveType(scope, true /* check bounds*/); if (this.expression instanceof CastExpression) { ((CastExpression) this.expression).setInstanceofType(checkedType); // for cast expression we need to know instanceof type to not tag unnecessary when needed @@ -136,7 +225,11 @@ public void tagAsUnnecessaryCast(Scope scope, TypeBinding castType) { public void traverse(ASTVisitor visitor, BlockScope scope) { if (visitor.visit(this, scope)) { this.expression.traverse(visitor, scope); - this.type.traverse(visitor, scope); + if (this.elementVariable != null) { + this.elementVariable.traverse(visitor, scope); + } else { + this.type.traverse(visitor, scope); + } } visitor.endVisit(this, scope); } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java index dc944351ed..57f81073df 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java @@ -332,7 +332,11 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl // create a binding from the specified type this.binding = new LocalVariableBinding(this, variableType, this.modifiers, false /*isArgument*/); } - scope.addLocalVariable(this.binding); + if ((this.bits & ASTNode.HasInstancePatternExpression) == 0) { + scope.addLocalVariable(this.binding); + } else { + ((BlockScope)scope.parent).addLocalVariable(this.binding); + } this.binding.setConstant(Constant.NotAConstant); // allow to recursivelly target the binding.... // the correct constant is harmed if correctly computed at the end of this method diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java index 9d386d58a5..1cf1230ac7 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contributions for @@ -103,6 +107,7 @@ public boolean doesNotCompleteNormally() { public boolean completesByContinue() { return false; } + public BlockScope patternScope; public static final int NOT_COMPLAINED = 0; public static final int COMPLAINED_FAKE_REACHABLE = 1; @@ -422,6 +427,15 @@ public void generateArguments(MethodBinding binding, Expression[] arguments, Blo } public abstract void generateCode(BlockScope currentScope, CodeStream codeStream); +public void exitPatternVariableScope(CodeStream stream) { + if (this.patternScope != null && (this.bits & ASTNode.HasInstancePatternExpression) != 0) { + for (Scope s : this.patternScope.subscopes) { + if (s == null) continue; + stream.exitUserScope((BlockScope) s); + } + stream.exitUserScope(this.patternScope); + } +} public boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) @@ -463,6 +477,21 @@ public abstract StringBuffer printStatement(int indent, StringBuffer output); public abstract void resolve(BlockScope scope); +public void lookForPatternVariables(BlockScope scope) { + this.traverse(new ASTVisitor() { + @Override + public boolean visit( + InstanceOfExpression instanceOfExpression, + BlockScope sc) { + if (instanceOfExpression.elementVariable != null) { + Statement.this.bits |= ASTNode.HasInstancePatternExpression; + } + return false; // mission finished, exit + } + }, scope); + if ((this.bits & ASTNode.HasInstancePatternExpression) != 0) + this.patternScope = new BlockScope(scope); +} /** * Returns case constant associated to this statement (NotAConstant if none) * parameter statement has to be either a SwitchStatement or a SwitchExpression diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java index b1e8752ac0..c1d0368878 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contribution for @@ -220,6 +224,16 @@ public FlowInfo analyseCode( } @Override + public void resolvePatternVariable(BlockScope scope, boolean trueFalse) { + if ((((this.bits & OperatorMASK) >> OperatorSHIFT) == NOT)) { + this.expression.resolvePatternVariable(scope, !trueFalse); + } + } + @Override + public void generatePatternVariable(BlockScope currentScope, CodeStream codeStream) { + this.expression.generatePatternVariable(currentScope, codeStream); + } + @Override public TypeBinding resolveType(BlockScope scope) { boolean expressionIsCast; if ((expressionIsCast = this.expression instanceof CastExpression) == true) this.expression.bits |= DisableUnnecessaryCastCheck; // will check later on diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java index 06bdcdeb25..c0e5790e5c 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contributions for @@ -190,6 +194,7 @@ public class WhileStatement extends Statement { if ((this.bits & IsReachable) == 0) { return; } + this.condition.initializePatternVariables(currentScope, codeStream); int pc = codeStream.position; Constant cst = this.condition.optimizedBooleanConstant(); boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false; @@ -231,6 +236,7 @@ public class WhileStatement extends Statement { // generate the action BranchLabel actionLabel = new BranchLabel(codeStream); if (this.action != null) { + this.condition.generatePatternVariable(currentScope, codeStream); actionLabel.tagBits |= BranchLabel.USED; // Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect if (this.condIfTrueInitStateIndex != -1) { @@ -269,12 +275,42 @@ public class WhileStatement extends Statement { } @Override - public void resolve(BlockScope scope) { + public void lookForPatternVariables(BlockScope scope) { + this.condition.traverse(new ASTVisitor() { + @Override + public boolean visit( + InstanceOfExpression instanceOfExpression, + BlockScope sc) { + if (instanceOfExpression.elementVariable != null) { + WhileStatement.this.bits |= ASTNode.HasInstancePatternExpression; + } + return false; // mission finished, exit + } + }, scope); + this.patternScope = new BlockScope(scope); + } - TypeBinding type = this.condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN); + @Override + public void resolve(BlockScope scope) { + boolean hasPatternVariable = (this.bits & ASTNode.HasInstancePatternExpression) != 0; + BlockScope trueScope = null; + BlockScope falseScope = null; + if (hasPatternVariable) { + trueScope = this.patternScope; + this.condition.resolvePatternVariable(trueScope, true); + } + TypeBinding type = this.condition.resolveTypeExpecting(hasPatternVariable ? trueScope : scope, TypeBinding.BOOLEAN); this.condition.computeConversion(scope, type, type); - if (this.action != null) - this.action.resolve(scope); + if (this.action != null) { + if (hasPatternVariable) { + if (this.action.doesNotCompleteNormally()) { + falseScope = (BlockScope) scope.parent; + } + } + this.action.resolve(hasPatternVariable ? trueScope : scope); + if (falseScope != null) + this.condition.resolvePatternVariable(falseScope, false); + } } @Override diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java index a21beb4742..73251bf1f5 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BlockScope.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java index 5b4254fa7f..e383ed17df 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java @@ -841,6 +841,12 @@ public class Parser implements TerminalTokens, ParserBasicInformation, Conflicte protected int[] astLengthStack; protected int astPtr; protected ASTNode[] astStack = new ASTNode[AstStackIncrement]; + + protected int patternLengthPtr; + + protected int[] patternLengthStack; + protected int patternPtr; + protected ASTNode[] patternStack = new ASTNode[AstStackIncrement]; public CompilationUnitDeclaration compilationUnit; /*the result from parse()*/ protected RecoveredElement currentElement; @@ -982,6 +988,7 @@ public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) { this.parsingJava14Plus = this.options.sourceLevel >= ClassFileConstants.JDK14; this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11; this.astLengthStack = new int[50]; + this.patternLengthStack = new int[20]; this.expressionLengthStack = new int[30]; this.typeAnnotationLengthStack = new int[30]; this.intStack = new int[50]; @@ -4459,16 +4466,53 @@ protected void consumeInsideCastExpressionLL1WithBounds() { protected void consumeInsideCastExpressionWithQualifiedGenerics() { // InsideCastExpressionWithQualifiedGenerics ::= $empty } +private void consumeTypeTestPattern() { + TypeReference type; + char[] identifierName = this.identifierStack[this.identifierPtr]; + long namePosition = this.identifierPositionStack[this.identifierPtr]; + + LocalDeclaration local = createLocalDeclaration(identifierName, (int) (namePosition >>> 32), (int) namePosition); + local.declarationSourceEnd = local.declarationEnd; + + this.identifierPtr--; + this.identifierLengthPtr--; + + type = getTypeReference(this.intStack[this.intPtr--]); //getTypeReference(0); // no type dimension + local.declarationSourceStart = type.sourceStart; + local.type = type; + if (!this.parsingJava14Plus) { + problemReporter().previewFeatureNotSupported(type.sourceStart, local.declarationEnd, "Instanceof Pattern", CompilerOptions.VERSION_13); //$NON-NLS-1$ + } else if (!this.options.enablePreviewFeatures){ + problemReporter().previewFeatureNotEnabled(type.sourceStart, local.declarationEnd, "Instanceof Pattern"); //$NON-NLS-1$ + } else { + if (this.options.isAnyEnabled(IrritantSet.PREVIEW)) { + problemReporter().previewFeatureUsed(type.sourceStart, local.declarationEnd); + } + } + local.modifiers |= ClassFileConstants.AccFinal; + pushOnPatternStack(local); +} protected void consumeInstanceOfExpression() { // RelationalExpression ::= RelationalExpression 'instanceof' ReferenceType //optimize the push/pop //by construction, no base type may be used in getTypeReference + int length = this.patternLengthPtr >= 0 ? + this.patternLengthStack[this.patternLengthPtr--] : 0; Expression exp; - this.expressionStack[this.expressionPtr] = exp = - new InstanceOfExpression( - this.expressionStack[this.expressionPtr], - getTypeReference(this.intStack[this.intPtr--])); + if (length != 0) { + LocalDeclaration typeDecl = (LocalDeclaration) this.patternStack[this.patternPtr--]; + this.expressionStack[this.expressionPtr] = exp = + new InstanceOfExpression( + this.expressionStack[this.expressionPtr], + typeDecl); + } else { + this.expressionStack[this.expressionPtr] = exp = + new InstanceOfExpression( + this.expressionStack[this.expressionPtr], + getTypeReference(this.intStack[this.intPtr--])); + } + if (exp.sourceEnd == 0) { //array on base type.... exp.sourceEnd = this.scanner.startPosition - 1; @@ -4479,14 +4523,25 @@ protected void consumeInstanceOfExpressionWithName() { // RelationalExpression_NotName ::= Name instanceof ReferenceType //optimize the push/pop - //by construction, no base type may be used in getTypeReference - TypeReference reference = getTypeReference(this.intStack[this.intPtr--]); - pushOnExpressionStack(getUnspecifiedReferenceOptimized()); + int length = this.patternLengthPtr >= 0 ? + this.patternLengthStack[this.patternLengthPtr--] : 0; Expression exp; - this.expressionStack[this.expressionPtr] = exp = - new InstanceOfExpression( - this.expressionStack[this.expressionPtr], - reference); + if (length != 0) { + LocalDeclaration typeDecl = (LocalDeclaration) this.patternStack[this.patternPtr--]; + pushOnExpressionStack(getUnspecifiedReferenceOptimized()); + this.expressionStack[this.expressionPtr] = exp = + new InstanceOfExpression( + this.expressionStack[this.expressionPtr], + typeDecl); + } else { + //by construction, no base type may be used in getTypeReference + TypeReference reference = getTypeReference(this.intStack[this.intPtr--]); + pushOnExpressionStack(getUnspecifiedReferenceOptimized()); + this.expressionStack[this.expressionPtr] = exp = + new InstanceOfExpression( + this.expressionStack[this.expressionPtr], + reference); + } if (exp.sourceEnd == 0) { //array on base type.... exp.sourceEnd = this.scanner.startPosition - 1; @@ -7221,1483 +7276,1487 @@ protected void consumeRule(int act) { consumeCompactConstructorHeaderNameWithTypeParameters(); break; - case 344 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$ + case 344 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$ + consumeInstanceOfExpression(); + break; + + case 348 : if (DEBUG) { System.out.println("TypeTestPattern ::= Type Identifier"); } //$NON-NLS-1$ + consumeTypeTestPattern(); + break; + + case 350 : if (DEBUG) { System.out.println("PushLeftBrace ::="); } //$NON-NLS-1$ consumePushLeftBrace(); break; - case 345 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$ + case 351 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace ,opt RBRACE"); } //$NON-NLS-1$ consumeEmptyArrayInitializer(); break; - case 346 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ + case 352 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ consumeArrayInitializer(); break; - case 347 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ + case 353 : if (DEBUG) { System.out.println("ArrayInitializer ::= LBRACE PushLeftBrace..."); } //$NON-NLS-1$ consumeArrayInitializer(); break; - case 349 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$ + case 355 : if (DEBUG) { System.out.println("VariableInitializers ::= VariableInitializers COMMA..."); } //$NON-NLS-1$ consumeVariableInitializers(); break; - case 350 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$ + case 356 : if (DEBUG) { System.out.println("Block ::= OpenBlock LBRACE BlockStatementsopt RBRACE"); } //$NON-NLS-1$ consumeBlock(); break; - case 351 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$ + case 357 : if (DEBUG) { System.out.println("OpenBlock ::="); } //$NON-NLS-1$ consumeOpenBlock() ; break; - case 352 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$ + case 358 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatement"); } //$NON-NLS-1$ consumeBlockStatement() ; break; - case 353 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$ + case 359 : if (DEBUG) { System.out.println("BlockStatements ::= BlockStatements BlockStatement"); } //$NON-NLS-1$ consumeBlockStatements() ; break; - case 360 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$ + case 366 : if (DEBUG) { System.out.println("BlockStatement ::= InterfaceDeclaration"); } //$NON-NLS-1$ consumeInvalidInterfaceDeclaration(); break; - case 361 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$ + case 367 : if (DEBUG) { System.out.println("BlockStatement ::= AnnotationTypeDeclaration"); } //$NON-NLS-1$ consumeInvalidAnnotationTypeDeclaration(); break; - case 362 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$ + case 368 : if (DEBUG) { System.out.println("BlockStatement ::= EnumDeclaration"); } //$NON-NLS-1$ consumeInvalidEnumDeclaration(); break; - case 363 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$ + case 369 : if (DEBUG) { System.out.println("LocalVariableDeclarationStatement ::=..."); } //$NON-NLS-1$ consumeLocalVariableDeclarationStatement(); break; - case 364 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$ + case 370 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Type PushModifiers..."); } //$NON-NLS-1$ consumeLocalVariableDeclaration(); break; - case 365 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$ + case 371 : if (DEBUG) { System.out.println("LocalVariableDeclaration ::= Modifiers Type..."); } //$NON-NLS-1$ consumeLocalVariableDeclaration(); break; - case 366 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$ + case 372 : if (DEBUG) { System.out.println("PushModifiers ::="); } //$NON-NLS-1$ consumePushModifiers(); break; - case 367 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$ + case 373 : if (DEBUG) { System.out.println("PushModifiersForHeader ::="); } //$NON-NLS-1$ consumePushModifiersForHeader(); break; - case 368 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$ + case 374 : if (DEBUG) { System.out.println("PushRealModifiers ::="); } //$NON-NLS-1$ consumePushRealModifiers(); break; - case 396 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$ + case 402 : if (DEBUG) { System.out.println("EmptyStatement ::= SEMICOLON"); } //$NON-NLS-1$ consumeEmptyStatement(); break; - case 397 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$ + case 403 : if (DEBUG) { System.out.println("LabeledStatement ::= Label COLON Statement"); } //$NON-NLS-1$ consumeStatementLabel() ; break; - case 398 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$ + case 404 : if (DEBUG) { System.out.println("LabeledStatementNoShortIf ::= Label COLON..."); } //$NON-NLS-1$ consumeStatementLabel() ; break; - case 399 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$ + case 405 : if (DEBUG) { System.out.println("Label ::= Identifier"); } //$NON-NLS-1$ consumeLabel() ; break; - case 400 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$ + case 406 : if (DEBUG) { System.out.println("ExpressionStatement ::= StatementExpression SEMICOLON"); } //$NON-NLS-1$ consumeExpressionStatement(); break; - case 409 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 415 : if (DEBUG) { System.out.println("IfThenStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementIfNoElse(); break; - case 410 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 416 : if (DEBUG) { System.out.println("IfThenElseStatement ::= if LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementIfWithElse(); break; - case 411 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$ + case 417 : if (DEBUG) { System.out.println("IfThenElseStatementNoShortIf ::= if LPAREN Expression..."); } //$NON-NLS-1$ consumeStatementIfWithElse(); break; - case 412 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 418 : if (DEBUG) { System.out.println("SwitchStatement ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementSwitch() ; break; - case 413 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$ + case 419 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE RBRACE"); } //$NON-NLS-1$ consumeEmptySwitchBlock() ; break; - case 416 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$ + case 422 : if (DEBUG) { System.out.println("SwitchBlock ::= LBRACE SwitchBlockStatements..."); } //$NON-NLS-1$ consumeSwitchBlock() ; break; - case 418 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$ + case 424 : if (DEBUG) { System.out.println("SwitchBlockStatements ::= SwitchBlockStatements..."); } //$NON-NLS-1$ consumeSwitchBlockStatements() ; break; - case 420 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$ + case 426 : if (DEBUG) { System.out.println("SwitchBlockStatement ::= SwitchLabels BlockStatements"); } //$NON-NLS-1$ consumeSwitchBlockStatement() ; break; - case 422 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$ + case 428 : if (DEBUG) { System.out.println("SwitchLabels ::= SwitchLabels SwitchLabel"); } //$NON-NLS-1$ consumeSwitchLabels() ; break; - case 423 : if (DEBUG) { System.out.println("SwitchLabel ::= SwitchLabelCaseLhs COLON"); } //$NON-NLS-1$ + case 429 : if (DEBUG) { System.out.println("SwitchLabel ::= SwitchLabelCaseLhs COLON"); } //$NON-NLS-1$ consumeCaseLabel(); break; - case 424 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$ + case 430 : if (DEBUG) { System.out.println("SwitchLabel ::= default COLON"); } //$NON-NLS-1$ consumeDefaultLabel(); break; - case 427 : if (DEBUG) { System.out.println("SwitchExpression ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 433 : if (DEBUG) { System.out.println("SwitchExpression ::= switch LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeSwitchExpression() ; break; - case 430 : if (DEBUG) { System.out.println("SwitchLabeledRule ::= SwitchLabeledThrowStatement"); } //$NON-NLS-1$ + case 436 : if (DEBUG) { System.out.println("SwitchLabeledRule ::= SwitchLabeledThrowStatement"); } //$NON-NLS-1$ consumeSwitchLabeledRule(); break; - case 431 : if (DEBUG) { System.out.println("SwitchLabeledExpression ::= SwitchLabelExpr Expression"); } //$NON-NLS-1$ + case 437 : if (DEBUG) { System.out.println("SwitchLabeledExpression ::= SwitchLabelExpr Expression"); } //$NON-NLS-1$ consumeSwitchLabeledExpression(); break; - case 432 : if (DEBUG) { System.out.println("SwitchLabeledBlock ::= SwitchLabelExpr Block"); } //$NON-NLS-1$ + case 438 : if (DEBUG) { System.out.println("SwitchLabeledBlock ::= SwitchLabelExpr Block"); } //$NON-NLS-1$ consumeSwitchLabeledBlock(); break; - case 433 : if (DEBUG) { System.out.println("SwitchLabeledThrowStatement ::= SwitchLabelExpr..."); } //$NON-NLS-1$ + case 439 : if (DEBUG) { System.out.println("SwitchLabeledThrowStatement ::= SwitchLabelExpr..."); } //$NON-NLS-1$ consumeSwitchLabeledThrowStatement(); break; - case 434 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= default ARROW"); } //$NON-NLS-1$ + case 440 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= default ARROW"); } //$NON-NLS-1$ consumeDefaultLabelExpr(); break; - case 435 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= SwitchLabelCaseLhs BeginCaseExpr..."); } //$NON-NLS-1$ + case 441 : if (DEBUG) { System.out.println("SwitchLabelExpr ::= SwitchLabelCaseLhs BeginCaseExpr..."); } //$NON-NLS-1$ consumeCaseLabelExpr(); break; - case 436 : if (DEBUG) { System.out.println("SwitchLabelCaseLhs ::= case ConstantExpressions"); } //$NON-NLS-1$ + case 442 : if (DEBUG) { System.out.println("SwitchLabelCaseLhs ::= case ConstantExpressions"); } //$NON-NLS-1$ consumeSwitchLabelCaseLhs(); break; - case 437 : if (DEBUG) { System.out.println("YieldStatement ::= RestrictedIdentifierYield Expression"); } //$NON-NLS-1$ + case 443 : if (DEBUG) { System.out.println("YieldStatement ::= RestrictedIdentifierYield Expression"); } //$NON-NLS-1$ consumeStatementYield() ; break; - case 438 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$ + case 444 : if (DEBUG) { System.out.println("WhileStatement ::= while LPAREN Expression RPAREN..."); } //$NON-NLS-1$ consumeStatementWhile() ; break; - case 439 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$ + case 445 : if (DEBUG) { System.out.println("WhileStatementNoShortIf ::= while LPAREN Expression..."); } //$NON-NLS-1$ consumeStatementWhile() ; break; - case 440 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$ + case 446 : if (DEBUG) { System.out.println("DoStatement ::= do Statement while LPAREN Expression..."); } //$NON-NLS-1$ consumeStatementDo() ; break; - case 441 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$ + case 447 : if (DEBUG) { System.out.println("ForStatement ::= for LPAREN ForInitopt SEMICOLON..."); } //$NON-NLS-1$ consumeStatementFor() ; break; - case 442 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$ + case 448 : if (DEBUG) { System.out.println("ForStatementNoShortIf ::= for LPAREN ForInitopt..."); } //$NON-NLS-1$ consumeStatementFor() ; break; - case 443 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$ + case 449 : if (DEBUG) { System.out.println("ForInit ::= StatementExpressionList"); } //$NON-NLS-1$ consumeForInit() ; break; - case 447 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$ + case 453 : if (DEBUG) { System.out.println("StatementExpressionList ::= StatementExpressionList..."); } //$NON-NLS-1$ consumeStatementExpressionList() ; break; - case 448 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$ + case 454 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression SEMICOLON"); } //$NON-NLS-1$ consumeSimpleAssertStatement() ; break; - case 449 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$ + case 455 : if (DEBUG) { System.out.println("AssertStatement ::= assert Expression COLON Expression"); } //$NON-NLS-1$ consumeAssertStatement() ; break; - case 450 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$ + case 456 : if (DEBUG) { System.out.println("BreakStatement ::= break SEMICOLON"); } //$NON-NLS-1$ consumeStatementBreak() ; break; - case 451 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$ + case 457 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$ consumeStatementBreakWithLabel() ; break; - case 452 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$ + case 458 : if (DEBUG) { System.out.println("ContinueStatement ::= continue SEMICOLON"); } //$NON-NLS-1$ consumeStatementContinue() ; break; - case 453 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$ + case 459 : if (DEBUG) { System.out.println("ContinueStatement ::= continue Identifier SEMICOLON"); } //$NON-NLS-1$ consumeStatementContinueWithLabel() ; break; - case 454 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$ + case 460 : if (DEBUG) { System.out.println("ReturnStatement ::= return Expressionopt SEMICOLON"); } //$NON-NLS-1$ consumeStatementReturn() ; break; - case 455 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$ + case 461 : if (DEBUG) { System.out.println("ThrowStatement ::= throw Expression SEMICOLON"); } //$NON-NLS-1$ consumeStatementThrow(); break; - case 456 : if (DEBUG) { System.out.println("ThrowExpression ::= throw Expression"); } //$NON-NLS-1$ + case 462 : if (DEBUG) { System.out.println("ThrowExpression ::= throw Expression"); } //$NON-NLS-1$ consumeThrowExpression() ; break; - case 457 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$ + case 463 : if (DEBUG) { System.out.println("SynchronizedStatement ::= OnlySynchronized LPAREN..."); } //$NON-NLS-1$ consumeStatementSynchronized(); break; - case 458 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$ + case 464 : if (DEBUG) { System.out.println("OnlySynchronized ::= synchronized"); } //$NON-NLS-1$ consumeOnlySynchronized(); break; - case 459 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$ + case 465 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catches"); } //$NON-NLS-1$ consumeStatementTry(false, false); break; - case 460 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$ + case 466 : if (DEBUG) { System.out.println("TryStatement ::= try TryBlock Catchesopt Finally"); } //$NON-NLS-1$ consumeStatementTry(true, false); break; - case 461 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ + case 467 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ consumeStatementTry(false, true); break; - case 462 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ + case 468 : if (DEBUG) { System.out.println("TryStatementWithResources ::= try ResourceSpecification"); } //$NON-NLS-1$ consumeStatementTry(true, true); break; - case 463 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$ + case 469 : if (DEBUG) { System.out.println("ResourceSpecification ::= LPAREN Resources ;opt RPAREN"); } //$NON-NLS-1$ consumeResourceSpecification(); break; - case 464 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$ + case 470 : if (DEBUG) { System.out.println(";opt ::="); } //$NON-NLS-1$ consumeResourceOptionalTrailingSemiColon(false); break; - case 465 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$ + case 471 : if (DEBUG) { System.out.println(";opt ::= SEMICOLON"); } //$NON-NLS-1$ consumeResourceOptionalTrailingSemiColon(true); break; - case 466 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$ + case 472 : if (DEBUG) { System.out.println("Resources ::= Resource"); } //$NON-NLS-1$ consumeSingleResource(); break; - case 467 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$ + case 473 : if (DEBUG) { System.out.println("Resources ::= Resources TrailingSemiColon Resource"); } //$NON-NLS-1$ consumeMultipleResources(); break; - case 468 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$ + case 474 : if (DEBUG) { System.out.println("TrailingSemiColon ::= SEMICOLON"); } //$NON-NLS-1$ consumeResourceOptionalTrailingSemiColon(true); break; - case 469 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$ + case 475 : if (DEBUG) { System.out.println("Resource ::= Type PushModifiers VariableDeclaratorId..."); } //$NON-NLS-1$ consumeResourceAsLocalVariableDeclaration(); break; - case 470 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$ + case 476 : if (DEBUG) { System.out.println("Resource ::= Modifiers Type PushRealModifiers..."); } //$NON-NLS-1$ consumeResourceAsLocalVariableDeclaration(); break; - case 471 : if (DEBUG) { System.out.println("Resource ::= Name"); } //$NON-NLS-1$ + case 477 : if (DEBUG) { System.out.println("Resource ::= Name"); } //$NON-NLS-1$ consumeResourceAsLocalVariable(); break; - case 472 : if (DEBUG) { System.out.println("Resource ::= FieldAccess"); } //$NON-NLS-1$ + case 478 : if (DEBUG) { System.out.println("Resource ::= FieldAccess"); } //$NON-NLS-1$ consumeResourceAsFieldAccess(); break; - case 474 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$ + case 480 : if (DEBUG) { System.out.println("ExitTryBlock ::="); } //$NON-NLS-1$ consumeExitTryBlock(); break; - case 476 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$ + case 482 : if (DEBUG) { System.out.println("Catches ::= Catches CatchClause"); } //$NON-NLS-1$ consumeCatches(); break; - case 477 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ + case 483 : if (DEBUG) { System.out.println("CatchClause ::= catch LPAREN CatchFormalParameter RPAREN"); } //$NON-NLS-1$ consumeStatementCatch() ; break; - case 479 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$ + case 485 : if (DEBUG) { System.out.println("PushLPAREN ::= LPAREN"); } //$NON-NLS-1$ consumeLeftParen(); break; - case 480 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$ + case 486 : if (DEBUG) { System.out.println("PushRPAREN ::= RPAREN"); } //$NON-NLS-1$ consumeRightParen(); break; - case 485 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$ + case 491 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= this"); } //$NON-NLS-1$ consumePrimaryNoNewArrayThis(); break; - case 486 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$ + case 492 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Expression_NotName..."); } //$NON-NLS-1$ consumePrimaryNoNewArray(); break; - case 487 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$ + case 493 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN"); } //$NON-NLS-1$ consumePrimaryNoNewArrayWithName(); break; - case 490 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$ + case 496 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT this"); } //$NON-NLS-1$ consumePrimaryNoNewArrayNameThis(); break; - case 491 : if (DEBUG) { System.out.println("QualifiedSuperReceiver ::= Name DOT super"); } //$NON-NLS-1$ + case 497 : if (DEBUG) { System.out.println("QualifiedSuperReceiver ::= Name DOT super"); } //$NON-NLS-1$ consumeQualifiedSuperReceiver(); break; - case 492 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$ + case 498 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayName(); break; - case 493 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$ + case 499 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= Name Dims DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayArrayType(); break; - case 494 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$ + case 500 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType Dims DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayPrimitiveArrayType(); break; - case 495 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$ + case 501 : if (DEBUG) { System.out.println("PrimaryNoNewArray ::= PrimitiveType DOT class"); } //$NON-NLS-1$ consumePrimaryNoNewArrayPrimitiveType(); break; - case 501 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ + case 507 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ consumeReferenceExpressionTypeArgumentsAndTrunk(false); break; - case 502 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ + case 508 : if (DEBUG) { System.out.println("ReferenceExpressionTypeArgumentsAndTrunk0 ::=..."); } //$NON-NLS-1$ consumeReferenceExpressionTypeArgumentsAndTrunk(true); break; - case 503 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$ + case 509 : if (DEBUG) { System.out.println("ReferenceExpression ::= PrimitiveType Dims COLON_COLON"); } //$NON-NLS-1$ consumeReferenceExpressionTypeForm(true); break; - case 504 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$ + case 510 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name Dimsopt COLON_COLON..."); } //$NON-NLS-1$ consumeReferenceExpressionTypeForm(false); break; - case 505 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$ + case 511 : if (DEBUG) { System.out.println("ReferenceExpression ::= Name BeginTypeArguments..."); } //$NON-NLS-1$ consumeReferenceExpressionGenericTypeForm(); break; - case 506 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$ + case 512 : if (DEBUG) { System.out.println("ReferenceExpression ::= Primary COLON_COLON..."); } //$NON-NLS-1$ consumeReferenceExpressionPrimaryForm(); break; - case 507 : if (DEBUG) { System.out.println("ReferenceExpression ::= QualifiedSuperReceiver..."); } //$NON-NLS-1$ + case 513 : if (DEBUG) { System.out.println("ReferenceExpression ::= QualifiedSuperReceiver..."); } //$NON-NLS-1$ consumeReferenceExpressionPrimaryForm(); break; - case 508 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$ + case 514 : if (DEBUG) { System.out.println("ReferenceExpression ::= super COLON_COLON..."); } //$NON-NLS-1$ consumeReferenceExpressionSuperForm(); break; - case 509 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$ + case 515 : if (DEBUG) { System.out.println("NonWildTypeArgumentsopt ::="); } //$NON-NLS-1$ consumeEmptyTypeArguments(); break; - case 511 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$ + case 517 : if (DEBUG) { System.out.println("IdentifierOrNew ::= Identifier"); } //$NON-NLS-1$ consumeIdentifierOrNew(false); break; - case 512 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$ + case 518 : if (DEBUG) { System.out.println("IdentifierOrNew ::= new"); } //$NON-NLS-1$ consumeIdentifierOrNew(true); break; - case 513 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$ + case 519 : if (DEBUG) { System.out.println("LambdaExpression ::= LambdaParameters ARROW LambdaBody"); } //$NON-NLS-1$ consumeLambdaExpression(); break; - case 514 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$ + case 520 : if (DEBUG) { System.out.println("NestedLambda ::="); } //$NON-NLS-1$ consumeNestedLambda(); break; - case 515 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$ + case 521 : if (DEBUG) { System.out.println("LambdaParameters ::= Identifier NestedLambda"); } //$NON-NLS-1$ consumeTypeElidedLambdaParameter(false); break; - case 521 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$ + case 527 : if (DEBUG) { System.out.println("TypeElidedFormalParameterList ::=..."); } //$NON-NLS-1$ consumeFormalParameterList(); break; - case 522 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$ + case 528 : if (DEBUG) { System.out.println("TypeElidedFormalParameter ::= Modifiersopt Identifier"); } //$NON-NLS-1$ consumeTypeElidedLambdaParameter(true); break; - case 525 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$ + case 531 : if (DEBUG) { System.out.println("ElidedLeftBraceAndReturn ::="); } //$NON-NLS-1$ consumeElidedLeftBraceAndReturn(); break; - case 526 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$ + case 532 : if (DEBUG) { System.out.println("AllocationHeader ::= new ClassType LPAREN..."); } //$NON-NLS-1$ consumeAllocationHeader(); break; - case 527 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$ + case 533 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionWithTypeArguments(); break; - case 528 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$ + case 534 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= new ClassType..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpression(); break; - case 529 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ + case 535 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; break; - case 530 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ + case 536 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::= Primary DOT new..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualified() ; break; - case 531 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ + case 537 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualified() ; break; - case 532 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ + case 538 : if (DEBUG) { System.out.println("ClassInstanceCreationExpression ::=..."); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; break; - case 533 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$ + case 539 : if (DEBUG) { System.out.println("EnterInstanceCreationArgumentList ::="); } //$NON-NLS-1$ consumeEnterInstanceCreationArgumentList(); break; - case 534 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$ + case 540 : if (DEBUG) { System.out.println("ClassInstanceCreationExpressionName ::= Name DOT new"); } //$NON-NLS-1$ consumeClassInstanceCreationExpressionName() ; break; - case 535 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$ + case 541 : if (DEBUG) { System.out.println("UnqualifiedClassBodyopt ::="); } //$NON-NLS-1$ consumeClassBodyopt(); break; - case 537 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ + case 543 : if (DEBUG) { System.out.println("UnqualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ consumeEnterAnonymousClassBody(false); break; - case 538 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$ + case 544 : if (DEBUG) { System.out.println("QualifiedClassBodyopt ::="); } //$NON-NLS-1$ consumeClassBodyopt(); break; - case 540 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ + case 546 : if (DEBUG) { System.out.println("QualifiedEnterAnonymousClassBody ::="); } //$NON-NLS-1$ consumeEnterAnonymousClassBody(true); break; - case 542 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$ + case 548 : if (DEBUG) { System.out.println("ArgumentList ::= ArgumentList COMMA Expression"); } //$NON-NLS-1$ consumeArgumentList(); break; - case 543 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$ + case 549 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new PrimitiveType..."); } //$NON-NLS-1$ consumeArrayCreationHeader(); break; - case 544 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$ + case 550 : if (DEBUG) { System.out.println("ArrayCreationHeader ::= new ClassOrInterfaceType..."); } //$NON-NLS-1$ consumeArrayCreationHeader(); break; - case 545 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ + case 551 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ consumeArrayCreationExpressionWithoutInitializer(); break; - case 546 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$ + case 552 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new PrimitiveType"); } //$NON-NLS-1$ consumeArrayCreationExpressionWithInitializer(); break; - case 547 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ + case 553 : if (DEBUG) { System.out.println("ArrayCreationWithoutArrayInitializer ::= new..."); } //$NON-NLS-1$ consumeArrayCreationExpressionWithoutInitializer(); break; - case 548 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$ + case 554 : if (DEBUG) { System.out.println("ArrayCreationWithArrayInitializer ::= new..."); } //$NON-NLS-1$ consumeArrayCreationExpressionWithInitializer(); break; - case 550 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$ + case 556 : if (DEBUG) { System.out.println("DimWithOrWithOutExprs ::= DimWithOrWithOutExprs..."); } //$NON-NLS-1$ consumeDimWithOrWithOutExprs(); break; - case 552 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$ + case 558 : if (DEBUG) { System.out.println("DimWithOrWithOutExpr ::= TypeAnnotationsopt LBRACKET..."); } //$NON-NLS-1$ consumeDimWithOrWithOutExpr(); break; - case 553 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$ + case 559 : if (DEBUG) { System.out.println("Dims ::= DimsLoop"); } //$NON-NLS-1$ consumeDims(); break; - case 556 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ + case 562 : if (DEBUG) { System.out.println("OneDimLoop ::= LBRACKET RBRACKET"); } //$NON-NLS-1$ consumeOneDimLoop(false); break; - case 557 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$ + case 563 : if (DEBUG) { System.out.println("OneDimLoop ::= TypeAnnotations LBRACKET RBRACKET"); } //$NON-NLS-1$ consumeOneDimLoop(true); break; - case 558 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$ + case 564 : if (DEBUG) { System.out.println("FieldAccess ::= Primary DOT Identifier"); } //$NON-NLS-1$ consumeFieldAccess(false); break; - case 559 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$ + case 565 : if (DEBUG) { System.out.println("FieldAccess ::= super DOT Identifier"); } //$NON-NLS-1$ consumeFieldAccess(true); break; - case 560 : if (DEBUG) { System.out.println("FieldAccess ::= QualifiedSuperReceiver DOT Identifier"); } //$NON-NLS-1$ + case 566 : if (DEBUG) { System.out.println("FieldAccess ::= QualifiedSuperReceiver DOT Identifier"); } //$NON-NLS-1$ consumeFieldAccess(false); break; - case 561 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ + case 567 : if (DEBUG) { System.out.println("MethodInvocation ::= Name LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ consumeMethodInvocationName(); break; - case 562 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$ + case 568 : if (DEBUG) { System.out.println("MethodInvocation ::= Name DOT OnlyTypeArguments..."); } //$NON-NLS-1$ consumeMethodInvocationNameWithTypeArguments(); break; - case 563 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$ + case 569 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT OnlyTypeArguments..."); } //$NON-NLS-1$ consumeMethodInvocationPrimaryWithTypeArguments(); break; - case 564 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$ + case 570 : if (DEBUG) { System.out.println("MethodInvocation ::= Primary DOT Identifier LPAREN..."); } //$NON-NLS-1$ consumeMethodInvocationPrimary(); break; - case 565 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ + case 571 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ consumeMethodInvocationPrimary(); break; - case 566 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ + case 572 : if (DEBUG) { System.out.println("MethodInvocation ::= QualifiedSuperReceiver DOT..."); } //$NON-NLS-1$ consumeMethodInvocationPrimaryWithTypeArguments(); break; - case 567 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$ + case 573 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT OnlyTypeArguments..."); } //$NON-NLS-1$ consumeMethodInvocationSuperWithTypeArguments(); break; - case 568 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$ + case 574 : if (DEBUG) { System.out.println("MethodInvocation ::= super DOT Identifier LPAREN..."); } //$NON-NLS-1$ consumeMethodInvocationSuper(); break; - case 569 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$ + case 575 : if (DEBUG) { System.out.println("ArrayAccess ::= Name LBRACKET Expression RBRACKET"); } //$NON-NLS-1$ consumeArrayAccess(true); break; - case 570 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$ + case 576 : if (DEBUG) { System.out.println("ArrayAccess ::= PrimaryNoNewArray LBRACKET Expression..."); } //$NON-NLS-1$ consumeArrayAccess(false); break; - case 571 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$ + case 577 : if (DEBUG) { System.out.println("ArrayAccess ::= ArrayCreationWithArrayInitializer..."); } //$NON-NLS-1$ consumeArrayAccess(false); break; - case 573 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$ + case 579 : if (DEBUG) { System.out.println("PostfixExpression ::= Name"); } //$NON-NLS-1$ consumePostfixExpression(); break; - case 576 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$ + case 582 : if (DEBUG) { System.out.println("PostIncrementExpression ::= PostfixExpression PLUS_PLUS"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS,true); break; - case 577 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$ + case 583 : if (DEBUG) { System.out.println("PostDecrementExpression ::= PostfixExpression..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS,true); break; - case 578 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$ + case 584 : if (DEBUG) { System.out.println("PushPosition ::="); } //$NON-NLS-1$ consumePushPosition(); break; - case 581 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$ + case 587 : if (DEBUG) { System.out.println("UnaryExpression ::= PLUS PushPosition UnaryExpression"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS); break; - case 582 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$ + case 588 : if (DEBUG) { System.out.println("UnaryExpression ::= MINUS PushPosition UnaryExpression"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS); break; - case 584 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$ + case 590 : if (DEBUG) { System.out.println("PreIncrementExpression ::= PLUS_PLUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS,false); break; - case 585 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$ + case 591 : if (DEBUG) { System.out.println("PreDecrementExpression ::= MINUS_MINUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS,false); break; - case 587 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$ + case 593 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= TWIDDLE PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.TWIDDLE); break; - case 588 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$ + case 594 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus ::= NOT PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.NOT); break; - case 590 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$ + case 596 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN PrimitiveType Dimsopt..."); } //$NON-NLS-1$ consumeCastExpressionWithPrimitiveType(); break; - case 591 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ + case 597 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ consumeCastExpressionWithGenericsArray(); break; - case 592 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ + case 598 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name..."); } //$NON-NLS-1$ consumeCastExpressionWithQualifiedGenericsArray(); break; - case 593 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$ + case 599 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name PushRPAREN..."); } //$NON-NLS-1$ consumeCastExpressionLL1(); break; - case 594 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$ + case 600 : if (DEBUG) { System.out.println("CastExpression ::= BeginIntersectionCast PushLPAREN..."); } //$NON-NLS-1$ consumeCastExpressionLL1WithBounds(); break; - case 595 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$ + case 601 : if (DEBUG) { System.out.println("CastExpression ::= PushLPAREN Name Dims..."); } //$NON-NLS-1$ consumeCastExpressionWithNameArray(); break; - case 596 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$ + case 602 : if (DEBUG) { System.out.println("AdditionalBoundsListOpt ::="); } //$NON-NLS-1$ consumeZeroAdditionalBounds(); break; - case 600 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$ + case 606 : if (DEBUG) { System.out.println("OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments"); } //$NON-NLS-1$ consumeOnlyTypeArgumentsForCastExpression(); break; - case 601 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$ + case 607 : if (DEBUG) { System.out.println("InsideCastExpression ::="); } //$NON-NLS-1$ consumeInsideCastExpression(); break; - case 602 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$ + case 608 : if (DEBUG) { System.out.println("InsideCastExpressionLL1 ::="); } //$NON-NLS-1$ consumeInsideCastExpressionLL1(); break; - case 603 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$ + case 609 : if (DEBUG) { System.out.println("InsideCastExpressionLL1WithBounds ::="); } //$NON-NLS-1$ consumeInsideCastExpressionLL1WithBounds (); break; - case 604 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$ + case 610 : if (DEBUG) { System.out.println("InsideCastExpressionWithQualifiedGenerics ::="); } //$NON-NLS-1$ consumeInsideCastExpressionWithQualifiedGenerics(); break; - case 606 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ + case 612 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MULTIPLY); break; - case 607 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ + case 613 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.DIVIDE); break; - case 608 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ + case 614 : if (DEBUG) { System.out.println("MultiplicativeExpression ::= MultiplicativeExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.REMAINDER); break; - case 610 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$ + case 616 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression PLUS..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.PLUS); break; - case 611 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$ + case 617 : if (DEBUG) { System.out.println("AdditiveExpression ::= AdditiveExpression MINUS..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MINUS); break; - case 613 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$ + case 619 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression LEFT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LEFT_SHIFT); break; - case 614 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$ + case 620 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression RIGHT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); break; - case 615 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ + case 621 : if (DEBUG) { System.out.println("ShiftExpression ::= ShiftExpression UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); break; - case 617 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$ + case 623 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS); break; - case 618 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$ + case 624 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression GREATER..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER); break; - case 619 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$ + case 625 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression LESS_EQUAL"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS_EQUAL); break; - case 620 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$ + case 626 : if (DEBUG) { System.out.println("RelationalExpression ::= RelationalExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER_EQUAL); break; - case 622 : if (DEBUG) { System.out.println("InstanceofExpression ::= InstanceofExpression instanceof"); } //$NON-NLS-1$ - consumeInstanceOfExpression(); - break; - - case 624 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$ + case 628 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression EQUAL_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); break; - case 625 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$ + case 629 : if (DEBUG) { System.out.println("EqualityExpression ::= EqualityExpression NOT_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.NOT_EQUAL); break; - case 627 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$ + case 631 : if (DEBUG) { System.out.println("AndExpression ::= AndExpression AND EqualityExpression"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND); break; - case 629 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$ + case 633 : if (DEBUG) { System.out.println("ExclusiveOrExpression ::= ExclusiveOrExpression XOR..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.XOR); break; - case 631 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$ + case 635 : if (DEBUG) { System.out.println("InclusiveOrExpression ::= InclusiveOrExpression OR..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR); break; - case 633 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$ + case 637 : if (DEBUG) { System.out.println("ConditionalAndExpression ::= ConditionalAndExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND_AND); break; - case 635 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ + case 639 : if (DEBUG) { System.out.println("ConditionalOrExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR_OR); break; - case 637 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ + case 641 : if (DEBUG) { System.out.println("ConditionalExpression ::= ConditionalOrExpression..."); } //$NON-NLS-1$ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; break; - case 640 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$ + case 644 : if (DEBUG) { System.out.println("Assignment ::= PostfixExpression AssignmentOperator..."); } //$NON-NLS-1$ consumeAssignment(); break; - case 642 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$ + case 646 : if (DEBUG) { System.out.println("Assignment ::= InvalidArrayInitializerAssignement"); } //$NON-NLS-1$ ignoreExpressionAssignment(); break; - case 643 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$ + case 647 : if (DEBUG) { System.out.println("AssignmentOperator ::= EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(EQUAL); break; - case 644 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$ + case 648 : if (DEBUG) { System.out.println("AssignmentOperator ::= MULTIPLY_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(MULTIPLY); break; - case 645 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$ + case 649 : if (DEBUG) { System.out.println("AssignmentOperator ::= DIVIDE_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(DIVIDE); break; - case 646 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$ + case 650 : if (DEBUG) { System.out.println("AssignmentOperator ::= REMAINDER_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(REMAINDER); break; - case 647 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$ + case 651 : if (DEBUG) { System.out.println("AssignmentOperator ::= PLUS_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(PLUS); break; - case 648 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$ + case 652 : if (DEBUG) { System.out.println("AssignmentOperator ::= MINUS_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(MINUS); break; - case 649 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$ + case 653 : if (DEBUG) { System.out.println("AssignmentOperator ::= LEFT_SHIFT_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(LEFT_SHIFT); break; - case 650 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ + case 654 : if (DEBUG) { System.out.println("AssignmentOperator ::= RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(RIGHT_SHIFT); break; - case 651 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ + case 655 : if (DEBUG) { System.out.println("AssignmentOperator ::= UNSIGNED_RIGHT_SHIFT_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); break; - case 652 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$ + case 656 : if (DEBUG) { System.out.println("AssignmentOperator ::= AND_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(AND); break; - case 653 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$ + case 657 : if (DEBUG) { System.out.println("AssignmentOperator ::= XOR_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(XOR); break; - case 654 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$ + case 658 : if (DEBUG) { System.out.println("AssignmentOperator ::= OR_EQUAL"); } //$NON-NLS-1$ consumeAssignmentOperator(OR); break; - case 655 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$ + case 659 : if (DEBUG) { System.out.println("Expression ::= AssignmentExpression"); } //$NON-NLS-1$ consumeExpression(); break; - case 658 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$ + case 662 : if (DEBUG) { System.out.println("Expressionopt ::="); } //$NON-NLS-1$ consumeEmptyExpression(); break; - case 661 : if (DEBUG) { System.out.println("ConstantExpressions ::= ConstantExpressions COMMA..."); } //$NON-NLS-1$ + case 665 : if (DEBUG) { System.out.println("ConstantExpressions ::= ConstantExpressions COMMA..."); } //$NON-NLS-1$ consumeConstantExpressions(); break; - case 665 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$ + case 669 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyClassBodyDeclarationsopt(); break; - case 666 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ + case 670 : if (DEBUG) { System.out.println("ClassBodyDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ consumeClassBodyDeclarationsopt(); break; - case 667 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$ + case 671 : if (DEBUG) { System.out.println("Modifiersopt ::="); } //$NON-NLS-1$ consumeDefaultModifiers(); break; - case 668 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$ + case 672 : if (DEBUG) { System.out.println("Modifiersopt ::= Modifiers"); } //$NON-NLS-1$ consumeModifiers(); break; - case 669 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$ + case 673 : if (DEBUG) { System.out.println("BlockStatementsopt ::="); } //$NON-NLS-1$ consumeEmptyBlockStatementsopt(); break; - case 671 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$ + case 675 : if (DEBUG) { System.out.println("Dimsopt ::="); } //$NON-NLS-1$ consumeEmptyDimsopt(); break; - case 673 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$ + case 677 : if (DEBUG) { System.out.println("ArgumentListopt ::="); } //$NON-NLS-1$ consumeEmptyArgumentListopt(); break; - case 677 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$ + case 681 : if (DEBUG) { System.out.println("FormalParameterListopt ::="); } //$NON-NLS-1$ consumeFormalParameterListopt(); break; - case 681 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$ + case 685 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyInterfaceMemberDeclarationsopt(); break; - case 682 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ + case 686 : if (DEBUG) { System.out.println("InterfaceMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ consumeInterfaceMemberDeclarationsopt(); break; - case 683 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$ + case 687 : if (DEBUG) { System.out.println("NestedType ::="); } //$NON-NLS-1$ consumeNestedType(); break; - case 684 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$ + case 688 : if (DEBUG) { System.out.println("ForInitopt ::="); } //$NON-NLS-1$ consumeEmptyForInitopt(); break; - case 686 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$ + case 690 : if (DEBUG) { System.out.println("ForUpdateopt ::="); } //$NON-NLS-1$ consumeEmptyForUpdateopt(); break; - case 690 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$ + case 694 : if (DEBUG) { System.out.println("Catchesopt ::="); } //$NON-NLS-1$ consumeEmptyCatchesopt(); break; - case 692 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$ + case 696 : if (DEBUG) { System.out.println("EnumDeclaration ::= EnumHeader EnumBody"); } //$NON-NLS-1$ consumeEnumDeclaration(); break; - case 693 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$ + case 697 : if (DEBUG) { System.out.println("EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt"); } //$NON-NLS-1$ consumeEnumHeader(); break; - case 694 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$ + case 698 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier"); } //$NON-NLS-1$ consumeEnumHeaderName(); break; - case 695 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$ + case 699 : if (DEBUG) { System.out.println("EnumHeaderName ::= Modifiersopt enum Identifier..."); } //$NON-NLS-1$ consumeEnumHeaderNameWithTypeParameters(); break; - case 696 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$ + case 700 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumBodyDeclarationsopt RBRACE"); } //$NON-NLS-1$ consumeEnumBodyNoConstants(); break; - case 697 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$ + case 701 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE COMMA EnumBodyDeclarationsopt..."); } //$NON-NLS-1$ consumeEnumBodyNoConstants(); break; - case 698 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$ + case 702 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants COMMA..."); } //$NON-NLS-1$ consumeEnumBodyWithConstants(); break; - case 699 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$ + case 703 : if (DEBUG) { System.out.println("EnumBody ::= LBRACE EnumConstants..."); } //$NON-NLS-1$ consumeEnumBodyWithConstants(); break; - case 701 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$ + case 705 : if (DEBUG) { System.out.println("EnumConstants ::= EnumConstants COMMA EnumConstant"); } //$NON-NLS-1$ consumeEnumConstants(); break; - case 702 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ + case 706 : if (DEBUG) { System.out.println("EnumConstantHeaderName ::= Modifiersopt Identifier"); } //$NON-NLS-1$ consumeEnumConstantHeaderName(); break; - case 703 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$ + case 707 : if (DEBUG) { System.out.println("EnumConstantHeader ::= EnumConstantHeaderName..."); } //$NON-NLS-1$ consumeEnumConstantHeader(); break; - case 704 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$ + case 708 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader ForceNoDiet..."); } //$NON-NLS-1$ consumeEnumConstantWithClassBody(); break; - case 705 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$ + case 709 : if (DEBUG) { System.out.println("EnumConstant ::= EnumConstantHeader"); } //$NON-NLS-1$ consumeEnumConstantNoClassBody(); break; - case 706 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ + case 710 : if (DEBUG) { System.out.println("Arguments ::= LPAREN ArgumentListopt RPAREN"); } //$NON-NLS-1$ consumeArguments(); break; - case 707 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$ + case 711 : if (DEBUG) { System.out.println("Argumentsopt ::="); } //$NON-NLS-1$ consumeEmptyArguments(); break; - case 709 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$ + case 713 : if (DEBUG) { System.out.println("EnumDeclarations ::= SEMICOLON ClassBodyDeclarationsopt"); } //$NON-NLS-1$ consumeEnumDeclarations(); break; - case 710 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$ + case 714 : if (DEBUG) { System.out.println("EnumBodyDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyEnumDeclarations(); break; - case 712 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$ + case 716 : if (DEBUG) { System.out.println("EnhancedForStatement ::= EnhancedForStatementHeader..."); } //$NON-NLS-1$ consumeEnhancedForStatement(); break; - case 713 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$ + case 717 : if (DEBUG) { System.out.println("EnhancedForStatementNoShortIf ::=..."); } //$NON-NLS-1$ consumeEnhancedForStatement(); break; - case 714 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$ + case 718 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Type..."); } //$NON-NLS-1$ consumeEnhancedForStatementHeaderInit(false); break; - case 715 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$ + case 719 : if (DEBUG) { System.out.println("EnhancedForStatementHeaderInit ::= for LPAREN Modifiers"); } //$NON-NLS-1$ consumeEnhancedForStatementHeaderInit(true); break; - case 716 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$ + case 720 : if (DEBUG) { System.out.println("EnhancedForStatementHeader ::=..."); } //$NON-NLS-1$ consumeEnhancedForStatementHeader(); break; - case 717 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$ + case 721 : if (DEBUG) { System.out.println("SingleStaticImportDeclaration ::=..."); } //$NON-NLS-1$ consumeImportDeclaration(); break; - case 718 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$ + case 722 : if (DEBUG) { System.out.println("SingleStaticImportDeclarationName ::= import static Name"); } //$NON-NLS-1$ consumeSingleStaticImportDeclarationName(); break; - case 719 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ + case 723 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclaration ::=..."); } //$NON-NLS-1$ consumeImportDeclaration(); break; - case 720 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$ + case 724 : if (DEBUG) { System.out.println("StaticImportOnDemandDeclarationName ::= import static..."); } //$NON-NLS-1$ consumeStaticImportOnDemandDeclarationName(); break; - case 721 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ + case 725 : if (DEBUG) { System.out.println("TypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ consumeTypeArguments(); break; - case 722 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ + case 726 : if (DEBUG) { System.out.println("OnlyTypeArguments ::= LESS TypeArgumentList1"); } //$NON-NLS-1$ consumeOnlyTypeArguments(); break; - case 724 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ + case 728 : if (DEBUG) { System.out.println("TypeArgumentList1 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ consumeTypeArgumentList1(); break; - case 726 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$ + case 730 : if (DEBUG) { System.out.println("TypeArgumentList ::= TypeArgumentList COMMA TypeArgument"); } //$NON-NLS-1$ consumeTypeArgumentList(); break; - case 727 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$ + case 731 : if (DEBUG) { System.out.println("TypeArgument ::= ReferenceType"); } //$NON-NLS-1$ consumeTypeArgument(); break; - case 731 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$ + case 735 : if (DEBUG) { System.out.println("ReferenceType1 ::= ReferenceType GREATER"); } //$NON-NLS-1$ consumeReferenceType1(); break; - case 732 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ + case 736 : if (DEBUG) { System.out.println("ReferenceType1 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ consumeTypeArgumentReferenceType1(); break; - case 734 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ + case 738 : if (DEBUG) { System.out.println("TypeArgumentList2 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ consumeTypeArgumentList2(); break; - case 737 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$ + case 741 : if (DEBUG) { System.out.println("ReferenceType2 ::= ReferenceType RIGHT_SHIFT"); } //$NON-NLS-1$ consumeReferenceType2(); break; - case 738 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ + case 742 : if (DEBUG) { System.out.println("ReferenceType2 ::= ClassOrInterface LESS..."); } //$NON-NLS-1$ consumeTypeArgumentReferenceType2(); break; - case 740 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ + case 744 : if (DEBUG) { System.out.println("TypeArgumentList3 ::= TypeArgumentList COMMA..."); } //$NON-NLS-1$ consumeTypeArgumentList3(); break; - case 743 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ + case 747 : if (DEBUG) { System.out.println("ReferenceType3 ::= ReferenceType UNSIGNED_RIGHT_SHIFT"); } //$NON-NLS-1$ consumeReferenceType3(); break; - case 744 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$ + case 748 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION"); } //$NON-NLS-1$ consumeWildcard(); break; - case 745 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$ + case 749 : if (DEBUG) { System.out.println("Wildcard ::= TypeAnnotationsopt QUESTION WildcardBounds"); } //$NON-NLS-1$ consumeWildcardWithBounds(); break; - case 746 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$ + case 750 : if (DEBUG) { System.out.println("WildcardBounds ::= extends ReferenceType"); } //$NON-NLS-1$ consumeWildcardBoundsExtends(); break; - case 747 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$ + case 751 : if (DEBUG) { System.out.println("WildcardBounds ::= super ReferenceType"); } //$NON-NLS-1$ consumeWildcardBoundsSuper(); break; - case 748 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$ + case 752 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION GREATER"); } //$NON-NLS-1$ consumeWildcard1(); break; - case 749 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 753 : if (DEBUG) { System.out.println("Wildcard1 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard1WithBounds(); break; - case 750 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$ + case 754 : if (DEBUG) { System.out.println("WildcardBounds1 ::= extends ReferenceType1"); } //$NON-NLS-1$ consumeWildcardBounds1Extends(); break; - case 751 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$ + case 755 : if (DEBUG) { System.out.println("WildcardBounds1 ::= super ReferenceType1"); } //$NON-NLS-1$ consumeWildcardBounds1Super(); break; - case 752 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$ + case 756 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION RIGHT_SHIFT"); } //$NON-NLS-1$ consumeWildcard2(); break; - case 753 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 757 : if (DEBUG) { System.out.println("Wildcard2 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard2WithBounds(); break; - case 754 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$ + case 758 : if (DEBUG) { System.out.println("WildcardBounds2 ::= extends ReferenceType2"); } //$NON-NLS-1$ consumeWildcardBounds2Extends(); break; - case 755 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$ + case 759 : if (DEBUG) { System.out.println("WildcardBounds2 ::= super ReferenceType2"); } //$NON-NLS-1$ consumeWildcardBounds2Super(); break; - case 756 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 760 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard3(); break; - case 757 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ + case 761 : if (DEBUG) { System.out.println("Wildcard3 ::= TypeAnnotationsopt QUESTION..."); } //$NON-NLS-1$ consumeWildcard3WithBounds(); break; - case 758 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$ + case 762 : if (DEBUG) { System.out.println("WildcardBounds3 ::= extends ReferenceType3"); } //$NON-NLS-1$ consumeWildcardBounds3Extends(); break; - case 759 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$ + case 763 : if (DEBUG) { System.out.println("WildcardBounds3 ::= super ReferenceType3"); } //$NON-NLS-1$ consumeWildcardBounds3Super(); break; - case 760 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt Identifier"); } //$NON-NLS-1$ + case 764 : if (DEBUG) { System.out.println("TypeParameterHeader ::= TypeAnnotationsopt Identifier"); } //$NON-NLS-1$ consumeTypeParameterHeader(); break; - case 761 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$ + case 765 : if (DEBUG) { System.out.println("TypeParameters ::= LESS TypeParameterList1"); } //$NON-NLS-1$ consumeTypeParameters(); break; - case 763 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ + case 767 : if (DEBUG) { System.out.println("TypeParameterList ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ consumeTypeParameterList(); break; - case 765 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ + case 769 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ consumeTypeParameterWithExtends(); break; - case 766 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ + case 770 : if (DEBUG) { System.out.println("TypeParameter ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ consumeTypeParameterWithExtendsAndBounds(); break; - case 768 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$ + case 772 : if (DEBUG) { System.out.println("AdditionalBoundList ::= AdditionalBoundList..."); } //$NON-NLS-1$ consumeAdditionalBoundList(); break; - case 769 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$ + case 773 : if (DEBUG) { System.out.println("AdditionalBound ::= AND ReferenceType"); } //$NON-NLS-1$ consumeAdditionalBound(); break; - case 771 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ + case 775 : if (DEBUG) { System.out.println("TypeParameterList1 ::= TypeParameterList COMMA..."); } //$NON-NLS-1$ consumeTypeParameterList1(); break; - case 772 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$ + case 776 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader GREATER"); } //$NON-NLS-1$ consumeTypeParameter1(); break; - case 773 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ + case 777 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ consumeTypeParameter1WithExtends(); break; - case 774 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ + case 778 : if (DEBUG) { System.out.println("TypeParameter1 ::= TypeParameterHeader extends..."); } //$NON-NLS-1$ consumeTypeParameter1WithExtendsAndBounds(); break; - case 776 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$ + case 780 : if (DEBUG) { System.out.println("AdditionalBoundList1 ::= AdditionalBoundList..."); } //$NON-NLS-1$ consumeAdditionalBoundList1(); break; - case 777 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$ + case 781 : if (DEBUG) { System.out.println("AdditionalBound1 ::= AND ReferenceType1"); } //$NON-NLS-1$ consumeAdditionalBound1(); break; - case 783 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$ + case 787 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= PLUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.PLUS); break; - case 784 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$ + case 788 : if (DEBUG) { System.out.println("UnaryExpression_NotName ::= MINUS PushPosition..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.MINUS); break; - case 787 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$ + case 791 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= TWIDDLE..."); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.TWIDDLE); break; - case 788 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$ + case 792 : if (DEBUG) { System.out.println("UnaryExpressionNotPlusMinus_NotName ::= NOT PushPosition"); } //$NON-NLS-1$ consumeUnaryExpression(OperatorIds.NOT); break; - case 791 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ + case 795 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MULTIPLY); break; - case 792 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$ + case 796 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name MULTIPLY..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.MULTIPLY); break; - case 793 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ + case 797 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.DIVIDE); break; - case 794 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$ + case 798 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name DIVIDE..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.DIVIDE); break; - case 795 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ + case 799 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.REMAINDER); break; - case 796 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$ + case 800 : if (DEBUG) { System.out.println("MultiplicativeExpression_NotName ::= Name REMAINDER..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.REMAINDER); break; - case 798 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ + case 802 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.PLUS); break; - case 799 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$ + case 803 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name PLUS..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.PLUS); break; - case 800 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ + case 804 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.MINUS); break; - case 801 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$ + case 805 : if (DEBUG) { System.out.println("AdditiveExpression_NotName ::= Name MINUS..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.MINUS); break; - case 803 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ + case 807 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LEFT_SHIFT); break; - case 804 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$ + case 808 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name LEFT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT); break; - case 805 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ + case 809 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); break; - case 806 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$ + case 810 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name RIGHT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT); break; - case 807 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ + case 811 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= ShiftExpression_NotName..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); break; - case 808 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$ + case 812 : if (DEBUG) { System.out.println("ShiftExpression_NotName ::= Name UNSIGNED_RIGHT_SHIFT..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT); break; - case 810 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ + case 814 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS); break; - case 811 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$ + case 815 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.LESS); break; - case 812 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ + case 816 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= ShiftExpression_NotName"); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER); break; - case 813 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$ + case 817 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.GREATER); break; - case 814 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ + case 818 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.LESS_EQUAL); break; - case 815 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$ + case 819 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name LESS_EQUAL..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL); break; - case 816 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ + case 820 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.GREATER_EQUAL); break; - case 817 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$ + case 821 : if (DEBUG) { System.out.println("RelationalExpression_NotName ::= Name GREATER_EQUAL..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL); break; - case 819 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$ + case 823 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::= Name instanceof..."); } //$NON-NLS-1$ consumeInstanceOfExpressionWithName(); break; - case 820 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$ + case 824 : if (DEBUG) { System.out.println("InstanceofExpression_NotName ::=..."); } //$NON-NLS-1$ consumeInstanceOfExpression(); break; - case 822 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ + case 826 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); break; - case 823 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$ + case 827 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name EQUAL_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL); break; - case 824 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ + case 828 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::=..."); } //$NON-NLS-1$ consumeEqualityExpression(OperatorIds.NOT_EQUAL); break; - case 825 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$ + case 829 : if (DEBUG) { System.out.println("EqualityExpression_NotName ::= Name NOT_EQUAL..."); } //$NON-NLS-1$ consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL); break; - case 827 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$ + case 831 : if (DEBUG) { System.out.println("AndExpression_NotName ::= AndExpression_NotName AND..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND); break; - case 828 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$ + case 832 : if (DEBUG) { System.out.println("AndExpression_NotName ::= Name AND EqualityExpression"); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.AND); break; - case 830 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ + case 834 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.XOR); break; - case 831 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$ + case 835 : if (DEBUG) { System.out.println("ExclusiveOrExpression_NotName ::= Name XOR AndExpression"); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.XOR); break; - case 833 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ + case 837 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR); break; - case 834 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$ + case 838 : if (DEBUG) { System.out.println("InclusiveOrExpression_NotName ::= Name OR..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.OR); break; - case 836 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$ + case 840 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.AND_AND); break; - case 837 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$ + case 841 : if (DEBUG) { System.out.println("ConditionalAndExpression_NotName ::= Name AND_AND..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.AND_AND); break; - case 839 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$ + case 843 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::=..."); } //$NON-NLS-1$ consumeBinaryExpression(OperatorIds.OR_OR); break; - case 840 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$ + case 844 : if (DEBUG) { System.out.println("ConditionalOrExpression_NotName ::= Name OR_OR..."); } //$NON-NLS-1$ consumeBinaryExpressionWithName(OperatorIds.OR_OR); break; - case 842 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$ + case 846 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::=..."); } //$NON-NLS-1$ consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; break; - case 843 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$ + case 847 : if (DEBUG) { System.out.println("ConditionalExpression_NotName ::= Name QUESTION..."); } //$NON-NLS-1$ consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ; break; - case 847 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ + case 851 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderName() ; break; - case 848 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ + case 852 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= Modifiers AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; break; - case 849 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ + case 853 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; break; - case 850 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ + case 854 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeaderName ::= AT..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeaderName() ; break; - case 851 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ + case 855 : if (DEBUG) { System.out.println("AnnotationTypeDeclarationHeader ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclarationHeader() ; break; - case 852 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ + case 856 : if (DEBUG) { System.out.println("AnnotationTypeDeclaration ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeDeclaration() ; break; - case 854 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ + case 858 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::="); } //$NON-NLS-1$ consumeEmptyAnnotationTypeMemberDeclarationsopt() ; break; - case 855 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ + case 859 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarationsopt ::= NestedType..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclarationsopt() ; break; - case 857 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ + case 861 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclarations ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclarations() ; break; - case 858 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ + case 862 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt..."); } //$NON-NLS-1$ consumeMethodHeaderNameWithTypeParameters(true); break; - case 859 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 863 : if (DEBUG) { System.out.println("AnnotationMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeMethodHeaderName(true); break; - case 860 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ + case 864 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::="); } //$NON-NLS-1$ consumeEmptyMethodHeaderDefaultValue() ; break; - case 861 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ + case 865 : if (DEBUG) { System.out.println("AnnotationMethodHeaderDefaultValueopt ::= DefaultValue"); } //$NON-NLS-1$ consumeMethodHeaderDefaultValue(); break; - case 862 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ + case 866 : if (DEBUG) { System.out.println("AnnotationMethodHeader ::= AnnotationMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 863 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ + case 867 : if (DEBUG) { System.out.println("AnnotationTypeMemberDeclaration ::=..."); } //$NON-NLS-1$ consumeAnnotationTypeMemberDeclaration() ; break; - case 871 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableName"); } //$NON-NLS-1$ + case 875 : if (DEBUG) { System.out.println("AnnotationName ::= AT UnannotatableName"); } //$NON-NLS-1$ consumeAnnotationName() ; break; - case 872 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ + case 876 : if (DEBUG) { System.out.println("NormalAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ consumeNormalAnnotation(false) ; break; - case 873 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ + case 877 : if (DEBUG) { System.out.println("MemberValuePairsopt ::="); } //$NON-NLS-1$ consumeEmptyMemberValuePairsopt() ; break; - case 876 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ + case 880 : if (DEBUG) { System.out.println("MemberValuePairs ::= MemberValuePairs COMMA..."); } //$NON-NLS-1$ consumeMemberValuePairs() ; break; - case 877 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ + case 881 : if (DEBUG) { System.out.println("MemberValuePair ::= SimpleName EQUAL EnterMemberValue..."); } //$NON-NLS-1$ consumeMemberValuePair() ; break; - case 878 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ + case 882 : if (DEBUG) { System.out.println("EnterMemberValue ::="); } //$NON-NLS-1$ consumeEnterMemberValue() ; break; - case 879 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ + case 883 : if (DEBUG) { System.out.println("ExitMemberValue ::="); } //$NON-NLS-1$ consumeExitMemberValue() ; break; - case 881 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ + case 885 : if (DEBUG) { System.out.println("MemberValue ::= Name"); } //$NON-NLS-1$ consumeMemberValueAsName() ; break; - case 884 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 888 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeMemberValueArrayInitializer() ; break; - case 885 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 889 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeMemberValueArrayInitializer() ; break; - case 886 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 890 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeEmptyMemberValueArrayInitializer() ; break; - case 887 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ + case 891 : if (DEBUG) { System.out.println("MemberValueArrayInitializer ::=..."); } //$NON-NLS-1$ consumeEmptyMemberValueArrayInitializer() ; break; - case 888 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ + case 892 : if (DEBUG) { System.out.println("EnterMemberValueArrayInitializer ::="); } //$NON-NLS-1$ consumeEnterMemberValueArrayInitializer() ; break; - case 890 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ + case 894 : if (DEBUG) { System.out.println("MemberValues ::= MemberValues COMMA MemberValue"); } //$NON-NLS-1$ consumeMemberValues() ; break; - case 891 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ + case 895 : if (DEBUG) { System.out.println("MarkerAnnotation ::= AnnotationName"); } //$NON-NLS-1$ consumeMarkerAnnotation(false) ; break; - case 892 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$ + case 896 : if (DEBUG) { System.out.println("SingleMemberAnnotationMemberValue ::= MemberValue"); } //$NON-NLS-1$ consumeSingleMemberAnnotationMemberValue() ; break; - case 893 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ + case 897 : if (DEBUG) { System.out.println("SingleMemberAnnotation ::= AnnotationName LPAREN..."); } //$NON-NLS-1$ consumeSingleMemberAnnotation(false) ; break; - case 894 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ + case 898 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt TypeParameters"); } //$NON-NLS-1$ consumeRecoveryMethodHeaderNameWithTypeParameters(); break; - case 895 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ + case 899 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= Modifiersopt Type..."); } //$NON-NLS-1$ consumeRecoveryMethodHeaderName(); break; - case 896 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$ + case 900 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault..."); } //$NON-NLS-1$ consumeRecoveryMethodHeaderNameWithTypeParameters(); break; - case 897 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$ + case 901 : if (DEBUG) { System.out.println("RecoveryMethodHeaderName ::= ModifiersWithDefault Type"); } //$NON-NLS-1$ consumeRecoveryMethodHeaderName(); break; - case 898 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ + case 902 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; - case 899 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ + case 903 : if (DEBUG) { System.out.println("RecoveryMethodHeader ::= RecoveryMethodHeaderName..."); } //$NON-NLS-1$ consumeMethodHeader(); break; @@ -12107,6 +12166,8 @@ public void initialize(boolean parsingCompilationUnit) { this.javadoc = null; this.astPtr = -1; this.astLengthPtr = -1; + this.patternPtr = -1; + this.patternLengthPtr = -1; this.expressionPtr = -1; this.expressionLengthPtr = -1; this.typeAnnotationLengthPtr = -1; @@ -13365,6 +13426,29 @@ protected void pushOnAstLengthStack(int pos) { } this.astLengthStack[this.astLengthPtr] = pos; } +protected void pushOnPatternStack(ASTNode pattern) { + /*add a new obj on top of the ast stack + astPtr points on the top*/ + + int stackLength = this.patternStack.length; + if (++this.patternPtr >= stackLength) { + System.arraycopy( + this.patternStack, 0, + this.patternStack = new ASTNode[stackLength + AstStackIncrement], 0, + stackLength); + this.patternPtr = stackLength; + } + this.patternStack[this.patternPtr] = pattern; + + stackLength = this.patternLengthStack.length; + if (++this.patternLengthPtr >= stackLength) { + System.arraycopy( + this.patternLengthStack, 0, + this.patternLengthStack = new int[stackLength + AstStackIncrement], 0, + stackLength); + } + this.patternLengthStack[this.patternLengthPtr] = 1; +} protected void pushOnAstStack(ASTNode node) { /*add a new obj on top of the ast stack astPtr points on the top*/ @@ -13862,6 +13946,8 @@ protected void resetStacks() { this.astPtr = -1; this.astLengthPtr = -1; + this.patternPtr = -1; + this.patternLengthPtr = -1; this.expressionPtr = -1; this.expressionLengthPtr = -1; this.typeAnnotationLengthPtr = -1; @@ -14090,6 +14176,8 @@ public void copyState(Parser from) { this.identifierLengthPtr = parser.identifierLengthPtr; this.astPtr = parser.astPtr; this.astLengthPtr = parser.astLengthPtr; + this.patternPtr = parser.patternPtr; + this.patternLengthPtr = parser.patternLengthPtr; this.expressionPtr = parser.expressionPtr; this.expressionLengthPtr = parser.expressionLengthPtr; this.genericsPtr = parser.genericsPtr; diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java index 9d77d4e714..f40fbcfccb 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java @@ -20,25 +20,24 @@ package org.eclipse.jdt.internal.compiler.parser; /*An interface that contains static declarations for some basic information about the parser such as the number of rules in the grammar, the starting state, etc...*/ public interface ParserBasicInformation { - public final static int - ERROR_SYMBOL = 132, - MAX_NAME_LENGTH = 41, - NUM_STATES = 1199, + ERROR_SYMBOL = 132, + MAX_NAME_LENGTH = 41, + NUM_STATES = 1201, - NT_OFFSET = 132, - SCOPE_UBOUND = 312, - SCOPE_SIZE = 313, - LA_STATE_OFFSET = 17912, - MAX_LA = 1, - NUM_RULES = 899, - NUM_TERMINALS = 132, - NUM_NON_TERMINALS = 415, - NUM_SYMBOLS = 547, - START_STATE = 947, - EOFT_SYMBOL = 62, - EOLT_SYMBOL = 62, - ACCEPT_ACTION = 17911, - ERROR_ACTION = 17912; + NT_OFFSET = 132, + SCOPE_UBOUND = 312, + SCOPE_SIZE = 313, + LA_STATE_OFFSET = 17816, + MAX_LA = 1, + NUM_RULES = 903, + NUM_TERMINALS = 132, + NUM_NON_TERMINALS = 418, + NUM_SYMBOLS = 550, + START_STATE = 1040, + EOFT_SYMBOL = 62, + EOLT_SYMBOL = 62, + ACCEPT_ACTION = 17815, + ERROR_ACTION = 17816; } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java index e6c5df205b..b93ec9b429 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java @@ -41,7 +41,7 @@ public interface TerminalTokens { TokenNameCOMMENT_BLOCK = 1002, TokenNameCOMMENT_JAVADOC = 1003; - int TokenNameIdentifier = 22, + int TokenNameIdentifier = 19, TokenNameabstract = 52, TokenNameassert = 78, TokenNameboolean = 101, @@ -114,10 +114,10 @@ public interface TerminalTokens { TokenNameTextBlock = 50, TokenNamePLUS_PLUS = 2, TokenNameMINUS_MINUS = 3, - TokenNameEQUAL_EQUAL = 19, + TokenNameEQUAL_EQUAL = 20, TokenNameLESS_EQUAL = 12, TokenNameGREATER_EQUAL = 13, - TokenNameNOT_EQUAL = 20, + TokenNameNOT_EQUAL = 21, TokenNameLEFT_SHIFT = 18, TokenNameRIGHT_SHIFT = 14, TokenNameUNSIGNED_RIGHT_SHIFT = 16, @@ -139,7 +139,7 @@ public interface TerminalTokens { TokenNameNOT = 64, TokenNameREMAINDER = 9, TokenNameXOR = 24, - TokenNameAND = 21, + TokenNameAND = 22, TokenNameMULTIPLY = 8, TokenNameOR = 28, TokenNameTWIDDLE = 65, diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc Binary files differindex 4329173541..d57985d1b1 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc Binary files differindex 178c711c9d..9e81fd205a 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc Binary files differindex 898d7174db..aef8765967 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc Binary files differindex f9040b5b39..d3e7f6606f 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc Binary files differindex 73aeb3c62a..2315753b1b 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc Binary files differindex 863f6ce917..63c2914c5d 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser17.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc Binary files differindex 7422b0dff5..813c62cdab 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc Binary files differindex 8103c6c66c..275bd535de 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc Binary files differindex edb64e773b..09e8bc845d 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc Binary files differindex a8b75ee7ca..e7df088cd6 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser20.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc Binary files differindex f51e401ecd..396f101f66 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser21.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc Binary files differindex 4f72581bd4..58bead9f92 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc Binary files differindex 814e7eff13..b563d0f7a6 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc Binary files differindex 7df75c2b84..a060701fc7 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser24.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc Binary files differindex d708c80d83..93c40e8997 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc Binary files differindex 67648c0c09..ac3f01e9e1 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc Binary files differindex 8406445675..1df94acf3c 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc Binary files differindex 54c5e1f14d..c7230fc8f7 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc Binary files differindex 6085178598..929a35c406 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc Binary files differindex b177a70f53..67b763ee18 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc Binary files differindex 748425f18b..083646cb8f 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props index ac79434e14..de72d8624c 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/readableNames.props @@ -357,6 +357,7 @@ TypeParameterHeader=TypeParameter TypeParameterList1=TypeParameterList1 TypeParameterList=TypeParameterList TypeParameters=TypeParameters +TypeTestPattern=TypeTestPattern UnannotatableName=UnannotatableQualifiedName UnaryExpression=Expression UnaryExpressionNotPlusMinus=Expression diff --git a/org.eclipse.jdt.core/grammar/java.g b/org.eclipse.jdt.core/grammar/java.g index a517fa85e6..65d6105666 100644 --- a/org.eclipse.jdt.core/grammar/java.g +++ b/org.eclipse.jdt.core/grammar/java.g @@ -1208,6 +1208,32 @@ CompactConstructorHeaderName ::= Modifiersopt TypeParameters 'Identifier' -- 14 preview feature : end of record type ----------------------------------------------- +----------------------------------------------- +-- 14 preview feature : instanceof pattern matching +----------------------------------------------- + + +InstanceofExpression -> RelationalExpression +InstanceofExpression ::= InstanceofExpression 'instanceof' TypeOrPattern +/.$putCase consumeInstanceOfExpression(); $break ./ +/:$readableName Expression:/ + +TypeOrPattern -> Type +TypeOrPattern -> Pattern +Pattern -> TypeTestPattern +TypeTestPattern ::= Type Identifier +/.$putCase consumeTypeTestPattern(); $break ./ +/:$readableName TypeTestPattern:/ + +--InstanceofExpression ::= InstanceofExpression 'instanceof' Type Identifier +--/.$putCase consumeInstanceOfExpressionPattern(); $break ./ +--/:$readableName Expression:/ +--/:$compliance 14:/ + +----------------------------------------------- +-- 14 preview feature : end of instanceof pattern matching +----------------------------------------------- + ConstantDeclaration -> FieldDeclaration /:$readableName ConstantDeclaration:/ @@ -2060,11 +2086,6 @@ RelationalExpression ::= RelationalExpression '>=' ShiftExpression /.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./ /:$readableName Expression:/ -InstanceofExpression -> RelationalExpression -InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType -/.$putCase consumeInstanceOfExpression(); $break ./ -/:$readableName Expression:/ - EqualityExpression -> InstanceofExpression EqualityExpression ::= EqualityExpression '==' InstanceofExpression /.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./ @@ -2671,9 +2692,9 @@ RelationalExpression_NotName ::= Name '>=' ShiftExpression /:$readableName Expression:/ InstanceofExpression_NotName -> RelationalExpression_NotName -InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType +InstanceofExpression_NotName ::= Name 'instanceof' TypeOrPattern /.$putCase consumeInstanceOfExpressionWithName(); $break ./ -InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType +InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' TypeOrPattern /.$putCase consumeInstanceOfExpression(); $break ./ /:$readableName Expression:/ |