From d20c1e3900bbdb5a24577d6ec42de31058de8006 Mon Sep 17 00:00:00 2001 From: Clement Dessoude Date: Sun, 13 Jun 2021 11:38:40 +0200 Subject: [PATCH] docs: update parser Java spec references to Java 16 --- .../java-parser/src/productions/arrays.js | 4 +- .../src/productions/blocks-and-statements.js | 90 ++++++++--------- .../java-parser/src/productions/classes.js | 98 +++++++++---------- .../src/productions/expressions.js | 10 +- .../java-parser/src/productions/interfaces.js | 48 ++++----- .../src/productions/lexical-structure.js | 8 +- packages/java-parser/src/productions/names.js | 14 +-- .../src/productions/packages-and-modules.js | 22 ++--- .../productions/types-values-and-variables.js | 36 +++---- 9 files changed, 165 insertions(+), 165 deletions(-) diff --git a/packages/java-parser/src/productions/arrays.js b/packages/java-parser/src/productions/arrays.js index f4a07133..d97e2801 100644 --- a/packages/java-parser/src/productions/arrays.js +++ b/packages/java-parser/src/productions/arrays.js @@ -3,7 +3,7 @@ const { tokenMatcher } = require("chevrotain"); function defineRules($, t) { - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-10.html#jls-ArrayInitializer + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-10.html#jls-ArrayInitializer $.RULE("arrayInitializer", () => { $.CONSUME(t.LCurly); $.OPTION(() => { @@ -15,7 +15,7 @@ function defineRules($, t) { $.CONSUME(t.RCurly); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-10.html#jls-VariableInitializerList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-10.html#jls-VariableInitializerList $.RULE("variableInitializerList", () => { $.SUBRULE($.variableInitializer); $.MANY({ diff --git a/packages/java-parser/src/productions/blocks-and-statements.js b/packages/java-parser/src/productions/blocks-and-statements.js index de07c01e..30d91380 100644 --- a/packages/java-parser/src/productions/blocks-and-statements.js +++ b/packages/java-parser/src/productions/blocks-and-statements.js @@ -6,7 +6,7 @@ const { tokenMatcher } = require("chevrotain"); // the dangling else is resolved by attaching an "else" block // to the nearest "if" function defineRules($, t) { - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Block + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-Block $.RULE("block", () => { $.CONSUME(t.LCurly); $.OPTION(() => { @@ -15,7 +15,7 @@ function defineRules($, t) { $.CONSUME(t.RCurly); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BlockStatements + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-BlockStatements $.RULE("blockStatements", () => { $.SUBRULE($.blockStatement); $.MANY(() => { @@ -23,7 +23,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BlockStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-BlockStatement $.RULE("blockStatement", () => { const isLocalVariableDeclaration = this.BACKTRACK_LOOKAHEAD( $.isLocalVariableDeclaration @@ -44,13 +44,13 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LocalVariableDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-LocalVariableDeclarationStatement $.RULE("localVariableDeclarationStatement", () => { $.SUBRULE($.localVariableDeclaration); $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LocalVariableDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-LocalVariableDeclaration $.RULE("localVariableDeclaration", () => { $.MANY(() => { $.SUBRULE($.variableModifier); @@ -59,7 +59,7 @@ function defineRules($, t) { $.SUBRULE($.variableDeclaratorList); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LocalVariableType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-LocalVariableType $.RULE("localVariableType", () => { $.OR({ DEF: [ @@ -70,7 +70,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Statement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-Statement $.RULE("statement", () => { $.OR({ DEF: [ @@ -87,7 +87,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-StatementWithoutTrailingSubstatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-StatementWithoutTrailingSubstatement $.RULE("statementWithoutTrailingSubstatement", () => { $.OR({ DEF: [ @@ -112,25 +112,25 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-EmptyStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-EmptyStatement $.RULE("emptyStatement", () => { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LabeledStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-LabeledStatement $.RULE("labeledStatement", () => { $.CONSUME(t.Identifier); $.CONSUME(t.Colon); $.SUBRULE($.statement); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ExpressionStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ExpressionStatement $.RULE("expressionStatement", () => { $.SUBRULE($.statementExpression); $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-StatementExpression + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-StatementExpression $.RULE("statementExpression", () => { // Spec deviation: The many alternatives here were replaced with // the "expression" rule as it contains them all, @@ -141,8 +141,8 @@ function defineRules($, t) { }); // Spec deviation: combined "IfThenStatement" and "IfThenElseStatement" - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-IfThenStatement - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-IfThenElseStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-IfThenStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-IfThenElseStatement $.RULE("ifStatement", () => { $.CONSUME(t.If); $.CONSUME(t.LBrace); @@ -155,7 +155,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-AssertStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-AssertStatement $.RULE("assertStatement", () => { $.CONSUME(t.Assert); $.SUBRULE($.expression); @@ -166,7 +166,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SwitchStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-SwitchStatement $.RULE("switchStatement", () => { $.CONSUME(t.Switch); $.CONSUME(t.LBrace); @@ -175,7 +175,7 @@ function defineRules($, t) { $.SUBRULE($.switchBlock); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SwitchBlock + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-SwitchBlock $.RULE("switchBlock", () => { $.CONSUME(t.LCurly); $.OR([ @@ -200,7 +200,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SwitchLabel + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-SwitchLabel $.RULE("switchLabel", () => { $.OR([ { @@ -222,7 +222,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se15/html/jls-14.html#jls-SwitchRule + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-SwitchRule $.RULE("switchRule", () => { $.SUBRULE($.switchLabel); $.CONSUME(t.Arrow); @@ -238,12 +238,12 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-EnumConstantName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-EnumConstantName $.RULE("caseConstant", () => { $.SUBRULE($.ternaryExpression); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-WhileStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-WhileStatement $.RULE("whileStatement", () => { $.CONSUME(t.While); $.CONSUME(t.LBrace); @@ -252,7 +252,7 @@ function defineRules($, t) { $.SUBRULE($.statement); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-DoStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-DoStatement $.RULE("doStatement", () => { $.CONSUME(t.Do); $.SUBRULE($.statement); @@ -262,7 +262,7 @@ function defineRules($, t) { $.CONSUME(t.RBrace); $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ForStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ForStatement $.RULE("forStatement", () => { $.OR([ { @@ -273,7 +273,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BasicForStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-BasicForStatement $.RULE("basicForStatement", () => { $.CONSUME(t.For); $.CONSUME(t.LBrace); @@ -292,7 +292,7 @@ function defineRules($, t) { $.SUBRULE($.statement); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ForInit + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ForInit $.RULE("forInit", () => { $.OR([ { @@ -303,12 +303,12 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ForUpdate + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ForUpdate $.RULE("forUpdate", () => { $.SUBRULE($.statementExpressionList); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-StatementExpressionList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-StatementExpressionList $.RULE("statementExpressionList", () => { $.SUBRULE($.statementExpression); $.MANY(() => { @@ -317,7 +317,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-EnhancedForStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-EnhancedForStatement $.RULE("enhancedForStatement", () => { $.CONSUME(t.For); $.CONSUME(t.LBrace); @@ -332,7 +332,7 @@ function defineRules($, t) { $.SUBRULE($.statement); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BreakStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-BreakStatement $.RULE("breakStatement", () => { $.CONSUME(t.Break); $.OPTION(() => { @@ -341,7 +341,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ContinueStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ContinueStatement $.RULE("continueStatement", () => { $.CONSUME(t.Continue); $.OPTION(() => { @@ -350,7 +350,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ReturnStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ReturnStatement $.RULE("returnStatement", () => { $.CONSUME(t.Return); $.OPTION(() => { @@ -359,14 +359,14 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ThrowStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ThrowStatement $.RULE("throwStatement", () => { $.CONSUME(t.Throw); $.SUBRULE($.expression); $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SynchronizedStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-SynchronizedStatement $.RULE("synchronizedStatement", () => { $.CONSUME(t.Synchronized); $.CONSUME(t.LBrace); @@ -375,7 +375,7 @@ function defineRules($, t) { $.SUBRULE($.block); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-TryStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-TryStatement $.RULE("tryStatement", () => { $.OR({ DEF: [ @@ -402,7 +402,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Catches + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-Catches $.RULE("catches", () => { $.SUBRULE($.catchClause); $.MANY(() => { @@ -410,7 +410,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-CatchClause + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-CatchClause $.RULE("catchClause", () => { $.CONSUME(t.Catch); $.CONSUME(t.LBrace); @@ -419,7 +419,7 @@ function defineRules($, t) { $.SUBRULE($.block); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-CatchFormalParameter + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-CatchFormalParameter $.RULE("catchFormalParameter", () => { $.MANY(() => { $.SUBRULE($.variableModifier); @@ -428,7 +428,7 @@ function defineRules($, t) { $.SUBRULE($.variableDeclaratorId); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-CatchType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-CatchType $.RULE("catchType", () => { $.SUBRULE($.unannClassType); $.MANY(() => { @@ -437,13 +437,13 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Finally + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-Finally $.RULE("finally", () => { $.CONSUME(t.Finally); $.SUBRULE($.block); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-TryWithResourcesStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-TryWithResourcesStatement $.RULE("tryWithResourcesStatement", () => { $.CONSUME(t.Try); $.SUBRULE($.resourceSpecification); @@ -456,7 +456,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ResourceSpecification + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ResourceSpecification $.RULE("resourceSpecification", () => { $.CONSUME(t.LBrace); $.SUBRULE($.resourceList); @@ -466,7 +466,7 @@ function defineRules($, t) { $.CONSUME(t.RBrace); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ResourceList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-ResourceList $.RULE("resourceList", () => { $.SUBRULE($.resource); $.MANY({ @@ -478,7 +478,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Resource + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-Resource $.RULE("resource", () => { $.OR([ { @@ -502,14 +502,14 @@ function defineRules($, t) { $.SUBRULE($.expression); }); - // https://docs.oracle.com/javase/specs/jls/se15/html/jls-14.html#jls-YieldStatement + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-YieldStatement $.RULE("yieldStatement", () => { $.CONSUME(t.Yield); $.SUBRULE($.expression); $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-VariableAccess + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-14.html#jls-VariableAccess $.RULE("variableAccess", () => { // Spec Deviation: both "expressionName" and "fieldAccess" can be parsed // by the "primary" rule diff --git a/packages/java-parser/src/productions/classes.js b/packages/java-parser/src/productions/classes.js index 2a3a4934..3df381dc 100644 --- a/packages/java-parser/src/productions/classes.js +++ b/packages/java-parser/src/productions/classes.js @@ -3,7 +3,7 @@ const { isRecognitionException, tokenMatcher } = require("chevrotain"); function defineRules($, t) { - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ClassDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ClassDeclaration $.RULE("classDeclaration", () => { // Spec Deviation: extracted common "{classModifier}" prefix // extraction is safe because there are no other references to @@ -18,7 +18,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-NormalClassDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-NormalClassDeclaration $.RULE("normalClassDeclaration", () => { // Spec Deviation: extracted common "{classModifier}" to "classDeclaration" $.CONSUME(t.Class); @@ -35,7 +35,7 @@ function defineRules($, t) { $.SUBRULE($.classBody); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ClassModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ClassModifier $.RULE("classModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -49,14 +49,14 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-TypeParameters + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-TypeParameters $.RULE("typeParameters", () => { $.CONSUME(t.Less); $.SUBRULE($.typeParameterList); $.CONSUME(t.Greater); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-TypeParameterList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-TypeParameterList $.RULE("typeParameterList", () => { $.SUBRULE($.typeParameter); $.MANY(() => { @@ -65,19 +65,19 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-Superclass + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ClassExtends $.RULE("superclass", () => { $.CONSUME(t.Extends); $.SUBRULE($.classType); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-Superinterfaces + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ClassImplements $.RULE("superinterfaces", () => { $.CONSUME(t.Implements); $.SUBRULE($.interfaceTypeList); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-InterfaceTypeList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-InterfaceTypeList $.RULE("interfaceTypeList", () => { $.SUBRULE($.interfaceType); $.MANY(() => { @@ -86,7 +86,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ClassBody + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ClassBody $.RULE("classBody", () => { $.CONSUME(t.LCurly); $.MANY(() => { @@ -107,7 +107,7 @@ function defineRules($, t) { constructorDeclaration: 8 }; - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ClassBodyDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ClassBodyDeclaration $.RULE("classBodyDeclaration", () => { const nextRuleType = $.BACKTRACK_LOOKAHEAD( $.identifyClassBodyDeclarationType @@ -134,7 +134,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ClassMemberDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ClassMemberDeclaration $.RULE("classMemberDeclaration", nextRuleType => { $.OR([ { @@ -160,7 +160,7 @@ function defineRules($, t) { ]); }); - // // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-FieldDeclaration + // // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-FieldDeclaration $.RULE("fieldDeclaration", () => { $.MANY(() => { $.SUBRULE($.fieldModifier); @@ -170,7 +170,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-FieldModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-FieldModifier $.RULE("fieldModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -184,7 +184,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-VariableDeclaratorList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-VariableDeclaratorList $.RULE("variableDeclaratorList", () => { $.SUBRULE($.variableDeclarator); $.MANY(() => { @@ -193,7 +193,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-VariableDeclarator + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-VariableDeclarator $.RULE("variableDeclarator", () => { $.SUBRULE($.variableDeclaratorId); $.OPTION(() => { @@ -202,7 +202,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-VariableDeclaratorId + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-VariableDeclaratorId $.RULE("variableDeclaratorId", () => { $.CONSUME(t.Identifier); $.OPTION(() => { @@ -210,7 +210,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-VariableInitializer + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-VariableInitializer $.RULE("variableInitializer", () => { $.OR([ { ALT: () => $.SUBRULE($.expression) }, @@ -218,7 +218,7 @@ function defineRules($, t) { ]); }); - // // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-UnannType + // // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-UnannType $.RULE("unannType", () => { $.OR([ // Spec Deviation: The array type "dims" suffix was extracted to this rule @@ -236,7 +236,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-UnannPrimitiveType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-UnannPrimitiveType $.RULE("unannPrimitiveType", () => { $.OR([ { ALT: () => $.SUBRULE($.numericType) }, @@ -244,7 +244,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-UnannReferenceType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-UnannReferenceType $.RULE("unannReferenceType", () => { $.SUBRULE($.unannClassOrInterfaceType); $.OPTION({ @@ -253,7 +253,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-UnannClassType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-UnannClassType $.RULE("unannClassOrInterfaceType", () => { // Spec Deviation: The spec says: "UnannClassType | UnannInterfaceType" but "UnannInterfaceType" // is not mentioned in the parser because it is identical to "UnannClassType" @@ -280,7 +280,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-UnannInterfaceType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-UnannInterfaceType $.RULE("unannInterfaceType", () => { $.SUBRULE($.unannClassType); }); @@ -291,7 +291,7 @@ function defineRules($, t) { $.CONSUME(t.Identifier); }); - // // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-MethodDeclaration + // // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-MethodDeclaration $.RULE("methodDeclaration", () => { $.MANY(() => { $.SUBRULE($.methodModifier); @@ -300,7 +300,7 @@ function defineRules($, t) { $.SUBRULE($.methodBody); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-MethodModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-MethodModifier $.RULE("methodModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -316,7 +316,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-MethodHeader + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-MethodHeader $.RULE("methodHeader", () => { // Spec Deviation: extracted common prefix from both alternatives $.OPTION(() => { @@ -332,7 +332,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-Result + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-Result $.RULE("result", () => { $.OR([ { ALT: () => $.SUBRULE($.unannType) }, @@ -353,7 +353,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ReceiverParameter + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ReceiverParameter $.RULE("receiverParameter", () => { $.MANY(() => { $.SUBRULE($.annotation); @@ -366,7 +366,7 @@ function defineRules($, t) { $.CONSUME(t.This); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-FormalParameterList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-FormalParameterList $.RULE("formalParameterList", () => { $.SUBRULE($.formalParameter); $.MANY(() => { @@ -375,7 +375,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-FormalParameter + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-FormalParameter $.RULE("formalParameter", () => { $.OR([ // Spec Deviation: extracted to "variableParaRegularParameter" @@ -396,7 +396,7 @@ function defineRules($, t) { $.SUBRULE($.variableDeclaratorId); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-VariableArityParameter + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-VariableArityParameter $.RULE("variableArityParameter", () => { $.MANY(() => { $.SUBRULE($.variableModifier); @@ -409,7 +409,7 @@ function defineRules($, t) { $.CONSUME(t.Identifier); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-VariableModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-VariableModifier $.RULE("variableModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -417,13 +417,13 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-Throws + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-Throws $.RULE("throws", () => { $.CONSUME(t.Throws); $.SUBRULE($.exceptionTypeList); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ExceptionTypeList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ExceptionTypeList $.RULE("exceptionTypeList", () => { $.SUBRULE($.exceptionType); $.MANY(() => { @@ -432,14 +432,14 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ExceptionType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ExceptionType $.RULE("exceptionType", () => { // Spec Deviation: "typeVariable" alternative is missing because // it is contained in classType. $.SUBRULE($.classType); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-MethodBody + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-MethodBody $.RULE("methodBody", () => { $.OR([ { ALT: () => $.SUBRULE($.block) }, @@ -447,18 +447,18 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-InstanceInitializer + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-InstanceInitializer $.RULE("instanceInitializer", () => { $.SUBRULE($.block); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-StaticInitializer + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-StaticInitializer $.RULE("staticInitializer", () => { $.CONSUME(t.Static); $.SUBRULE($.block); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ConstructorDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ConstructorDeclaration $.RULE("constructorDeclaration", () => { $.MANY(() => { $.SUBRULE($.constructorModifier); @@ -470,7 +470,7 @@ function defineRules($, t) { $.SUBRULE($.constructorBody); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ConstructorModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ConstructorModifier $.RULE("constructorModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -480,7 +480,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ConstructorDeclarator + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ConstructorDeclarator $.RULE("constructorDeclarator", () => { $.OPTION(() => { $.SUBRULE($.typeParameters); @@ -502,13 +502,13 @@ function defineRules($, t) { $.CONSUME(t.RBrace); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-SimpleTypeName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-SimpleTypeName $.RULE("simpleTypeName", () => { // TODO: implement: Identifier but not var $.CONSUME(t.Identifier); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ConstructorBody + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ConstructorBody $.RULE("constructorBody", () => { $.CONSUME(t.LCurly); $.OPTION({ @@ -523,7 +523,7 @@ function defineRules($, t) { $.CONSUME(t.RCurly); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-ExplicitConstructorInvocation + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-ExplicitConstructorInvocation $.RULE("explicitConstructorInvocation", () => { // Spec Deviation: split into two separate sub rules. $.OR([ @@ -577,7 +577,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-EnumDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-EnumDeclaration $.RULE("enumDeclaration", () => { $.MANY(() => { $.SUBRULE($.classModifier); @@ -590,7 +590,7 @@ function defineRules($, t) { $.SUBRULE($.enumBody); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-EnumBody + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-EnumBody $.RULE("enumBody", () => { $.CONSUME(t.LCurly); $.OPTION(() => { @@ -605,7 +605,7 @@ function defineRules($, t) { $.CONSUME(t.RCurly); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-EnumConstantList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-EnumConstantList $.RULE("enumConstantList", () => { $.SUBRULE($.enumConstant); $.MANY({ @@ -622,7 +622,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-EnumConstant + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-EnumConstant $.RULE("enumConstant", () => { $.MANY(() => { $.SUBRULE($.enumConstantModifier); @@ -640,12 +640,12 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-EnumConstantModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-EnumConstantModifier $.RULE("enumConstantModifier", () => { $.SUBRULE($.annotation); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-EnumBodyDeclarations + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-EnumBodyDeclarations $.RULE("enumBodyDeclarations", () => { $.CONSUME(t.Semicolon); $.MANY(() => { diff --git a/packages/java-parser/src/productions/expressions.js b/packages/java-parser/src/productions/expressions.js index a6a5af20..2f96ead9 100644 --- a/packages/java-parser/src/productions/expressions.js +++ b/packages/java-parser/src/productions/expressions.js @@ -11,7 +11,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-LambdaExpression + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-15.html#jls-LambdaExpression $.RULE("lambdaExpression", () => { $.SUBRULE($.lambdaParameters); $.CONSUME(t.Arrow); @@ -417,7 +417,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-UnqualifiedClassInstanceCreationExpression + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-15.html#jls-UnqualifiedClassInstanceCreationExpression $.RULE("unqualifiedClassInstanceCreationExpression", () => { $.CONSUME(t.New); $.OPTION(() => { @@ -482,7 +482,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.10.1 + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-15.html#jls-15.10.1 $.RULE("arrayCreationExpression", () => { $.CONSUME(t.New); $.OR([ @@ -514,7 +514,7 @@ function defineRules($, t) { $.SUBRULE($.arrayInitializer); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-DimExprs + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-15.html#jls-DimExprs $.RULE("dimExprs", () => { $.SUBRULE($.dimExpr); $.MANY({ @@ -527,7 +527,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-DimExpr + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-15.html#jls-DimExpr $.RULE("dimExpr", () => { $.MANY(() => { $.SUBRULE($.annotation); diff --git a/packages/java-parser/src/productions/interfaces.js b/packages/java-parser/src/productions/interfaces.js index 4d592ba4..5eafde52 100644 --- a/packages/java-parser/src/productions/interfaces.js +++ b/packages/java-parser/src/productions/interfaces.js @@ -2,7 +2,7 @@ const { tokenMatcher } = require("chevrotain"); function defineRules($, t) { - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-InterfaceDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-InterfaceDeclaration $.RULE("interfaceDeclaration", () => { // Spec Deviation: extracted the common "interfaceModifier" prefix to avoid backtracking. $.MANY({ @@ -18,7 +18,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-NormalInterfaceDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-NormalInterfaceDeclaration $.RULE("normalInterfaceDeclaration", () => { // Spec Deviation: The "interfaceModifier" prefix was extracted to the "interfaceDeclaration" $.CONSUME(t.Interface); @@ -32,7 +32,7 @@ function defineRules($, t) { $.SUBRULE($.interfaceBody); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-InterfaceModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-InterfaceModifier $.RULE("interfaceModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -45,13 +45,13 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-ExtendsInterfaces + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-ExtendsInterfaces $.RULE("extendsInterfaces", () => { $.CONSUME(t.Extends); $.SUBRULE($.interfaceTypeList); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-InterfaceBody + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-InterfaceBody $.RULE("interfaceBody", () => { $.CONSUME(t.LCurly); $.MANY(() => { @@ -69,7 +69,7 @@ function defineRules($, t) { semiColon: 5 }; - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-InterfaceMemberDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-InterfaceMemberDeclaration $.RULE("interfaceMemberDeclaration", () => { const detectedType = this.BACKTRACK_LOOKAHEAD( $.identifyInterfaceBodyDeclarationType @@ -100,7 +100,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-ConstantDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-ConstantDeclaration $.RULE("constantDeclaration", () => { $.MANY(() => { $.SUBRULE($.constantModifier); @@ -110,7 +110,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-ConstantModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-ConstantModifier $.RULE("constantModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -120,7 +120,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-InterfaceMethodDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-InterfaceMethodDeclaration $.RULE("interfaceMethodDeclaration", () => { $.MANY(() => { $.SUBRULE($.interfaceMethodModifier); @@ -129,7 +129,7 @@ function defineRules($, t) { $.SUBRULE($.methodBody); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-InterfaceMethodModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-InterfaceMethodModifier $.RULE("interfaceMethodModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -142,7 +142,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-AnnotationTypeDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-AnnotationTypeDeclaration $.RULE("annotationTypeDeclaration", () => { // Spec Deviation: The "interfaceModifier" prefix was extracted to the "interfaceDeclaration" $.CONSUME(t.At); @@ -151,7 +151,7 @@ function defineRules($, t) { $.SUBRULE($.annotationTypeBody); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-AnnotationTypeBody + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-AnnotationTypeBody $.RULE("annotationTypeBody", () => { $.CONSUME(t.LCurly); $.MANY(() => { @@ -169,7 +169,7 @@ function defineRules($, t) { semiColon: 5 }; - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-InterfaceMemberDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-InterfaceMemberDeclaration $.RULE("annotationTypeMemberDeclaration", () => { const detectedType = this.BACKTRACK_LOOKAHEAD( $.identifyAnnotationBodyDeclarationType @@ -200,7 +200,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-AnnotationTypeElementDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-AnnotationTypeElementDeclaration $.RULE("annotationTypeElementDeclaration", () => { $.MANY(() => { $.SUBRULE($.annotationTypeElementModifier); @@ -218,7 +218,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-AnnotationTypeElementModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-AnnotationTypeElementModifier $.RULE("annotationTypeElementModifier", () => { $.OR([ { ALT: () => $.SUBRULE($.annotation) }, @@ -227,13 +227,13 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-DefaultValue + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-DefaultValue $.RULE("defaultValue", () => { $.CONSUME(t.Default); $.SUBRULE($.elementValue); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-Annotation + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-Annotation $.RULE("annotation", () => { // Spec Deviation: The common prefix for all three annotation types was extracted to this rule. // This was done to avoid the use of backtracking for performance reasons. @@ -241,14 +241,14 @@ function defineRules($, t) { $.SUBRULE($.typeName); // If this optional grammar was not invoked we have a markerAnnotation - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-MarkerAnnotation + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-MarkerAnnotation $.OPTION(() => { $.CONSUME(t.LBrace); $.OR({ DEF: [ - // normal annotation - https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-NormalAnnotation + // normal annotation - https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-NormalAnnotation { ALT: () => $.SUBRULE($.elementValuePairList) }, - // Single Element Annotation - https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-SingleElementAnnotation + // Single Element Annotation - https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-SingleElementAnnotation { ALT: () => $.SUBRULE($.elementValue) }, @@ -265,7 +265,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-ElementValuePairList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-ElementValuePairList $.RULE("elementValuePairList", () => { $.SUBRULE($.elementValuePair); $.MANY(() => { @@ -280,7 +280,7 @@ function defineRules($, t) { $.SUBRULE($.elementValue); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-ElementValue + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-ElementValue $.RULE("elementValue", () => { const isSimpleElementValueAnnotation = this.BACKTRACK_LOOKAHEAD( $.isSimpleElementValueAnnotation @@ -301,7 +301,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-ElementValueArrayInitializer + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-ElementValueArrayInitializer $.RULE("elementValueArrayInitializer", () => { $.CONSUME(t.LCurly); $.OPTION(() => { @@ -313,7 +313,7 @@ function defineRules($, t) { $.CONSUME(t.RCurly); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-ElementValueList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-9.html#jls-ElementValueList $.RULE("elementValueList", () => { $.SUBRULE($.elementValue); $.MANY({ diff --git a/packages/java-parser/src/productions/lexical-structure.js b/packages/java-parser/src/productions/lexical-structure.js index 4bfb7358..bd08c79c 100644 --- a/packages/java-parser/src/productions/lexical-structure.js +++ b/packages/java-parser/src/productions/lexical-structure.js @@ -1,6 +1,6 @@ "use strict"; function defineRules($, t) { - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-Literal + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-Literal $.RULE("literal", () => { $.OR([ { ALT: () => $.SUBRULE($.integerLiteral) }, @@ -13,7 +13,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-IntegerLiteral + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-IntegerLiteral $.RULE("integerLiteral", () => { $.OR([ { ALT: () => $.CONSUME(t.DecimalLiteral) }, @@ -23,7 +23,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-FloatingPointLiteral + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-FloatingPointLiteral $.RULE("floatingPointLiteral", () => { $.OR([ { ALT: () => $.CONSUME(t.FloatLiteral) }, @@ -31,7 +31,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-BooleanLiteral + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-BooleanLiteral $.RULE("booleanLiteral", () => { $.OR([{ ALT: () => $.CONSUME(t.True) }, { ALT: () => $.CONSUME(t.False) }]); }); diff --git a/packages/java-parser/src/productions/names.js b/packages/java-parser/src/productions/names.js index 5f1c238f..80190bce 100644 --- a/packages/java-parser/src/productions/names.js +++ b/packages/java-parser/src/productions/names.js @@ -1,7 +1,7 @@ "use strict"; const { tokenMatcher } = require("chevrotain"); function defineRules($, t) { - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-ModuleName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-6.html#jls-ModuleName $.RULE("moduleName", () => { $.CONSUME(t.Identifier); $.MANY(() => { @@ -10,7 +10,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-PackageName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-6.html#jls-PackageName $.RULE("packageName", () => { $.CONSUME(t.Identifier); $.MANY(() => { @@ -19,7 +19,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-TypeName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-6.html#jls-TypeName $.RULE("typeName", () => { // Spec Deviation: The last Identifier in a "typeName" may not be be "var" // But the parser does not check for that. @@ -33,7 +33,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-ExpressionName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-6.html#jls-ExpressionName $.RULE("expressionName", () => { // Spec Deviation: in-lined "ambiguousName" to be LL(K) $.CONSUME(t.Identifier); @@ -49,12 +49,12 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-MethodName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-6.html#jls-MethodName $.RULE("methodName", () => { $.CONSUME(t.Identifier); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-PackageOrTypeName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-6.html#jls-PackageOrTypeName $.RULE("packageOrTypeName", () => { $.CONSUME(t.Identifier); $.MANY({ @@ -71,7 +71,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-6.html#jls-AmbiguousName + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-6.html#jls-AmbiguousName $.RULE("ambiguousName", () => { $.CONSUME(t.Identifier); $.MANY(() => { diff --git a/packages/java-parser/src/productions/packages-and-modules.js b/packages/java-parser/src/productions/packages-and-modules.js index d456279c..ff6a4fd9 100644 --- a/packages/java-parser/src/productions/packages-and-modules.js +++ b/packages/java-parser/src/productions/packages-and-modules.js @@ -2,7 +2,7 @@ const { isRecognitionException, tokenMatcher, EOF } = require("chevrotain"); function defineRules($, t) { - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#CompilationUnit + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#CompilationUnit $.RULE("compilationUnit", () => { // custom optimized backtracking lookahead logic const isModule = $.BACKTRACK_LOOKAHEAD($.isModuleCompilationUnit); @@ -20,7 +20,7 @@ function defineRules($, t) { $.CONSUME(EOF); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-OrdinaryCompilationUnit + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-OrdinaryCompilationUnit $.RULE("ordinaryCompilationUnit", () => { $.OPTION({ GATE: $.BACKTRACK($.packageDeclaration), @@ -36,7 +36,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-ModularCompilationUnit + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-ModularCompilationUnit $.RULE("modularCompilationUnit", () => { $.MANY(() => { $.SUBRULE($.importDeclaration); @@ -44,7 +44,7 @@ function defineRules($, t) { $.SUBRULE($.moduleDeclaration); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-PackageDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-PackageDeclaration $.RULE("packageDeclaration", () => { $.MANY(() => { $.SUBRULE($.packageModifier); @@ -58,12 +58,12 @@ function defineRules($, t) { $.CONSUME2(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-PackageModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-PackageModifier $.RULE("packageModifier", () => { $.SUBRULE($.annotation); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-ImportDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-ImportDeclaration $.RULE("importDeclaration", () => { // Spec Deviation: The spec defines four different kinds of import declarations. // Our grammar however combines those into a single rule due to difficulties @@ -95,7 +95,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-TypeDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-TypeDeclaration $.RULE("typeDeclaration", () => { // TODO: consider extracting the prefix modifiers here to avoid backtracking const isClassDeclaration = this.BACKTRACK_LOOKAHEAD($.isClassDeclaration); @@ -110,7 +110,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-ModuleDeclaration + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-ModuleDeclaration $.RULE("moduleDeclaration", () => { $.MANY(() => { $.SUBRULE($.annotation); @@ -131,7 +131,7 @@ function defineRules($, t) { $.CONSUME(t.RCurly); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-ModuleDirective + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-ModuleDirective $.RULE("moduleDirective", () => { // Spec Deviation: Each of the alternatives of "moduleDirective" was extracted // to its own nonTerminal, to reduce verbosity. @@ -150,7 +150,7 @@ function defineRules($, t) { $.MANY({ GATE: () => { /** - * https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-3.9 - + * https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-3.9 - * There is one exception: immediately to the right of the character sequence `requires` in the ModuleDirective production, * the character sequence `transitive` is tokenized as a keyword unless it is followed by a separator, * in which case it is tokenized as an identifier. @@ -218,7 +218,7 @@ function defineRules($, t) { $.CONSUME(t.Semicolon); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-7.html#jls-RequiresModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-7.html#jls-RequiresModifier $.RULE("requiresModifier", () => { $.OR([ { ALT: () => $.CONSUME(t.Transitive) }, diff --git a/packages/java-parser/src/productions/types-values-and-variables.js b/packages/java-parser/src/productions/types-values-and-variables.js index d2efc0e6..0936de48 100644 --- a/packages/java-parser/src/productions/types-values-and-variables.js +++ b/packages/java-parser/src/productions/types-values-and-variables.js @@ -7,7 +7,7 @@ function defineRules($, t) { // Productions from ยง4 (Types, Values, and Variables) // --------------------- - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-PrimitiveType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-PrimitiveType $.RULE("primitiveType", () => { $.MANY(() => { $.SUBRULE($.annotation); @@ -18,7 +18,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-NumericType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-NumericType $.RULE("numericType", () => { $.OR([ { ALT: () => $.SUBRULE($.integralType) }, @@ -26,7 +26,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-IntegralType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-IntegralType $.RULE("integralType", () => { $.OR([ { ALT: () => $.CONSUME(t.Byte) }, @@ -37,7 +37,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-FloatingPointType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-FloatingPointType $.RULE("floatingPointType", () => { $.OR([ { ALT: () => $.CONSUME(t.Float) }, @@ -45,7 +45,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-ReferenceType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-ReferenceType $.RULE("referenceType", () => { $.MANY(() => { // Spec Deviation: by extracting the common "annotation" prefix @@ -79,7 +79,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-ClassOrInterfaceType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-ClassOrInterfaceType $.RULE("classOrInterfaceType", () => { // Spec Deviation: The spec says: "classType | interfaceType" but "interfaceType" // is not mentioned in the parser because it is identical to "classType" @@ -87,7 +87,7 @@ function defineRules($, t) { $.SUBRULE($.classType); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-ClassType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-ClassType $.RULE("classType", () => { // Spec Deviation: Refactored left recursion and alternation to iterations $.MANY(() => { @@ -116,7 +116,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-InterfaceType + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-InterfaceType $.RULE("interfaceType", () => { $.SUBRULE($.classType); }); @@ -129,7 +129,7 @@ function defineRules($, t) { $.CONSUME(t.Identifier); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-Dims + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-Dims $.RULE("dims", () => { $.MANY(() => { $.SUBRULE($.annotation); @@ -148,7 +148,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-TypeParameter + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-TypeParameter $.RULE("typeParameter", () => { $.MANY(() => { $.SUBRULE($.typeParameterModifier); @@ -159,12 +159,12 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-TypeParameterModifier + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-TypeParameterModifier $.RULE("typeParameterModifier", () => { $.SUBRULE($.annotation); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-TypeBound + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-TypeBound $.RULE("typeBound", () => { $.CONSUME(t.Extends); // Spec Deviation: The alternative with "TypeVariable" is not specified @@ -175,20 +175,20 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-AdditionalBound + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-AdditionalBound $.RULE("additionalBound", () => { $.CONSUME(t.And); $.SUBRULE($.interfaceType); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-TypeArguments + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-TypeArguments $.RULE("typeArguments", () => { $.CONSUME(t.Less); $.SUBRULE($.typeArgumentList); $.CONSUME(t.Greater); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-TypeArgumentList + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-TypeArgumentList $.RULE("typeArgumentList", () => { $.SUBRULE($.typeArgument); $.MANY(() => { @@ -197,7 +197,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-TypeArgument + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-TypeArgument $.RULE("typeArgument", () => { // TODO: performance: evaluate flipping the order of alternatives $.OR([ @@ -209,7 +209,7 @@ function defineRules($, t) { ]); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-Wildcard + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-Wildcard $.RULE("wildcard", () => { $.MANY(() => { $.SUBRULE($.annotation); @@ -220,7 +220,7 @@ function defineRules($, t) { }); }); - // https://docs.oracle.com/javase/specs/jls/se11/html/jls-4.html#jls-WildcardBounds + // https://docs.oracle.com/javase/specs/jls/se16/html/jls-4.html#jls-WildcardBounds $.RULE("wildcardBounds", () => { // TODO: consider in-lining suffix into the alternatives to match the spec more strongly $.OR([