Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2019-06-12 05:35:43 -0400
committerManoj Palat2019-06-12 05:59:47 -0400
commit739cde9844f307ca8f80b98aefb5ad1ef824777a (patch)
tree8353ebd783eab84fc057cc2a708322a286a85b39
parent2540a46be8c4e39b5df4a06ab8e744bc6ab83a5a (diff)
downloadeclipse.jdt.core-739cde9844f307ca8f80b98aefb5ad1ef824777a.tar.gz
eclipse.jdt.core-739cde9844f307ca8f80b98aefb5ad1ef824777a.tar.xz
eclipse.jdt.core-739cde9844f307ca8f80b98aefb5ad1ef824777a.zip
Bug 544073 - break, BreakStatement - Grammar and related changesmanoj_544073_yield
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchExpressionsYieldTest.java33
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java83
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java175
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ParserBasicInformation.java12
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/TerminalTokens.java40
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rscbin33854 -> 34176 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rscbin598 -> 596 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rscbin598 -> 596 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rscbin598 -> 596 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rscbin598 -> 596 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rscbin2366 -> 2360 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rscbin1544 -> 1540 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rscbin2338 -> 2338 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rscbin7852 -> 7878 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rscbin32112 -> 32434 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rscbin798 -> 798 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rscbin90 -> 90 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rscbin2338 -> 2338 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rscbin3472 -> 3472 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rscbin2338 -> 2338 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rscbin1418 -> 1418 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rscbin262 -> 262 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rscbin798 -> 798 bytes
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rscbin15650 -> 15698 bytes
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java23
-rw-r--r--org.eclipse.jdt.core/grammar/java.g2
28 files changed, 82 insertions, 293 deletions
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 efef781d1d..d1ab7eed5d 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
@@ -24,7 +24,7 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
static {
// TESTS_NUMBERS = new int [] { 40 };
// TESTS_RANGE = new int[] { 1, -1 };
-// TESTS_NAMES = new String[] { "testBug544073_035" };
+// TESTS_NAMES = new String[] { "testBug544073_81" };
}
public static Class<?> testClass() {
@@ -2588,4 +2588,35 @@ public class SwitchExpressionsYieldTest extends AbstractRegressionTest {
null,
new String[] {"--enable-preview"});
}
+ public void testBug544073_81() {
+ this.runNegativeTest(
+ new String[] {
+ "X.java",
+ "public class X {\n"+
+ "\n"+
+ " @SuppressWarnings(\"preview\")\n"+
+ " public static int foo(int val) {\n"+
+ " int k = switch (val) {\n"+
+ " case 1 : { break 1; }\n"+
+ " default : { break 2; }\n"+
+ " };\n"+
+ " return k;\n"+
+ " }\n"+
+ " public static void main(String[] args) {\n"+
+ " System.out.println(X.foo(1));\n"+
+ " }\n"+
+ "}\n",
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 6)\n" +
+ " case 1 : { break 1; }\n" +
+ " ^\n" +
+ "Syntax error on token \"1\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 7)\n" +
+ " default : { break 2; }\n" +
+ " ^\n" +
+ "Syntax error on token \"2\", delete this token\n" +
+ "----------\n");
+ }
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java
index e5f345ae04..0b5e3ce2b7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java
@@ -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
@@ -16,18 +20,15 @@
package org.eclipse.jdt.internal.compiler.ast;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.eclipse.jdt.internal.compiler.codegen.CodeStream;
import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.lookup.*;
public class BreakStatement extends BranchStatement {
-
- public Expression expression;
- public SwitchExpression switchExpression;
public boolean isImplicit;
public BreakStatement(char[] label, int sourceStart, int e) {
super(label, sourceStart, e);
+ this.isImplicit = false;
}
@Override
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {
@@ -44,21 +45,10 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
if (this.label == null) {
currentScope.problemReporter().invalidBreak(this);
} else {
- if (this.switchExpression == null)
- currentScope.problemReporter().undefinedLabel(this);
+ currentScope.problemReporter().undefinedLabel(this);
}
return flowInfo; // pretend it did not break since no actual target
}
- if (targetContext.associatedNode instanceof SwitchExpression) {
- //TODO : flag error here currentScope.problemReporter().invalidBreak(this);
- }
-
- if ((this.isImplicit || this.switchExpression != null) && this.expression != null) {
- flowInfo = this.expression.analyseCode(currentScope, flowContext, flowInfo);
- this.expression.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);
- if (flowInfo.reachMode() == FlowInfo.REACHABLE && currentScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled)
- checkAgainstNullAnnotation(currentScope, flowContext, flowInfo, this.expression);
- }
targetContext.recordAbruptExit();
targetContext.expireNullCheckedFieldInfo();
@@ -104,72 +94,17 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl
}
return FlowInfo.DEAD_END;
}
-@Override
-protected void generateExpressionResultCode(BlockScope currentScope, CodeStream codeStream) {
- if (this.label == null && this.expression != null) {
- this.expression.generateCode(currentScope, codeStream, this.switchExpression != null);
- }
-}
-@Override
-protected void adjustStackSize(BlockScope currentScope, CodeStream codeStream) {
- if (this.label == null && this.expression != null && this.switchExpression != null) {
- TypeBinding postConversionType = this.expression.postConversionType(currentScope);
- switch(postConversionType.id) {
- case TypeIds.T_long :
- case TypeIds.T_double :
- codeStream.decrStackSize(2);
- break;
- case TypeIds.T_void :
- break;
- default :
- codeStream.decrStackSize(1);
- break;
- }
- }
-}
-@Override
-public void resolve(BlockScope scope) {
- super.resolve(scope);
- if (this.expression != null && (this.switchExpression != null || this.isImplicit)) {
- if (this.switchExpression == null && this.isImplicit && !this.expression.statementExpression()) {
- if (scope.compilerOptions().enablePreviewFeatures) {
- /* JLS 12 14.11.2
- Switch labeled rules in switch statements differ from those in switch expressions (15.28).
- In switch statements they must be switch labeled statement expressions, ... */
- scope.problemReporter().invalidExpressionAsStatement(this.expression);
- return;
- }
- }
- this.expression.resolveType(scope);
- } else if (this.expression == null && this.switchExpression != null) {
- scope.problemReporter().switchExpressionBreakMissingValue(this);
- }
-}
-
-@Override
-public TypeBinding resolveExpressionType(BlockScope scope) {
- return this.expression != null ? this.expression.resolveType(scope) : null;
-}
@Override
public StringBuffer printStatement(int tab, StringBuffer output) {
- if (!this.isImplicit) // implicit for SwitchLabeledExpressions
- printIndent(tab, output).append("break"); //$NON-NLS-1$
- if (this.label != null)
- output.append(' ').append(this.label);
- if (this.expression != null) {
- output.append(' ');
- this.expression.printExpression(tab, output);
- }
+ printIndent(tab, output).append("break"); //$NON-NLS-1$
+ if (this.label != null) output.append(' ').append(this.label);
return output.append(';');
}
@Override
public void traverse(ASTVisitor visitor, BlockScope blockscope) {
- if (visitor.visit(this, blockscope)) {
- if (this.expression != null)
- this.expression.traverse(visitor, blockscope);
- }
+ visitor.visit(this, blockscope);
visitor.endVisit(this, blockscope);
}
@Override
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java
index d05fbf49ac..31e0a09865 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java
@@ -26,6 +26,9 @@ public class YieldStatement extends BranchStatement {
public Expression expression;
public SwitchExpression switchExpression;
+ /**
+ * @noreference This field is not intended to be referenced by clients.
+ */
public boolean isImplicit;
public YieldStatement(Expression exp, int sourceStart, int e) {
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 bd748e5713..727853be81 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
@@ -7299,7 +7299,7 @@ protected void consumeRule(int act) {
consumeStatementBreak() ;
break;
- case 422 : if (DEBUG) { System.out.println("BreakStatement ::= break Expression SEMICOLON"); } //$NON-NLS-1$
+ case 422 : if (DEBUG) { System.out.println("BreakStatement ::= break Identifier SEMICOLON"); } //$NON-NLS-1$
consumeStatementBreakWithLabel() ;
break;
@@ -9099,21 +9099,12 @@ protected void consumeStatementBreakWithLabel() {
// BreakStatement ::= 'break' Identifier ';'
// break pushs a position on this.intStack in case there is no label
- // add the compliance check
- if (this.expressionLengthStack[this.expressionLengthPtr--] != 0) {
- Expression expr = this.expressionStack[this.expressionPtr--];
- char[] labelOrExpr = expr instanceof Literal ?
- ((Literal) expr).source() : expr instanceof SingleNameReference ? ((SingleNameReference) expr).token : null;
- BreakStatement breakStatement = new BreakStatement(
- labelOrExpr,
- this.intStack[this.intPtr--],
- this.endStatementPosition);
- pushOnAstStack(breakStatement);
- breakStatement.expression = expr; // need to figure out later whether this is a label or an expression.
- if (expr instanceof SingleNameReference) {
- ((SingleNameReference) expr).isLabel = true;
- }
- }
+ pushOnAstStack(
+ new BreakStatement(
+ this.identifierStack[this.identifierPtr--],
+ this.intStack[this.intPtr--],
+ this.endStatementPosition));
+ this.identifierLengthPtr--;
}
protected void consumeStatementYield() {
// YieldStatement ::= RestrictedIdentifierYield Expression ';'
@@ -9582,158 +9573,6 @@ protected void consumeDefaultLabelExpr() {
}
defaultStatement.isExpr = true;
}
-/* package */ void collectResultExpressions(SwitchExpression s) {
- if (s.resultExpressions != null)
- return; // already calculated.
-
- class ResultExpressionsCollector extends ASTVisitor {
- Stack<SwitchExpression> targetSwitchExpressions;
- public ResultExpressionsCollector(SwitchExpression se) {
- if (this.targetSwitchExpressions == null)
- this.targetSwitchExpressions = new Stack<>();
- this.targetSwitchExpressions.push(se);
- }
- @Override
- public boolean visit(SwitchExpression switchExpression, BlockScope blockScope) {
- if (switchExpression.resultExpressions == null)
- switchExpression.resultExpressions = new ArrayList<>(0);
- this.targetSwitchExpressions.push(switchExpression);
- return false;
- }
- @Override
- public void endVisit(SwitchExpression switchExpression, BlockScope blockScope) {
- this.targetSwitchExpressions.pop();
- }
- @Override
- public boolean visit(BreakStatement breakStatement, BlockScope blockScope) {
- SwitchExpression targetSwitchExpression = this.targetSwitchExpressions.peek();
- if (breakStatement.expression != null) {
- targetSwitchExpression.resultExpressions.add(breakStatement.expression);
- breakStatement.switchExpression = this.targetSwitchExpressions.peek();
- breakStatement.label = null; // not a label, but an expression
- if (breakStatement.expression instanceof SingleNameReference) {
- ((SingleNameReference) breakStatement.expression).isLabel = false;
- }
- } else {
- // flag an error while resolving
- breakStatement.switchExpression = targetSwitchExpression;
- }
- return true;
- }
- @Override
- public boolean visit(DoStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(ForStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(ForeachStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(SwitchStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(TypeDeclaration stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(WhileStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(CaseStatement caseStatement, BlockScope blockScope) {
- return true; // do nothing by default, keep traversing
- }
- }
- s.resultExpressions = new ArrayList<>(0); // indicates processed
- int l = s.statements == null ? 0 : s.statements.length;
- for (int i = 0; i < l; ++i) {
- Statement stmt = s.statements[i];
- if (stmt instanceof CaseStatement) {
- CaseStatement caseStatement = (CaseStatement) stmt;
- if (!caseStatement.isExpr) continue;
- stmt = s.statements[++i];
- if (stmt instanceof Expression && ((Expression) stmt).isTrulyExpression()) {
- s.resultExpressions.add((Expression) stmt);
- continue;
- } else if (stmt instanceof ThrowStatement) {
- // TODO: Throw Expression Processing. Anything to be done here for resolve?
- continue;
- }
- }
- // break statement and block statement of SwitchLabelRule or block statement of ':'
- ResultExpressionsCollector reCollector = new ResultExpressionsCollector(s);
- stmt.traverse(reCollector, null);
- }
-}
-/* package */ void flagBreak(SwitchExpression s) {
- if (s.resultExpressions != null)
- return; // already calculated.
-
- class BreakFlagVisitor extends ASTVisitor {
- Stack<SwitchExpression> targetSwitchExpressions;
- public BreakFlagVisitor(SwitchExpression se) {
- if (this.targetSwitchExpressions == null)
- this.targetSwitchExpressions = new Stack<>();
- this.targetSwitchExpressions.push(se);
- }
- @Override
- public boolean visit(SwitchExpression switchExpression, BlockScope blockScope) {
- if (switchExpression.resultExpressions == null)
- switchExpression.resultExpressions = new ArrayList<>(0);
- this.targetSwitchExpressions.push(switchExpression);
- return false;
- }
- @Override
- public void endVisit(SwitchExpression switchExpression, BlockScope blockScope) {
- this.targetSwitchExpressions.pop();
- }
- @Override
- public boolean visit(BreakStatement breakStatement, BlockScope blockScope) {
- // flag an error while resolving
- breakStatement.switchExpression = this.targetSwitchExpressions.peek();
- return true;
- }
- @Override
- public boolean visit(DoStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(ForStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(ForeachStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(SwitchStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(TypeDeclaration stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(WhileStatement stmt, BlockScope blockScope) {
- return false;
- }
- @Override
- public boolean visit(CaseStatement caseStatement, BlockScope blockScope) {
- return true; // do nothing by default, keep traversing
- }
- }
- int l = s.statements == null ? 0 : s.statements.length;
- for (int i = 0; i < l; ++i) {
- Statement stmt = s.statements[i];
- BreakFlagVisitor reCollector = new BreakFlagVisitor(s);
- stmt.traverse(reCollector, null);
- }
-}
/* package */ void collectResultExpressionsYield(SwitchExpression s) {
if (s.resultExpressions != null)
return; // already calculated.
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 b8f569f926..3c23b62b4d 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
@@ -24,17 +24,17 @@ public interface ParserBasicInformation {
NUM_STATES = 1168,
NT_OFFSET = 130,
- SCOPE_UBOUND = 298,
- SCOPE_SIZE = 299,
- LA_STATE_OFFSET = 16753,
+ SCOPE_UBOUND = 297,
+ SCOPE_SIZE = 298,
+ LA_STATE_OFFSET = 16961,
MAX_LA = 1,
NUM_RULES = 870,
NUM_TERMINALS = 130,
NUM_NON_TERMINALS = 398,
NUM_SYMBOLS = 528,
- START_STATE = 1350,
+ START_STATE = 1025,
EOFT_SYMBOL = 61,
EOLT_SYMBOL = 61,
- ACCEPT_ACTION = 16752,
- ERROR_ACTION = 16753;
+ ACCEPT_ACTION = 16960,
+ ERROR_ACTION = 16961;
}
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 63197c408d..0bb12980ed 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
@@ -38,7 +38,7 @@ public interface TerminalTokens {
TokenNameCOMMENT_JAVADOC = 1003;
int TokenNameIdentifier = 22,
- TokenNameabstract = 52,
+ TokenNameabstract = 51,
TokenNameassert = 77,
TokenNameboolean = 100,
TokenNamebreak = 78,
@@ -56,7 +56,7 @@ public interface TerminalTokens {
TokenNameenum = 71,
TokenNameextends = 87,
TokenNamefalse = 38,
- TokenNamefinal = 53,
+ TokenNamefinal = 52,
TokenNamefinally = 112,
TokenNamefloat = 106,
TokenNamefor = 81,
@@ -68,25 +68,25 @@ public interface TerminalTokens {
TokenNameint = 108,
TokenNameinterface = 70,
TokenNamelong = 109,
- TokenNamenative = 54,
+ TokenNamenative = 53,
TokenNamenew = 36,
TokenNamenull = 39,
TokenNamepackage = 86,
- TokenNameprivate = 55,
- TokenNameprotected = 56,
- TokenNamepublic = 57,
+ TokenNameprivate = 54,
+ TokenNameprotected = 55,
+ TokenNamepublic = 56,
TokenNamereturn = 83,
TokenNameshort = 110,
- TokenNamestatic = 48,
- TokenNamestrictfp = 58,
+ TokenNamestatic = 40,
+ TokenNamestrictfp = 57,
TokenNamesuper = 34,
- TokenNameswitch = 51,
+ TokenNameswitch = 58,
TokenNamesynchronized = 50,
TokenNamethis = 35,
TokenNamethrow = 74,
TokenNamethrows = 121,
TokenNametransient = 59,
- TokenNametrue = 40,
+ TokenNametrue = 41,
TokenNametry = 84,
TokenNamevoid = 111,
TokenNamevolatile = 60,
@@ -101,12 +101,12 @@ public interface TerminalTokens {
TokenNameuses = 119,
TokenNameprovides = 120,
TokenNamewith = 126,
- TokenNameIntegerLiteral = 41,
- TokenNameLongLiteral = 42,
- TokenNameFloatingPointLiteral = 43,
- TokenNameDoubleLiteral = 44,
- TokenNameCharacterLiteral = 45,
- TokenNameStringLiteral = 46,
+ TokenNameIntegerLiteral = 42,
+ TokenNameLongLiteral = 43,
+ TokenNameFloatingPointLiteral = 44,
+ TokenNameDoubleLiteral = 45,
+ TokenNameCharacterLiteral = 46,
+ TokenNameStringLiteral = 47,
TokenNamePLUS_PLUS = 2,
TokenNameMINUS_MINUS = 3,
TokenNameEQUAL_EQUAL = 19,
@@ -136,14 +136,14 @@ public interface TerminalTokens {
TokenNameXOR = 24,
TokenNameAND = 21,
TokenNameMULTIPLY = 8,
- TokenNameOR = 28,
+ TokenNameOR = 27,
TokenNameTWIDDLE = 64,
TokenNameDIVIDE = 10,
TokenNameGREATER = 15,
TokenNameLESS = 11,
TokenNameLPAREN = 23,
TokenNameRPAREN = 26,
- TokenNameLBRACE = 49,
+ TokenNameLBRACE = 48,
TokenNameRBRACE = 33,
TokenNameLBRACKET = 6,
TokenNameRBRACKET = 66,
@@ -157,11 +157,11 @@ public interface TerminalTokens {
TokenNameELLIPSIS = 123,
TokenNameARROW = 99,
TokenNameCOLON_COLON = 7,
- TokenNameBeginLambda = 47,
+ TokenNameBeginLambda = 49,
TokenNameBeginIntersectionCast = 65,
TokenNameBeginTypeArguments = 85,
TokenNameElidedSemicolonAndRightBrace = 68,
- TokenNameAT308 = 27,
+ TokenNameAT308 = 28,
TokenNameAT308DOTDOTDOT = 127,
TokenNameBeginCaseExpr = 69,
TokenNameRestrictedIdentifierYield = 76,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
index 7572a3501c..394f94150e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser1.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
index d18a0e47ac..b967ced38a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser10.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
index 04fc062019..a3846c0a63 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser11.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
index 4ec05b7801..df41dc143b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser12.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
index 7be977be0f..5247d001d2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser13.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
index 6173ae19b0..0a6f1cdad3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser14.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
index 63b439e603..59356dd49b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser15.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
index 72cfbe696e..b494420e7d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser16.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
index 64814a6a24..c834b21a66 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser18.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser19.rsc
index c78586573d..2f89298bda 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
@@ -1,2 +1,2 @@
-qqH!!p {H!!BBBB11p!!!!>>> {##""!!Dg!!!#!f >K  1MM1>11ode  
-W  GHHcEJFICW>G  % %U"#  \ No newline at end of file
+qqH!!p {H!!BBBB00p!!!!>>> {##""!!Dg!!!#!f >K  0MM0>00ode  
+W  GHHcEJFICW>G  % %U"#  \ No newline at end of file
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
index ec182eb86c..3f3f04ae7a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser2.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
index 2364033f8c..b54da0c192 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser22.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
index a19eb72138..d739b27fce 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser23.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
index c59b40e195..6e75d5f3a8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser3.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
index da284f3f2c..aa674c7f2a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser4.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
index 729d7dd12c..7c37f17dc3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser5.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
index 1f69df9d05..9826dddf4c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser6.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
index faa6b3b454..9f7eeb8233 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser7.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
index 0304e64b2a..f3b0f8bca1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser8.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
index 969c6aa3ef..b733e28f89 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/parser9.rsc
Binary files differ
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
index aaad47f1c5..58c709c66b 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
@@ -1286,33 +1286,14 @@ class ASTConverter {
public BreakStatement convert(org.eclipse.jdt.internal.compiler.ast.BreakStatement statement) {
BreakStatement breakStatement = new BreakStatement(this.ast);
- if (this.ast.apiLevel >= AST.JLS12_INTERNAL) {
- breakStatement.setImplicit(statement.isImplicit);
- if (statement.isImplicit) {
- breakStatement.setSourceRange(statement.sourceEnd -1, 0);
- } else {
- breakStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
- }
- }
- else {
- breakStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
- }
+ breakStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
if (statement.label != null) {
final SimpleName name = new SimpleName(this.ast);
name.internalSetIdentifier(new String(statement.label));
retrieveIdentifierAndSetPositions(statement.sourceStart, statement.sourceEnd, name);
breakStatement.setLabel(name);
}
- else if (statement.expression != null && this.ast.apiLevel >= AST.JLS12_INTERNAL) {
- final Expression expression= convert(statement.expression);
- breakStatement.setExpression(expression);
- int sourceEnd = statement.sourceEnd;
- if (sourceEnd == -1) {
- breakStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 2);
- } else {
- breakStatement.setSourceRange(statement.sourceStart, sourceEnd - statement.sourceStart + 1);
- }
- }
+ breakStatement.setImplicit(statement.isImplicit);
return breakStatement;
}
diff --git a/org.eclipse.jdt.core/grammar/java.g b/org.eclipse.jdt.core/grammar/java.g
index c4d37ee960..83a9301cb4 100644
--- a/org.eclipse.jdt.core/grammar/java.g
+++ b/org.eclipse.jdt.core/grammar/java.g
@@ -1381,7 +1381,7 @@ AssertStatement ::= 'assert' Expression ':' Expression ';'
BreakStatement ::= 'break' ';'
/.$putCase consumeStatementBreak() ; $break ./
-BreakStatement ::= 'break' Expression ';'
+BreakStatement ::= 'break' Identifier ';'
/.$putCase consumeStatementBreakWithLabel() ; $break ./
/:$readableName BreakStatement:/

Back to the top