diff --git a/clients/cobol-lsp-vscode-extension/package.json b/clients/cobol-lsp-vscode-extension/package.json index c4e345b3f5..9d12cf01f4 100644 --- a/clients/cobol-lsp-vscode-extension/package.json +++ b/clients/cobol-lsp-vscode-extension/package.json @@ -266,6 +266,9 @@ "items": { "type": "string" }, + "default": [ + "**" + ], "description": "Default list of local paths to search for copybooks", "uniqueItems": true }, diff --git a/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.copybooks.test.ts b/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.copybooks.test.ts index 2d9698706b..ad6e96a0f3 100644 --- a/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.copybooks.test.ts +++ b/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.copybooks.test.ts @@ -171,4 +171,58 @@ suite("Integration Test Suite: Copybooks", function () { }) .timeout(helper.TEST_TIMEOUT) .slow(1000); + + suite("Default copybook configuration", () => { + suite("default configuration - local configuration path not set", () => { + suiteSetup(async () => { + await helper.updateConfig("default.json"); + await helper.activate(); + }); + + test("Local copybooks are resolved from local subfolders if no configuration is provided", async () => { + const editor = await helper.showDocument("USERC1N1.cbl"); + + let diagnostics: vscode.Diagnostic[] = []; + await helper.waitFor(() => { + diagnostics = vscode.languages.getDiagnostics(editor.document.uri); + return ( + diagnostics.length > 0 && + diagnostics.some((d) => d.message === "Errors inside the copybook") + ); + }); + + assert.strictEqual( + diagnostics.filter((d) => d.message === "BOOK1N: Copybook not found") + .length, + 0, + ); + }); + }); + + suite("local copybook path is configured", () => { + suiteSetup(async () => { + await helper.updateConfig("testing.json"); + await helper.activate(); + }); + + test("Only folder from configuration is used for local copybook resolution", async () => { + const editor = await helper.showDocument("USERC1N1.cbl"); + + let diagnostics: vscode.Diagnostic[] = []; + await helper.waitFor(() => { + diagnostics = vscode.languages.getDiagnostics(editor.document.uri); + return ( + diagnostics.length > 0 && + diagnostics.some((d) => d.message === "BOOK1N: Copybook not found") + ); + }); + + assert.strictEqual( + diagnostics.filter((d) => d.message === "BOOK1N: Copybook not found") + .length, + 1, + ); + }); + }); + }); }); diff --git a/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json b/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json index 41ce39dc8f..c9db60fb14 100644 --- a/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json +++ b/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json @@ -30,7 +30,7 @@ ] }, "cics-keywords": { - "match": "(?4.0.0 common org.eclipse.lsp.cobol - 1.0.11 + 1.0.12 8 diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java index b17b06bd58..ec7b1b5f20 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java @@ -52,6 +52,7 @@ public enum NodeType { PARAGRAPH, PARAGRAPH_NAME_NODE, PERFORM, + PERFORM_UNTIL_NODE, PROCEDURE_SECTION, PROCEDURE_RETURNING, PROCEDURE_USING, diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/PerformUntilNode.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/PerformUntilNode.java new file mode 100644 index 0000000000..a43cb70fe5 --- /dev/null +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/PerformUntilNode.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2025 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.common.model.tree; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; +import org.eclipse.lsp.cobol.common.model.Locality; +import org.eclipse.lsp.cobol.common.model.NodeType; + +/** The class represents perform until clause. */ +@ToString(callSuper = true) +@Getter +@EqualsAndHashCode(callSuper = true) +public class PerformUntilNode extends Node { + + private final boolean untilExit; + + public PerformUntilNode(Locality location, boolean untilExit) { + super(location, NodeType.PERFORM_UNTIL_NODE); + this.untilExit = untilExit; + } +} diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/statements/SetToStatement.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/statements/SetToStatement.java new file mode 100644 index 0000000000..b6120688d6 --- /dev/null +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/statements/SetToStatement.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.common.model.tree.statements; + +import lombok.EqualsAndHashCode; +import lombok.Getter; +import org.eclipse.lsp.cobol.common.model.Locality; +import org.eclipse.lsp.cobol.common.model.tree.Node; + +import java.util.List; + +/** This class implements the logic for SET TO statement. */ +@EqualsAndHashCode(callSuper = true) +@Getter +public class SetToStatement extends StatementNode { + boolean address; + List receivingFields; + Node sendingField; + + public SetToStatement(boolean address, Locality locality, List receivingFields, Node sendingField) { + super(locality); + this.address = address; + this.receivingFields = receivingFields; + this.sendingField = sendingField; + } +} diff --git a/server/engine/pom.xml b/server/engine/pom.xml index bd8fd73633..789fd9901b 100644 --- a/server/engine/pom.xml +++ b/server/engine/pom.xml @@ -284,7 +284,7 @@ ${maven.surefire.plugin.version} all - ${argLine} -Dperformance.log.path=${project.build.directory}/perf.csv -javaagent:${org.mockito:mockito-core:jar} + ${argLine} -Dperformance.log.path=${project.build.directory}/perf.csv filesToTestPath diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSLexer.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSLexer.g4 index 4d9746be85..fca35ce5d3 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSLexer.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSLexer.g4 @@ -19,7 +19,7 @@ ABCODE : A B C O D E; ABDUMP : A B D U M P; ABEND : A B E N D; ABENDCODE : A B E N D C O D E; -ABOFFSET: A B O F F S E T; +ABOFFSET : A B O F F S E T; ABORT : A B O R T; ABPROGRAM : A B P R O G R A M; ABSTIME : A B S T I M E; @@ -43,6 +43,8 @@ ACTIONCOUNT : A C T I O N C O U N T; ACTIONTYPE : A C T I O N T Y P E; ACTIVE : A C T I V E; ACTIVITY : A C T I V I T Y; +ACTIVITYBUSY : A C T I V I T Y B U S Y; +ACTIVITYERR : A C T I V I T Y E R R; ACTIVITYID : A C T I V I T Y I D; ACTOPENTCBS : A C T O P E N T C B S; ACTPARTN : A C T P A R T N; @@ -53,6 +55,7 @@ ACTXPTCBS : A C T X P T C B S; ADAPTERTYPE : A D A P T E R T Y P E; ADD : A D D; ADDRESS : A D D R E S S; +ADDRESS64 : A D D R E S S '6' '4'; ADJUSTMENT : A D J U S T M E N T; ADRESS64 : A D R E S S '6' '4'; AFTER : A F T E R; @@ -64,6 +67,7 @@ AKP : A K P; ALARM : A L A R M; ALL : A L L; ALLOCATE : A L L O C A T E; +ALLOCERR : A L L O C E R R; ALTER : A L T E R; ALTERNATE : A L T E R N A T E; ALTPAGEHT : A L T P A G E H T; @@ -76,13 +80,14 @@ ALTSUFFIX : A L T S U F F I X; ANALYZERSTAT : A N A L Y Z E R S T A T; AND : A N D; ANYKEY : A N Y K E Y; +AP : A P; APIST : A P I S T; APLKYBD : A P L K Y B D; APLKYBDST : A P L K Y B D S T; APLTEXT : A P L T E X T; APLTEXTST : A P L T E X T S T; APOST : A P O S T; -APPEND: A P P E N D; +APPEND : A P P E N D; APPENDCRLF : A P P E N D C R L F; APPLDATA : A P P L D A T A; APPLICATION : A P P L I C A T I O N; @@ -91,6 +96,7 @@ APPLMAJORVER : A P P L M A J O R V E R; APPLMICROVER : A P P L M I C R O V E R; APPLMINORVER : A P P L M I N O R V E R; APPLNAMEST : A P P L N A M E S T; +APPNOTFOUND : A P P N O T F O U N D; ARCHIVEFILE : A R C H I V E F I L E; AS : A S; ASA : A S A; @@ -108,6 +114,7 @@ ASRASTG : A S R A S T G; ASSIGN : A S S I G N; ASSOCIATION : A S S O C I A T I O N; ASYNCHRONOUS : A S Y N C H R O N O U S; +ASYNCSERVICE : A S Y N C S E R V I C E; AT : A T; ATIFACILITY : A T I F A C I L I T Y; ATISTATUS : A T I S T A T U S; @@ -122,6 +129,7 @@ ATTACHSEC : A T T A C H S E C; ATTACHTIME : A T T A C H T I M E; ATTLS : A T T L S; ATTRIBUTES : A T T R I B U T E S; +ATTRLEN: A T T R L E N; AUDALARMST : A U D A L A R M S T; AUDITLEVEL : A U D I T L E V E L; AUDITLOG : A U D I T L O G; @@ -139,6 +147,7 @@ AUXSTATUS : A U X S T A T U S; AVAILABILITY : A V A I L A B I L I T Y; AVAILABLE : A V A I L A B L E; AVAILSTATUS : A V A I L S T A T U S; +BA : B A; BACKLOG : B A C K L O G; BACKTRANSST : B A C K T R A N S S T; BACKUPTYPE : B A C K U P T Y P E; @@ -155,8 +164,10 @@ BIT : B I T; BLOCKFORMAT : B L O C K F O R M A T; BLOCKKEYLEN : B L O C K K E Y L E N; BLOCKSIZE : B L O C K S I Z E; +BM : B M; BODYCHARSET : B O D Y C H A R S E T; BOOKMARK : B O O K M A R K; +BR : B R; BRANCHQUAL : B R A N C H Q U A L; BRDATA : B R D A T A; BRDATALENGTH : B R D A T A L E N G T H; @@ -172,7 +183,9 @@ BUNDLE : B U N D L E; BUNDLEDIR : B U N D L E D I R; BUNDLEID : B U N D L E I D; BUNDLEPART : B U N D L E P A R T; -BYTEOFFSET: B Y T E O F F S E T; +BUSAPPMGR : B U S A P P M G R; +BUSY : B U S Y; +BYTEOFFSET : B Y T E O F F S E T; CACHESIZE : C A C H E S I Z E; CADDRLENGTH : C A D D R L E N G T H; CANCEL : C A N C E L; @@ -184,9 +197,11 @@ CAPTUREPTYPE : C A P T U R E P T Y P E; CAPTURESPEC : C A P T U R E S P E C; CARD : C A R D; CAUSE : C A U S E; +CBIDERR : C B I D E R R; CBLCARD : C B L C A R D; CBUFF : C B U F F; CCSID : C C S I D; +CCSIDERR : C C S I D E R R; CDSASIZE : C D S A S I Z E; CEDFSTATUS : C E D F S T A T U S; CERTIFICATE : C E R T I F I C A T E; @@ -194,9 +209,11 @@ CFDTPOOL : C F D T P O O L; CHANGE : C H A N G E; CHANGEAGENT : C H A N G E A G E N T; CHANGEAGREL : C H A N G E A G R E L; +CHANGED : C H A N G E D; CHANGETIME : C H A N G E T I M E; CHANGEUSRID : C H A N G E U S R I D; CHANNEL : C H A N N E L; +CHANNELERR : C H A N N E L E R R; CHAR : C H A R; CHARACTERSET : C H A R A C T E R S E T; CHECK : C H E C K; @@ -205,7 +222,7 @@ CHUNKEND : C H U N K E N D; CHUNKING : C H U N K I N G; CHUNKNO : C H U N K N O; CHUNKYES : C H U N K Y E S; -CICS: C I C S; +CICS : C I C S; CICSDATAKEY : C I C S D A T A K E Y; CICSSTATUS : C I C S S T A T U S; CICSSYS : C I C S S Y S; @@ -224,7 +241,7 @@ CLIENTLOC : C L I E N T L O C; CLIENTNAME : C L I E N T N A M E; CLIENTPORT : C L I E N T P O R T; CLNTADDR6NU : C L N T A D D R '6' N U; -CLNTCODEPAGE: C L N T C O D E P A G E; +CLNTCODEPAGE : C L N T C O D E P A G E; CLNTIPFAMILY : C L N T I P F A M I L Y; CLOSE : C L O S E; CLOSESTATUS : C L O S E S T A T U S; @@ -239,6 +256,7 @@ COBOL2 : C O B O L '2'; COBOL3 : C O B O L '3'; COBOLTYPE : C O B O L T Y P E; CODEPAGE : C O D E P A G E; +CODEPAGEERR : C O D E P A G E E R R; COLDSTATUS : C O L D S T A T U S; COLOR : C O L O R; COLORST : C O L O R S T; @@ -275,7 +293,8 @@ CONSNAME : C O N S N A M E; CONSOLE : C O N S O L E; CONSOLES : C O N S O L E S; CONTAINER : C O N T A I N E R; -CONTAINERCNT: C O N T A I N E R C N T; +CONTAINERCNT : C O N T A I N E R C N T; +CONTAINERERR : C O N T A I N E R E R R; CONTEXTTYPE : C O N T E X T T Y P E; CONTROL : C O N T R O L; CONVDATA : C O N V D A T A; @@ -291,6 +310,8 @@ CORRELID : C O R R E L I D; COUNTER : C O U N T E R; COUNTRY : C O U N T R Y; COUNTRYLEN : C O U N T R Y L E N; +CP : C P; +CPI : C P I; CPSM : C P S M; CQP : C Q P; CREATE : C R E A T E; @@ -298,6 +319,7 @@ CREATESESS : C R E A T E S E S S; CRITICAL : C R I T I C A L; CRITICALST : C R I T I C A L S T; CRLPROFILE : C R L P R O F I L E; +CSDERR : C S D E R R; CTLCHAR : C T L C H A R; CURAUXDS : C U R A U X D S; CURRENT : C U R R E N T; @@ -321,7 +343,6 @@ DATA2 : D A T A '2'; DATABUFFERS : D A T A B U F F E R S; DATAFORMAT : D A T A F O R M A T; DATALENGTH : D A T A L E N G T H; -DATALENTH : D A T A L E N T H; DATALOCATION : D A T A L O C A T I O N; DATAONLY : D A T A O N L Y; DATAPOINTER : D A T A P O I N T E R; @@ -349,21 +370,23 @@ DB2ID : D B '2' I D; DB2PLAN : D B '2' P L A N; DB2RELEASE : D B '2' R E L E A S E; DB2TRAN : D B '2' T R A N; -DBCS : D B C S ; +DBCS : D B C S; +DC : D C; DCOUNTER : D C O U N T E R; DCT : D C T; +DD : D D; DDMMYY : D D M M Y Y; DDMMYYYY : D D M M Y Y Y Y; DDNAME : D D N A M E; DEBKEY : D E B K E Y; DEBREC : D E B R E C; -DEBUG : D E B U G ; +DEBUG : D E B U G; DEBUGTOOL : D E B U G T O O L; DEEDIT : D E E D I T; DEFAULT : D E F A U L T; DEFINE : D E F I N E; -DEFINESOURCE: DEFINE S O U R C E; -DEFINETIME: DEFINE T I M E; +DEFINESOURCE : DEFINE S O U R C E; +DEFINETIME : DEFINE T I M E; DEFPAGEHT : D E F P A G E H T; DEFPAGEWD : D E F P A G E W D; DEFRESP : D E F R E S P; @@ -384,8 +407,11 @@ DEVICE : D E V I C E; DFHRESP : D F H R E S P; DFHVALUE : D F H V A L U E; DFLTUSER : D F L T U S E R; +DH : D H; DIGEST : D I G E S T; DIGESTTYPE : D I G E S T T Y P E; +DIRMGR : D I R M G R; +DISABLED : D I S A B L E D; DISABLEDACT : D I S A B L E D A C T; DISCARD : D I S C A R D; DISCONNECT : D I S C O N N E C T; @@ -394,6 +420,7 @@ DISPATCHABLE : D I S P A T C H A B L E; DISPATCHER : D I S P A T C H E R; DISPOSITION : D I S P O S I T I O N; DLI : D L I; +DM : D M; DNAME : D N A M E; DNAMELEN : D N A M E L E N; DOCDELETE : D O C D E L E T E; @@ -402,8 +429,11 @@ DOCSTATUS : D O C S T A T U S; DOCTEMPLATE : D O C T E M P L A T E; DOCTOKEN : D O C T O K E N; DOCUMENT : D O C U M E N T; +DOMAINMGR : D O M A I N M G R; +DP : D P; DPLLIMIT : D P L L I M I T; DROLLBACK : D R O L L B A C K; +DS : D S; DS3270 : D S '3' '2' '7' '0'; DSALIMIT : D S A L I M I T; DSANAME : D S A N A M E; @@ -425,11 +455,14 @@ DSNAME14 : D S N A M E '1' '4'; DSNAME15 : D S N A M E '1' '5'; DSNAME16 : D S N A M E '1' '6'; DSNAMELIST : D S N A M E L I S T; +DSNNOTFOUND : D S N N O T F O U N D; DSPLIST : D S P L I S T; DSRTPROGRAM : D S R T P R O G R A M; DSSCS : D S S C S; +DSSTAT : D S S T A T; DTIMEOUT : D T I M E O U T; DTRPROGRAM : D T R P R O G R A M; +DU : D U; DUALCASEST : D U A L C A S E S T; DUMP : D U M P; DUMPCODE : D U M P C O D E; @@ -437,15 +470,20 @@ DUMPDS : D U M P D S; DUMPID : D U M P I D; DUMPING : D U M P I N G; DUMPSCOPE : D U M P S C O P E; +DUPKEY : D U P K E Y; DUPREC : D U P R E C; +DUPRES : D U P R E S; DURATION : D U R A T I O N; DYNAMSTATUS : D Y N A M S T A T U S; +EC : E C; ECADDR : E C A D D R; ECBLIST : E C B L I S T; ECDSASIZE : E C D S A S I Z E; EDF : E D F; EDSALIMIT : E D S A L I M I T; +EI : E I; EIB : E I B; +EJ : E J; ELEMENT : E L E M E N T; ELEMENT64 : E L E M E N T '6' '4'; ELEMENTLIST : E L E M E N T L I S T; @@ -453,6 +491,7 @@ ELEMNAME : E L E M N A M E; ELEMNAMELEN : E L E M N A M E L E N; ELEMNS : E L E M N S; ELEMNSLEN : E L E M N S L E N; +EM : E M; EMITMODE : E M I T M O D E; EMPTYSTATUS : E M P T Y S T A T U S; ENABLEDCOUNT : E N A B L E D C O U N T; @@ -462,25 +501,33 @@ END : E N D; ENDACTIVITY : E N D A C T I V I T Y; ENDBR : E N D B R; ENDBROWSE : E N D B R O W S E; +ENDDATA : E N D D A T A; ENDFILE : E N D F I L E; +ENDINPT : E N D I N P T; ENDOFDAY : E N D O F D A Y; ENDOFDAYHRS : E N D O F D A Y H R S; ENDOFDAYMINS : E N D O F D A Y M I N S; ENDOFDAYSECS : E N D O F D A Y S E C S; ENDOUTPUT : E N D O U T P U T; ENDPOINT : E N D P O I N T; -END_EXEC: E N D MINUSCHAR E X E C; +END_EXEC : E N D MINUSCHAR E X E C; ENQ : E N Q; +ENQBUSY : E N Q B U S Y; ENQFAILS : E N Q F A I L S; ENQMODEL : E N Q M O D E L; ENQNAME : E N Q N A M E; ENQSCOPE : E N Q S C O P E; +ENQUEUE : E N Q U E U E; ENTER : E N T E R; +ENTJAVA : E N T J A V A; ENTRY : E N T R Y; ENTRYNAME : E N T R Y N A M E; ENTRYPOINT : E N T R Y P O I N T; +ENVDEFERR : E N V D E F E R R; EOC : E O C; EODS : E O D S; +EOF_TOKEN : E O F; +EP : E P; EPADAPTER : E P A D A P T E R; EPADAPTERNUM : E P A D A P T E R N U M; EPADAPTERRES : E P A D A P T E R R E S; @@ -500,8 +547,8 @@ ERASE : E R A S E; ERASEAUP : E R A S E A U P; ERDSASIZE : E R D S A S I Z E; ERROR : E R R O R; -ERRORMSG: E R R O R M S G; -ERRORMSGLEN: E R R O R M S G L E N; +ERRORMSG : E R R O R M S G; +ERRORMSGLEN : E R R O R M S G L E N; ERROROPTION : E R R O R O P T I O N; ERRTERM : E R R T E R M; ESDSASIZE : E S D S A S I Z E; @@ -510,7 +557,11 @@ ESMRESP : E S M R E S P; EUDSASIZE : E U D S A S I Z E; EVENT : E V E N T; EVENTBINDING : E V E N T B I N D I N G; +EVENTCAPTURE : E V E N T C A P T U R E; +EVENTERR : E V E N T E R R; +EVENTMGR : E V E N T M G R; EVENTNAME : E V E N T N A M E; +EVENTPROC : E V E N T P R O C; EVENTPROCESS : E V E N T P R O C E S S; EVENTTYPE : E V E N T T Y P E; EVENTUAL : E V E N T U A L; @@ -520,16 +571,17 @@ EXCEPTCLASS : E X C E P T C L A S S; EXCEPTION : E X C E P T I O N; EXCI : E X C I; EXCLUSIVE : E X C L U S I V E; -EXEC: E X E C; +EXEC : E X E C; EXECKEY : E X E C K E Y; EXECUTABLE : E X E C U T A B L E; EXECUTIONSET : E X E C U T I O N S E T; -EXEC_CICS: E X E C [ \t\f\r\n]+ C I C S; +EXEC_CICS : E X E C [ \t\f\r\n]+ C I C S; EXIT : E X I T; EXITPGM : E X I T P G M; EXITPROGRAM : E X I T P R O G R A M; EXITTRACING : E X I T T R A C I N G; EXPECT : E X P E C T; +EXPIRED : E X P I R E D; EXPIRYINT : E X P I R Y I N T; EXPIRYINTMIN : E X P I R Y I N T M I N; EXPIRYTIME : E X P I R Y T I M E; @@ -552,6 +604,7 @@ FAULTCODELEN : F A U L T C O D E L E N; FAULTCODESTR : F A U L T C O D E S T R; FAULTSTRING : F A U L T S T R I N G; FAULTSTRLEN : F A U L T S T R L E N; +FC : F C; FCI : F C I; FCT : F C T; FEATUREKEY : F E A T U R E K E Y; @@ -563,10 +616,11 @@ FILE : F I L E; FILECOUNT : F I L E C O U N T; FILELIMIT : F I L E L I M I T; FILENAME : F I L E N A M E; +FILENOTFOUND : F I L E N O T F O U N D; FILEPATH : F I L E P A T H; FILTERVALUE : F I L T E R V A L U E; FIRESTATUS : F I R E S T A T U S; -FLAG: F L A G; +FLAG : F L A G; FLAGSET : F L A G S E T; FLENGTH : F L E N G T H; FMH : F M H; @@ -600,6 +654,7 @@ FROMLENGTH : F R O M L E N G T H; FROMPROCESS : F R O M P R O C E S S; FRSET : F R S E T; FULLDATE : F U L L D A T E; +FUNCERR : F U N C E R R; FUNCTION : F U N C T I O N; FWDRECOVLOG : F W D R E C O V L O G; FWDRECOVLSN : F W D R E C O V L S N; @@ -609,6 +664,8 @@ GAENTRYNAME : G A E N T R Y N A M E; GALENGTH : G A L E N G T H; GARBAGEINT : G A R B A G E I N T; GAUSECOUNT : G A U S E C O U N T; +GASET : G A S E T; +GC : G C; GCDSASIZE : G C D S A S I Z E; GCHARS : G C H A R S; GCODES : G C O D E S; @@ -618,8 +675,9 @@ GENERIC : G E N E R I C; GENERICTCPS : G E N E R I C T C P S; GET : G E T; GETMAIN : G E T M A I N; -GETMAIN64: G E T M A I N '6' '4'; +GETMAIN64 : G E T M A I N '6' '4'; GETNEXT : G E T N E X T; +GLOBALCATLG : G L O B A L C A T L G; GMEXITOPT : G M E X I T O P T; GMMI : G M M I; GMMLENGTH : G M M L E N G T H; @@ -660,6 +718,7 @@ HTTPMETHOD : H T T P M E T H O D; HTTPRNUM : H T T P R N U M; HTTPVERSION : H T T P V E R S I O N; HTTPVNUM : H T T P V N U M; +IC : I C; IDENTIFIER : I D E N T I F I E R; IDLE : I D L E; IDLEHRS : I D L E H R S; @@ -667,9 +726,15 @@ IDLEMINS : I D L E M I N S; IDLESECS : I D L E S E C S; IDNTYCLASS : I D N T Y C L A S S; IDPROP : I D P R O P; +IE : I E; IGNORE : I G N O R E; +IGREQCD : I G R E Q C D; +IGREQID : I G R E Q I D; +ILLOGIC : I L L O G I C; IMMEDIATE : I M M E D I A T E; IN : I N; +INBFMH : I N B F M H; +INCOMPLETE : I N C O M P L E T E; INCREMENT : I N C R E M E N T; INDIRECTNAME : I N D I R E C T N A M E; INDOUBT : I N D O U B T; @@ -704,16 +769,23 @@ INTOCCSID : I N T O C C S I D; INTOCODEPAGE : I N T O C O D E P A G E; INTSTATUS : I N T S T A T U S; INVALIDCOUNT : I N V A L I D C O U N T; +INVERRTERM : I N V E R R T E R M; +INVEXITREQ : I N V E X I T R E Q; INVITE : I N V I T E; +INVLDC : I N V L D C; INVMPSZ : I N V M P S Z; INVOKE : I N V O K E; INVOKETYPE : I N V O K E T Y P E; INVOKINGPROG : I N V O K I N G P R O G; -INVPARTN: I N V P A R T N; -INVREQ: I N V R E Q; +INVPARTN : I N V P A R T N; +INVPARTNSET : I N V P A R T N S E T; +INVREQ : I N V R E Q; +INVTSREQ : I N V T S R E Q; +IOERR : I O E R R; IOTYPE : I O T Y P E; IPADDRESS : I P A D D R E S S; IPCONN : I P C O N N; +IPECI : I P E C I; IPFACILITIES : I P F A C I L I T I E S; IPFACILITY : I P F A C I L I T Y; IPFACILTYPE : I P F A C I L T Y P E; @@ -721,16 +793,20 @@ IPFAMILY : I P F A M I L Y; IPFLISTSIZE : I P F L I S T S I Z E; IPRESOLVED : I P R E S O L V E D; IRC : I R C; +IS : I S; +ISCINVREQ : I S C I N V R E Q; ISOLATEST : I S O L A T E S T; ISSUE : I S S U E; ISSUER : I S S U E R; ISUSERID : I S U S E R I D; ITEM : I T E M; +ITEMERR : I T E M E R R; ITEMNAME : I T E M N A M E; IUTYPE : I U T Y P E; I_CHAR : I; JAVAHOME : J A V A H O M E; JCT : J C T; +JIDERR : J I D E R R; JOBLIST : J O B L I S T; JOBNAME : J O B N A M E; JOURNALMODEL : J O U R N A L M O D E L; @@ -743,13 +819,17 @@ JUSTIFY : J U S T I F Y; JVMCLASS : J V M C L A S S; JVMENDPOINT : J V M E N D P O I N T; JVMPROFILE : J V M P R O F I L E; +JVMPROGRAM : J V M P R O G R A M; JVMSERVER : J V M S E R V E R; JWT : J W T; KATAKANA : K A T A K A N A; KATAKANAST : K A T A K A N A S T; +KC : K C; +KE : K E; KEEP : K E E P; KEEPTIME : K E E P T I M E; KERBEROS : K E R B E R O S; +KERNEL : K E R N E L; KEYLENGTH : K E Y L E N G T H; KEYNUMBER : K E Y N U M B E R; KEYPOSITION : K E Y P O S I T I O N; @@ -767,20 +847,29 @@ LASTCOLDTIME : L A S T C O L D T I M E; LASTEMERTIME : L A S T E M E R T I M E; LASTINITTIME : L A S T I N I T T I M E; LASTMODTIME : L A S T M O D T I M E; +LASTRESET : L A S T R E S E T; +LASTRESETABS : L A S T R E S E T A B S; +LASTRESETHRS : L A S T R E S E T H R S; +LASTRESETMIN : L A S T R E S E T M I N; +LASTRESETSEC : L A S T R E S E T S E C; +LASTSECDTIME : L A S T S E C D T I M E; LASTUSEDINT : L A S T U S E D I N T; LASTUSETIME : L A S T U S E T I M E; LASTWARMTIME : L A S T W A R M T I M E; LASTWRITTIME : L A S T W R I T T I M E; LATSECDTIME : L A T S E C D T I M E; LC : L C; +LD : L D; LDC : L D C; LDCMNEM : L D C M N E M; LDCNUM : L D C N U M; LEAVEKB : L E A V E K B; +LENGERR : L E N G E R R; LENGTH : L E N G T H; LENGTHLIST : L E N G T H L I S T; LERUNOPTS : L E R U N O P T S; LEVEL : L E V E L; +LG : L G; LIBRARY : L I B R A R Y; LIBRARYDSN : L I B R A R Y D S N; LIGHTPEN : L I G H T P E N; @@ -790,6 +879,7 @@ LINE : L I N E; LINEADDR : L I N E A D D R; LINECOUNT : L I N E C O U N T; LINK : L I N K; +LINKABEND : L I N K A B E N D; LINKAGE : L I N K A G E; LINKAUTH : L I N K A U T H; LINKLEVEL : L I N K L E V E L; @@ -799,15 +889,22 @@ LIST : L I S T; LISTLENGTH : L I S T L E N G T H; LISTSIZE : L I S T S I Z E; LLID : L L I D; +LM : L M; LOAD : L O A D; +LOADER : L O A D E R; +LOADING : L O A D I N G; LOADPOINT : L O A D P O I N T; LOADTYPE : L O A D T Y P E; +LOCALCATLG : L O C A L C A T L G; LOCALCCSID : L O C A L C C S I D; LOCALITY : L O C A L I T Y; LOCALITYLEN : L O C A L I T Y L E N; LOCATION : L O C A T I O N; +LOCKED : L O C K E D; +LOCKMGR : L O C K M G R; LOG : L O G; LOGDEFER : L O G D E F E R; +LOGGER : L O G G E R; LOGMESSAGE : L O G M E S S A G E; LOGMODE : L O G M O D E; LOGONLOGMODE : L O G O N L O G M O D E; @@ -817,13 +914,15 @@ LOSTLOCKS : L O S T L O C K S; LOW_VALUE : L O W MINUSCHAR V A L U E; LOW_VALUES : L O W MINUSCHAR V A L U E S; LPASTATUS : L P A S T A T U S; +LSRPOOL : L S R P O O L; LSRPOOLNUM : L S R P O O L N U M; LUNAME : L U N A M E; MAIN : M A I N; MAJORVERSION : M A J O R V E R S I O N; +MANAGEDPLAT : M A N A G E D P L A T; MAP : M A P; MAPCOLUMN : M A P C O L U M N; -MAPFAIL: M A P F A I L; +MAPFAIL : M A P F A I L; MAPHEIGHT : M A P H E I G H T; MAPLINE : M A P L I N E; MAPNAME : M A P N A M E; @@ -858,6 +957,7 @@ MAXTHRDTCBS : M A X T H R D T C B S; MAXWINNERS : M A X W I N N E R S; MAXXPTCBS : M A X X P T C B S; MCC : M C C; +ME : M E; MEDIATYPE : M E D I A T Y P E; MEMBER : M E M B E R; MEMBERNAME : M E M B E R N A M E; @@ -873,7 +973,7 @@ METHODLENGTH : M E T H O D L E N G T H; MGMTPART : M G M T P A R T; MICROVERSION : M I C R O V E R S I O N; MILLISECONDS : M I L L I S E C O N D S; -MILLISECS: M I L L I S E C S; +MILLISECS : M I L L I S E C S; MINIMUM : M I N I M U M; MINITEMLEN : M I N I T E M L E N; MINORVERSION : M I N O R V E R S I O N; @@ -882,9 +982,12 @@ MINRUNRNUM : M I N R U N R N U M; MINRUNVNUM : M I N R U N V N U M; MINUTES : M I N U T E S; MIRRORLIFE : M I R R O R L I F E; +ML : M L; MMDDYY : M M D D Y Y; MMDDYYYY : M M D D Y Y Y Y; +MN : M N; MODE : M O D E; +MODELIDERR : M O D E L I D E R R; MODENAME : M O D E N A M E; MONDATA : M O N D A T A; MONITOR : M O N I T O R; @@ -893,6 +996,7 @@ MONTH : M O N T H; MONTHOFYEAR : M O N T H O F Y E A R; MONUSERID : M O N U S E R I D; MOVE : M O V E; +MP : M P; MQCONN : M Q C O N N; MQINI : M Q I N I; MQMONITOR : M Q M O N I T O R; @@ -921,6 +1025,7 @@ NATLANGINUSE : N A T L A N G I N U S E; NATURE : N A T U R E; NETID : N E T I D; NETNAME : N E T N A M E; +NETNAMEIDERR : N E T N A M E I D E R R; NETUOWID : N E T U O W I D; NETWORK : N E T W O R K; NETWORKID : N E T W O R K I D; @@ -946,6 +1051,7 @@ NODATA : N O D A T A; NODE : N O D E; NODEBUG : N O D E B U G; NODEHOME : N O D E H O M E; +NODEIDERR : N O D E I D E R R; NODEJSAPP : N O D E J S A P P; NODOCDELETE : N O D O C D E L E T E; NODUMP : N O D U M P; @@ -955,24 +1061,41 @@ NOFEPI : N O F E P I; NOFLUSH : N O F L U S H; NOHANDLE : N O H A N D L E; NOINCONVERT : N O I N C O N V E R T; +NOJBUFSP : N O J B U F S P; NOLENGTH : N O L E N G T H; NOLINKAGE : N O L I N K A G E; +NOLOG: N O L O G; NONE : N O N E; NONTERMREL : N O N T E R M R E L; NONUM : N O N U M; +NONVAL : N O N V A L; NOOPTIONS : N O O P T I O N S; NOOUTCONVERT : N O O U T C O N V E R T; +NOPASSBKRD : N O P A S S B K R D; +NOPASSBKWR : N O P A S S B K W R; NOQUEUE : N O Q U E U E; NOQUIESCE : N O Q U I E S C E; +NORMAL : N O R M A L; NOSEQ : N O S E Q; +NOSPACE : N O S P A C E; NOSPIE : N O S P I E; +NOSPOOL : N O S P O O L; NOSRVCONVERT : N O S R V C O N V E R T; +NOSTART : N O S T A R T; +NOSTG : N O S T G; NOSUSPEND : N O S U S P E N D; +NOTALLOC : N O T A L L O C; +NOTAUTH : N O T A U T H; NOTE : N O T E; +NOTFINISHED : N O T F I N I S H E D; +NOTFND : N O T F N D; +NOTOPEN : N O T O P E N; NOTPURGEABLE : N O T P U R G E A B L E; NOTRUNCATE : N O T R U N C A T E; +NOTSUPERUSER : N O T S U P E R U S E R; NOVBREF : N O V B R E F; NOWAIT : N O W A I T; +NQ : N Q; NQNAME : N Q N A M E; NSCONTAINER : N S C O N T A I N E R; NULL : N U L L; @@ -980,6 +1103,7 @@ NULLS : N U L L S; NUM : N U M; NUMCIPHERS : N U M C I P H E R S; NUMDATAPRD : N U M D A T A P R D; +NUMDATAPRED : N U M D A T A P R E D; NUMDSNAMES : N U M D S N A M E S; NUMELEMENTS : N U M E L E M E N T S; NUMEVENTS : N U M E V E N T S; @@ -993,6 +1117,7 @@ NUMSEGMENTS : N U M S E G M E N T S; NUMTAB : N U M T A B; OBFORMATST : O B F O R M A T S T; OBJECT : O B J E C T; +OBJECTTRAN : O B J E C T T R A N; OBOPERIDST : O B O P E R I D S T; OCCUPANCY : O C C U P A N C Y; ODADPTRDATA1 : O D A D P T R D A T A '1'; @@ -1019,6 +1144,7 @@ OIDCARD : O I D C A R D; ON : O N; OPCLASS : O P C L A S S; OPEN : O P E N; +OPENERR : O P E N E R R; OPENSTATUS : O P E N S T A T U S; OPERATION : O P E R A T I O N; OPERATOR : O P E R A T O R; @@ -1044,19 +1170,23 @@ OSGISERVICE : O S G I S E R V I C E; OSGISTATUS : O S G I S T A T U S; OSGIVERSION : O S G I V E R S I O N; OSLEVEL : O S L E V E L; +OT : O T; OTSTID : O T S T I D; OTSTIMEOUT : O T S T I M E O U T; OUTDESCR : O U T D E S C R; +OUTDESCRERR : O U T D E S C R E R R; OUTLINE : O U T L I N E; OUTLINEST : O U T L I N E S T; OUTPARTN : O U T P A R T N; OUTPUT : O U T P U T; OUTTOKEN : O U T T O K E N; OUTTOKENLEN : O U T T O K E N L E N; +OVERFLOW : O V E R F L O W; OWNER : O W N E R; -PA1: P A '1'; -PA2: P A '2'; -PA3: P A '3'; +PA : P A; +PA1 : P A '1'; +PA2 : P A '2'; +PA3 : P A '3'; PAGE : P A G E; PAGEHT : P A G E H T; PAGENUM : P A G E N U M; @@ -1064,13 +1194,16 @@ PAGESTATUS : P A G E S T A T U S; PAGEWD : P A G E W D; PAGE_COUNTER : P A G E MINUSCHAR C O U N T E R; PAGING : P A G I N G; +PARAMGR : P A R A M G R; PARSE : P A R S E; PARTCLASS : P A R T C L A S S; PARTCOUNT : P A R T C O U N T; +PARTITIONSET: P A R T I T I O N S E T; PARTITIONSST : P A R T I T I O N S S T; -PARTN: P A R T N; +PARTN : P A R T N; PARTNER : P A R T N E R; -PARTNFAIL: P A R T N F A I L; +PARTNERIDERR : P A R T N E R I D E R R; +PARTNFAIL : P A R T N F A I L; PARTNPAGE : P A R T N P A G E; PARTNS : P A R T N S; PARTNSET : P A R T N S E T; @@ -1079,22 +1212,15 @@ PASS : P A S S; PASSBK : P A S S B K; PASSWORD : P A S S W O R D; PASSWORDLEN : P A S S W O R D L E N; -PATCH: P A T C H; +PATCH : P A T C H; PATH : P A T H; PATHLENGTH : P A T H L E N G T H; +PC : P C; PCDSASIZE : P C D S A S I Z E; PCT : P C T; PENDSTATUS : P E N D S T A T U S; PERFCLASS : P E R F C L A S S; PF1 : P F '1'; -PF2 : P F '2'; -PF3 : P F '3'; -PF4 : P F '4'; -PF5 : P F '5'; -PF6 : P F '6'; -PF7 : P F '7'; -PF8 : P F '8'; -PF9 : P F '9'; PF10 : P F '10'; PF11 : P F '11'; PF12 : P F '12'; @@ -1105,12 +1231,22 @@ PF16 : P F '16'; PF17 : P F '17'; PF18 : P F '18'; PF19 : P F '19'; +PF2 : P F '2'; PF20 : P F '20'; PF21 : P F '21'; PF22 : P F '22'; PF23 : P F '23'; PF24 : P F '24'; +PF3 : P F '3'; +PF4 : P F '4'; +PF5 : P F '5'; +PF6 : P F '6'; +PF7 : P F '7'; +PF8 : P F '8'; +PF9 : P F '9'; PFXLENG : P F X L E N G; +PG : P G; +PGMIDERR : P G M I D E R R; PGMINTERFACE : P G M I N T E R F A C E; PHAPPLID : P H A P P L I D; PHCOUNT : P H C O U N T; @@ -1120,8 +1256,10 @@ PHRASELEN : P H R A S E L E N; PHSTARTTIME : P H S T A R T T I M E; PHTASKID : P H T A S K I D; PHTRANSID : P H T R A N S I D; +PI : P I; PID : P I D; PIPELINE : P I P E L I N E; +PIPEMGR : P I P E M G R; PIPLENGTH : P I P L E N G T H; PIPLIST : P I P L I S T; PLAN : P L A N; @@ -1132,6 +1270,7 @@ POINT : P O I N T; POLICY : P O L I C Y; POLICYRULE : P O L I C Y R U L E; POOL : P O O L; +POOLERR : P O O L E R R; POOLNAME : P O O L N A M E; POP : P O P; PORT : P O R T; @@ -1154,15 +1293,21 @@ PRINTER : P R I N T E R; PRIORITY : P R I O R I T Y; PRIVACY : P R I V A C Y; PROCESS : P R O C E S S; +PROCESSBUSY : P R O C E S S B U S Y; +PROCESSERR : P R O C E S S E R R; PROCESSTYPE : P R O C E S S T Y P E; PROCLENGTH : P R O C L E N G T H; PROCNAME : P R O C N A M E; PROFILE : P R O F I L E; PROFILEDIR : P R O F I L E D I R; +PROFILEIDERR : P R O F I L E I D E R R; +PROGAUTO : P R O G A U T O; PROGAUTOCTLG : P R O G A U T O C T L G; PROGAUTOEXIT : P R O G A U T O E X I T; PROGAUTOINST : P R O G A U T O I N S T; +PROGMGR : P R O G M G R; PROGRAM : P R O G R A M; +PROGRAMDEF : P R O G R A M D E F; PROGSYMBOLST : P R O G S Y M B O L S T; PROGTYPE : P R O G T Y P E; PROTECT : P R O T E C T; @@ -1170,13 +1315,14 @@ PROTECTNUM : P R O T E C T N U M; PROTOCOL : P R O T O C O L; PRTCOPYST : P R T C O P Y S T; PRTYAGING : P R T Y A G I N G; -PS: P S; +PS : P S; PSB : P S B; PSDINTERVAL : P S D I N T E R V A L; PSDINTHRS : P S D I N T H R S; PSDINTMINS : P S D I N T M I N S; PSDINTSECS : P S D I N T S E C S; PSTYPE : P S T Y P E; +PT : P T; PTCOUNT : P T C O U N T; PTHREADS : P T H R E A D S; PTSTARTTIME : P T S T A R T T I M E; @@ -1194,6 +1340,8 @@ PURGECYCLES : P U R G E C Y C L E S; PURGETHRESH : P U R G E T H R E S H; PUSH : P U S H; PUT : P U T; +QBUSY : Q B U S Y; +QIDERR : Q I D E R R; QNAME : Q N A M E; QUALIFIER : Q U A L I F I E R; QUALLEN : Q U A L L E N; @@ -1208,6 +1356,8 @@ QUEUELIMIT : Q U E U E L I M I T; QUIESCESTATE : Q U I E S C E S T A T E; QUOTE : Q U O T E; QUOTES : Q U O T E S; +QZERO : Q Z E R O; +RA : R A; RANDOM : R A N D O M; RANKING : R A N K I N G; RBA : R B A; @@ -1229,17 +1379,20 @@ RECEIVECOUNT : R E C E I V E C O U N T; RECEIVER : R E C E I V E R; RECFM : R E C F M; RECORD : R E C O R D; +RECORDBUSY : R E C O R D B U S Y; RECORDFORMAT : R E C O R D F O R M A T; RECORDING : R E C O R D I N G; RECORDLEN : R E C O R D L E N; RECORDLENGTH : R E C O R D L E N G T H; RECORDSIZE : R E C O R D S I Z E; +RECOVERY : R E C O V E R Y; RECOVSTATUS : R E C O V S T A T U S; REDIRECTTYPE : R E D I R E C T T Y P E; REDUCE : R E D U C E; REENTPROTECT : R E E N T P R O T E C T; REFPARMS : R E F P A R M S; REFPARMSLEN : R E F P A R M S L E N; +REGIONSTAT : R E G I O N S T A T; REGIONUSERID : R E G I O N U S E R I D; RELATESINDEX : R E L A T E S I N D E X; RELATESTYPE : R E L A T E S T Y P E; @@ -1262,6 +1415,7 @@ REPLY : R E P L Y; REPLYLENGTH : R E P L Y L E N G T H; REQID : R E Q I D; REQTYPE : R E Q T Y P E; +REQUESTSTRM : R E Q U E S T S T R M; REQUESTTYPE : R E Q U E S T T Y P E; RES : R E S; RESCLASS : R E S C L A S S; @@ -1270,8 +1424,11 @@ RESET : R E S E T; RESETBR : R E S E T B R; RESID : R E S I D; RESIDENCY : R E S I D E N C Y; +RESIDERR : R E S I D E R R; +RESIDLEN : R E S I D L E N; RESIDLENGTH : R E S I D L E N G T H; RESLEN : R E S L E N; +RESLIFEMGR : R E S L I F E M G R; RESNAME : R E S N A M E; RESOURCE : R E S O U R C E; RESOURCENAME : R E S O U R C E N A M E; @@ -1285,6 +1442,7 @@ RESTART : R E S T A R T; RESTYPE : R E S T Y P E; RESULT : R E S U L T; RESUME : R E S U M E; +RESUNAVAIL : R E S U N A V A I L; RESYNCMEMBER : R E S Y N C M E M B E R; RESYNCNUMBER : R E S Y N C N U M B E R; RESYNCSTATUS : R E S Y N C S T A T U S; @@ -1292,6 +1450,7 @@ RETAIN : R E T A I N; RETCODE : R E T C O D E; RETCORD : R E T C O R D; RETLOCKS : R E T L O C K S; +RETPAGE : R E T P A G E; RETRIECE : R E T R I E C E; RETRIEVE : R E T R I E V E; RETURN : R E T U R N; @@ -1299,14 +1458,20 @@ RETURNPROG : R E T U R N P R O G; REUSELIMIT : R E U S E L I M I T; REWIND : R E W I N D; REWRITE : R E W R I T E; +RI : R I; RIDFLD : R I D F L D; +RL : R L; RLSACCESS : R L S A C C E S S; RLSSTATUS : R L S S T A T U S; +RM : R M; +RMI : R M I; +RMIADAPTERS : R M I A D A P T E R S; RMIQFY : R M I Q F Y; RMIST : R M I S T; ROLE : R O L E; ROLELENGTH : R O L E L E N G T H; ROLLBACK : R O L L B A C K; +ROLLEDBACK : R O L L E D B A C K; ROUTE : R O U T E; ROUTECODES : R O U T E C O D E S; ROUTESTATUS : R O U T E S T A T U S; @@ -1315,7 +1480,11 @@ RPROCESS : R P R O C E S S; RRESOURCE : R R E S O U R C E; RRMS : R R M S; RRN : R R N; +RRS : R R S; +RS : R S; +RTEFAIL : R T E F A I L; RTERMID : R T E R M I D; +RTESOME : R T E S O M E; RTIMEOUT : R T I M E O U T; RTRANSID : R T R A N S I D; RULEGROUP : R U L E G R O U P; @@ -1327,8 +1496,12 @@ RUNAWAYTYPE : R U N A W A Y T Y P E; RUNNING : R U N N I N G; RUNSTATUS : R U N S T A T U S; RUNTIME : R U N T I M E; +RX : R X; +RZ : R Z; SADDRLENGTH : S A D D R L E N G T H; +SC : S C; SCANDELAY : S C A N D E L A Y; +SCHEDULER : S C H E D U L E R; SCHEMALEVEL : S C H E M A L E V E L; SCHEME : S C H E M E; SCHEMENAME : S C H E M E N A M E; @@ -1350,7 +1523,9 @@ SECURITY : S E C U R I T Y; SECURITYMGR : S E C U R I T Y M G R; SECURITYNAME : S E C U R I T Y N A M E; SECURITYST : S E C U R I T Y S T; +SEGIDERR : S E G I D E R R; SEGMENTLIST : S E G M E N T L I S T; +SELNERR : S E L N E R R; SEND : S E N D; SENDCOUNT : S E N D C O U N T; SENDER : S E N D E R; @@ -1367,11 +1542,15 @@ SERVERNAME : S E R V E R N A M E; SERVERPORT : S E R V E R P O R T; SERVICE : S E R V I C E; SERVSTATUS : S E R V S T A T U S; +SESSBUSY : S E S S B U S Y; SESSION : S E S S I O N; +SESSIONERR : S E S S I O N E R R; +SESSIONS: S E S S I O N S; SESSIONTYPE : S E S S I O N T Y P E; SESSTOKEN : S E S S T O K E N; SET : S E T; SETTRANSID : S E T T R A N S I D; +SH : S H; SHARED : S H A R E D; SHARELOCKS : S H A R E L O C K S; SHARESTATUS : S H A R E S T A T U S; @@ -1388,12 +1567,17 @@ SIGNON : S I G N O N; SIGNONSTATUS : S I G N O N S T A T U S; SINGLESTATUS : S I N G L E S T A T U S; SIT : S I T; +SJ : S J; +SJVM : S J V M; +SM : S M; SNAMELENGTH : S N A M E L E N G T H; +SO : S O; SOAPFAULT : S O A P F A U L T; SOAPLEVEL : S O A P L E V E L; SOAPRNUM : S O A P R N U M; SOAPVNUM : S O A P V N U M; SOCKETCLOSE : S O C K E T C L O S E; +SOCKETS : S O C K E T S; SOCKPOOLSIZE : S O C K P O O L S I Z E; SOSABOVEBAR : S O S A B O V E B A R; SOSABOVELINE : S O S A B O V E L I N E; @@ -1408,6 +1592,8 @@ SPECIAL : S P E C I A L; SPECIFTCPS : S P E C I F T C P S; SPIE : S P I E; SPIST : S P I S T; +SPOLBUSY : S P O L B U S Y; +SPOLERR : S P O L E R R; SPOOLCLOSE : S P O O L C L O S E; SPOOLOPEN : S P O O L O P E N; SPOOLREAD : S P O O L R E A D; @@ -1421,6 +1607,7 @@ SRVRADDR6NU : S R V R A D D R '6' N U; SRVRIPFAMILY : S R V R I P F A M I L Y; SSLCACHE : S S L C A C H E; SSLTYPE : S S L T Y P E; +ST : S T; STANDARD : S T A N D A R D; STANDBYMODE : S T A N D B Y M O D E; START : S T A R T; @@ -1436,6 +1623,7 @@ STATE : S T A T E; STATELEN : S T A T E L E N; STATIONID : S T A T I O N I D; STATISTICS : S T A T I S T I C S; +STATS : S T A T S; STATSQUEUE : S T A T S Q U E U E; STATUS : S T A T U S; STATUSCODE : S T A T U S C O D E; @@ -1448,10 +1636,11 @@ STORAGE64 : S T O R A G E '6' '4'; STORAGECLEAR : S T O R A G E C L E A R; STOREPROTECT : S T O R E P R O T E C T; STREAMNAME : S T R E A M N A M E; +STRELERR : S T R E L E R R; STRFIELD : S T R F I E L D; STRINGFORMAT : S T R I N G F O R M A T; -STRINGZONE: S T R I N G Z O N E; STRINGS : S T R I N G S; +STRINGZONE : S T R I N G Z O N E; STRUCTNAME : S T R U C T N A M E; SUBADDR : S U B A D D R; SUBCODELEN : S U B C O D E L E N; @@ -1466,8 +1655,12 @@ SUBEVENT6 : S U B E V E N T '6'; SUBEVENT7 : S U B E V E N T '7'; SUBEVENT8 : S U B E V E N T '8'; SUBPOOL : S U B P O O L; +SUBRESID : S U B R E S I D; +SUBRESIDLEN : S U B R E S I D L E N; +SUBRESTYPE : S U B R E S T Y P E; SUBTASKS : S U B T A S K S; SUM : S U M; +SUPPRESSED : S U P P R E S S E D; SUSPEND : S U S P E N D; SUSPENDED : S U S P E N D E D; SUSPENDTIME : S U S P E N D T I M E; @@ -1476,20 +1669,24 @@ SUSPENDVALUE : S U S P E N D V A L U E; SUSPSTATUS : S U S P S T A T U S; SWITCHSTATUS : S W I T C H S T A T U S; SYMBOL : S Y M B O L; +SYMBOLERR : S Y M B O L E R R; SYMBOLLIST : S Y M B O L L I S T; SYNCHRONOUS : S Y N C H R O N O U S; SYNCLEVEL : S Y N C L E V E L; SYNCONRETURN : S Y N C O N R E T U R N; SYNCPOINT : S Y N C P O I N T; SYNCPOINTST : S Y N C P O I N T S T; +SYSBUSY : S Y S B U S Y; SYSDUMPCODE : S Y S D U M P C O D E; SYSDUMPING : S Y S D U M P I N G; SYSEIB : S Y S E I B; SYSID : S Y S I D; +SYSIDERR : S Y S I D E R R; SYSOUTCLASS : S Y S O U T C L A S S; SYSTEM : S Y S T E M; SYSTEMLOG : S Y S T E M L O G; SYSTEMSTATUS : S Y S T E M S T A T U S; +SZ : S Z; S_CHAR : S; TABLE : T A B L E; TABLENAME : T A B L E N A M E; @@ -1502,14 +1699,18 @@ TASK : T A S K; TASKDATAKEY : T A S K D A T A K E Y; TASKDATALOC : T A S K D A T A L O C; TASKID : T A S K I D; +TASKIDERR : T A S K I D E R R; TASKPRIORITY : T A S K P R I O R I T Y; TASKS : T A S K S; TASKSTARTST : T A S K S T A R T S T; +TASKSUBPOOL : T A S K S U B P O O L; +TC : T C; TCAMCONTROL : T C A M C O N T R O L; TCB : T C B; TCBLIMIT : T C B L I M I T; TCBS : T C B S; TCEXITSTATUS : T C E X I T S T A T U S; +TCIDERR : T C I D E R R; TCLASS : T C L A S S; TCPIP : T C P I P; TCPIPJOB : T C P I P J O B; @@ -1523,10 +1724,13 @@ TDQUEUE : T D Q U E U E; TELLERID : T E L L E R I D; TEMPLATE : T E M P L A T E; TEMPLATENAME : T E M P L A T E N A M E; +TEMPLATERR : T E M P L A T E R R; TEMPLATETYPE : T E M P L A T E T Y P E; TEMPSTORAGE : T E M P S T O R A G E; TERMCODE : T E R M C O D E; +TERMERR : T E R M E R R; TERMID : T E R M I D; +TERMIDERR : T E R M I D E R R; TERMINAL : T E R M I N A L; TERMMODEL : T E R M M O D E L; TERMPRIORITY : T E R M P R I O R I T Y; @@ -1544,10 +1748,13 @@ THREADLIMIT : T H R E A D L I M I T; THREADS : T H R E A D S; THREADWAIT : T H R E A D W A I T; THRESHOLD : T H R E S H O L D; +TI : T I; TIME : T I M E; +TIMEDOUT : T I M E D O U T; TIMEOUT : T I M E O U T; TIMEOUTINT : T I M E O U T I N T; TIMER : T I M E R; +TIMERERR : T I M E R E R R; TIMESEP : T I M E S E P; TITLE : T I T L E; TNADDR : T N A D D R; @@ -1559,12 +1766,14 @@ TOCHANNEL : T O C H A N N E L; TOCONTAINER : T O C O N T A I N E R; TOFLENGTH : T O F L E N G T H; TOKEN : T O K E N; +TOKENERR : T O K E N E R R; TOKENLEN : T O K E N L E N; TOKENTYPE : T O K E N T Y P E; TOLENGTH : T O L E N G T H; TOPROCESS : T O P R O C E S S; TPNAME : T P N A M E; TPNAMELEN : T P N A M E L E N; +TR : T R; TRACE : T R A C E; TRACEDEST : T R A C E D E S T; TRACEFLAG : T R A C E F L A G; @@ -1577,10 +1786,13 @@ TRANCLASS : T R A N C L A S S; TRANDUMPCODE : T R A N D U M P C O D E; TRANDUMPING : T R A N D U M P I N G; TRANISOLATE : T R A N I S O L A T E; +TRANMGR : T R A N M G R; TRANPRIORITY : T R A N P R I O R I T Y; TRANSACTION : T R A N S A C T I O N; +TRANSCLASS: T R A N S C L A S S; TRANSFORM : T R A N S F O R M; TRANSID : T R A N S I D; +TRANSIDERR : T R A N S I D E R R; TRANSMODE : T R A N S M O D E; TRIGGER : T R I G G E R; TRIGGERLEVEL : T R I G G E R L E V E L; @@ -1590,6 +1802,7 @@ TRPROF : T R P R O F; TRT : T R T; TRUE : T R U E; TS : T S; +TSIOERR : T S I O E R R; TSMAININUSE : T S M A I N I N U S E; TSMAINLIMIT : T S M A I N L I M I T; TSMODEL : T S M O D E L; @@ -1607,8 +1820,10 @@ TYPENAME : T Y P E N A M E; TYPENAMELEN : T Y P E N A M E L E N; TYPENS : T Y P E N S; TYPENSLEN : T Y P E N S L E N; +TYPETERM: T Y P E T E R M; UCTRANST : U C T R A N S T; UDSASIZE : U D S A S I Z E; +UE : U E; UNATTEND : U N A T T E N D; UNCOMMITTED : U N C O M M I T T E D; UNESCAPED : U N E S C A P E D; @@ -1619,6 +1834,8 @@ UOW : U O W; UOWDSNFAIL : U O W D S N F A I L; UOWENQ : U O W E N Q; UOWLINK : U O W L I N K; +UOWLNOTFOUND : U O W L N O T F O U N D; +UOWNOTFOUND : U O W N O T F O U N D; UOWSTATE : U O W S T A T E; UPDATE : U P D A T E; UPDATEMODEL : U P D A T E M O D E L; @@ -1629,6 +1846,7 @@ URIMAPLIMIT : U R I M A P L I M I T; URL : U R L; URLLENGTH : U R L L E N G T H; URM : U R M; +US : U S; USAGE : U S A G E; USECOUNT : U S E C O U N T; USER : U S E R; @@ -1638,6 +1856,7 @@ USERAUTH : U S E R A U T H; USERCORRDATA : U S E R C O R R D A T A; USERDATAKEY : U S E R D A T A K E Y; USERID : U S E R I D; +USERIDERR : U S E R I D E R R; USERNAME : U S E R N A M E; USERNAMELEN : U S E R N A M E L E N; USERPRIORITY : U S E R P R I O R I T Y; @@ -1656,14 +1875,19 @@ VBREF : V B R E F; VERIFY : V E R I F Y; VERSIONLEN : V E R S I O N L E N; VFORMST : V F O R M S T; +VOLIDERR : V O L I D E R R; VOLUME : V O L U M E; VOLUMELENG : V O L U M E L E N G; VTAM : V T A M; +W2 : W '2'; WAIT : W A I T; WAITCAUSE : W A I T C A U S E; WAITCICS : W A I T C I C S; WAITSTATE : W A I T S T A T E; +WB : W B; WEB : W E B; +WEB2 : W E B '2'; +WEBRESTMGR : W E B R E S T M G R; WEBSERVICE : W E B S E R V I C E; WEBSERVLIMIT : W E B S E R V L I M I T; WHEN_COMPILED : W H E N MINUSCHAR C O M P I L E D; @@ -1675,6 +1899,7 @@ WPMEDIA2 : W P M E D I A '2'; WPMEDIA3 : W P M E D I A '3'; WPMEDIA4 : W P M E D I A '4'; WRAP : W R A P; +WRBRK : W R B R K; WRITE : W R I T E; WRITEQ : W R I T E Q; WSACONTEXT : W S A C O N T E X T; @@ -1682,20 +1907,23 @@ WSAEPR : W S A E P R; WSBIND : W S B I N D; WSDIR : W S D I R; WSDLFILE : W S D L F I L E; +WU : W U; W_CHAR : W; XCFGROUP : X C F G R O U P; XCTL : X C T L; XID : X I D; XLNSTATUS : X L N S T A T U S; +XM : X M; XMLCONTAINER : X M L C O N T A I N E R; XMLSCHEMA : X M L S C H E M A; XMLTODATA : X M L T O D A T A; XMLTRANSFORM : X M L T R A N S F O R M; XOPDIRECTST : X O P D I R E C T S T; XOPSUPPORTST : X O P S U P P O R T S T; -XOPTS: X O P T S; +XOPTS : X O P T S; XRBA : X R B A; XRFSTATUS : X R F S T A T U S; +XS : X S; XSDBIND : X S D B I N D; YEAR : Y E A R; YYDDD : Y Y D D D; diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 index 77b1a2fb2f..0dfa21f756 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 @@ -19,7 +19,7 @@ compilerDirective: (.*? compilerOpts)* .*? EOF; cicsExecBlock: EXEC_CICS (allCicsRule)* END_EXEC ; allCicsRule: cics_send | cics_receive | cics_add | cics_address | cics_allocate | cics_asktime | cics_assign | cics_bif | - cics_build | cics_cancel | cics_change | cics_check | cics_connect | cics_converttime | + cics_build | cics_cancel | cics_change | cics_check | cics_connect | cics_converttime | cics_define | cics_delay | cics_delete | cics_deleteq | cics_deq | cics_document | cics_dump | cics_endbr | cics_endbrowse | cics_enq | cics_enter | cics_extract | cics_force | cics_formattime | cics_free | cics_freemain | cics_get | cics_getmain | cics_getmain64 | cics_getnext | cics_handle | cics_ignore | cics_inquire | @@ -38,7 +38,7 @@ allExciRules: cics_exci_link | cics_exci_delete | cics_exci_delete_container | c cics_exci_get_container | cics_exci_get_next_container | cics_exci_move_container | cics_exci_put_container | cics_exci_query_channel | cics_exci_startbrowse_container ; -allSPRules: cics_discard | cics_inquire_system_programming; +allSPRules: cics_discard | cics_extract_system_programming | cics_inquire_system_programming | cics_create; // compiler options compilerOpts @@ -243,7 +243,15 @@ cics_check_activity: (ACQPROCESS | ACTIVITY cics_data_value | ACQACTIVITY | (ABC (MODE | SUSPSTATUS | COMPSTATUS) cics_cvda | cics_handle_response)+; cics_check_timer: (TIMER cics_data_value | STATUS cics_cvda | cics_handle_response)*; -cics_conditions: EOC | EODS | INVMPSZ | INVPARTN | INVREQ | MAPFAIL | PARTNFAIL | RDATT | UNEXPIN | ERROR | DUPREC; +cics_conditions: NORMAL | ERROR | RDATT | WRBRK | EOF_TOKEN | EODS | EOC | INBFMH | ENDINPT | NONVAL | NOSTART | TERMIDERR | FILENOTFOUND | NOTFND | DUPREC | DUPKEY | + INVREQ | IOERR | NOSPACE | NOTOPEN | ENDFILE | ILLOGIC | LENGERR | QZERO | SIGNAL | QBUSY | ITEMERR | PGMIDERR | TRANSIDERR | ENDDATA | INVTSREQ | + EXPIRED | RETPAGE | RTEFAIL | RTESOME | TSIOERR | MAPFAIL | INVERRTERM | INVMPSZ | IGREQID | OVERFLOW | INVLDC | NOSTG | JIDERR | QIDERR | NOJBUFSP | + DSSTAT | SELNERR | FUNCERR | UNEXPIN | NOPASSBKRD | NOPASSBKWR | SEGIDERR | SYSIDERR | ISCINVREQ | ENQBUSY | ENVDEFERR | IGREQCD | SESSIONERR | SYSBUSY | + SESSBUSY | NOTALLOC | CBIDERR | INVEXITREQ | INVPARTNSET | INVPARTN | PARTNFAIL | USERIDERR | NOTAUTH | VOLIDERR | SUPPRESSED | RESIDERR | NOSPOOL | + TERMERR | ROLLEDBACK | END | DISABLED | ALLOCERR | STRELERR | OPENERR | SPOLBUSY | SPOLERR | NODEIDERR | TASKIDERR | TCIDERR | DSNNOTFOUND | LOADING | + MODELIDERR | OUTDESCRERR | PARTNERIDERR | PROFILEIDERR | NETNAMEIDERR | LOCKED | RECORDBUSY | UOWNOTFOUND | UOWLNOTFOUND | LINKABEND | CHANGED | PROCESSBUSY | + ACTIVITYBUSY | PROCESSERR | ACTIVITYERR | CONTAINERERR | EVENTERR | TOKENERR | NOTFINISHED | POOLERR | TIMERERR | SYMBOLERR | TEMPLATERR | NOTSUPERUSER | CSDERR | + DUPRES | RESUNAVAIL | CHANNELERR | CCSIDERR | TIMEDOUT | CODEPAGEERR | INCOMPLETE | APPNOTFOUND | BUSY; /** CONNECT PROCESS */ cics_connect: CONNECT cics_connect_process; @@ -255,6 +263,15 @@ cics_connect_process: (PROCESS | (CONVID | SESSION | PARTNER) cics_name | PROCNA cics_converttime: CONVERTTIME cics_converttime_opts; cics_converttime_opts:(DATESTRING cics_data_area | ABSTIME cics_data_area | cics_handle_response)+; +/** CREATE System Commands */ +cics_create: CREATE cics_create_opts; +cics_create_opts:((ATOMSERVICE | BUNDLE | DB2CONN | DB2ENTRY | DB2TRAN | DOCTEMPLATE | DUMPCODE | ENQMODEL | FILE | + IPCONN | JOURNALMODEL | JVMSERVER | LIBRARY | LSRPOOL | MAPSET | MQCONN | MQMONITOR | PARTITIONSET | + PARTNER | PIPELINE | PROCESSTYPE | PROFILE | PROGRAM | TCPIPSERVICE | TDQUEUE | TRANCLASS | + TRANSACTION | TSMODEL | TYPETERM | URIMAP | WEBSERVICE | SESSIONS | TERMINAL | CONNECTION) cics_data_value | + ATTRIBUTES cics_data_area | COMPLETE | DISCARD | ATTRLEN cics_data_value | LOG | NOLOG | + LOGMESSAGE cics_cvda | cics_handle_response)+; + /** DEFINE (all of them) */ cics_define: DEFINE (cics_define_activity | cics_define_composite_event | cics_define_counter_dcounter | cics_define_input_event | cics_define_process | cics_define_timer); cics_define_activity: ACTIVITY cics_data_value ((EVENT | TRANSID | PROGRAM | USERID) cics_data_value | ACTIVITYID cics_data_area | cics_handle_response)+; @@ -326,11 +343,11 @@ cics_dump_transaction_from: (FROM cics_data_area | cics_length_flength | cics_ha cics_dump_code_opts: (COMPLETE | TRT | TASK | STORAGE | PROGRAM | TERMINAL | TABLES | FCT | PCT | PPT | SIT | TCT | DUMPID cics_data_area | cics_handle_response)+; cics_dump_transaction_segmentlist: ((SEGMENTLIST | LENGTHLIST | NUMSEGMENTS) cics_data_area | cics_handle_response)+; -/** ENDBR */ -cics_endbr: ENDBR ((FILE | DATASET) cics_name | REQID cics_data_value | SYSID cics_data_area | cics_handle_response)*; - -/** ENDBROWSE (all of them) */ -cics_endbrowse: ENDBROWSE (ACTIVITY | CONTAINER | EVENT | PROCESS | TIMER | (BROWSETOKEN | RETCODE) cics_data_value | cics_handle_response)*; +/** ENDBR / ENDBROWSE */ +cics_endbr: ENDBR cics_endbr_opts; +cics_endbr_opts: ((FILE | DATASET) cics_name | REQID cics_data_value | SYSID cics_data_area | cics_handle_response)+; +cics_endbrowse: ENDBROWSE cics_endbrowse_opts; +cics_endbrowse_opts: (ACTIVITY | CONTAINER | EVENT | PROCESS | TIMER | (BROWSETOKEN | RETCODE) cics_data_value | cics_handle_response)+; /** ENQ */ cics_enq: ENQ cics_enq_opts; @@ -352,6 +369,11 @@ cics_extract_tct: (TCT | NETNAME cics_name | (SYSID | TERMID) cics_data_area | c cics_extract_web_server: (WEB | (REQUESTTYPE | HOSTTYPE | SCHEME) cics_cvda | HOSTLENGTH cics_data_value | (HOST | HTTPVERSION | VERSIONLEN | PATH | PATHLENGTH | HTTPMETHOD | METHODLENGTH | PORTNUMBER | QUERYSTRING | QUERYSTRLEN | URIMAP) cics_data_area | cics_handle_response)+; cics_extract_web_client: (WEB | (SESSTOKEN | PORTNUMBER | URIMAP | REALM | REALMLEN | HOST | HTTPVERSION | VERSIONLEN | PATH | PATHLENGTH) cics_data_area | HOSTLENGTH cics_data_value | (HOSTTYPE | SCHEME) cics_cvda | cics_handle_response)+; +/** EXTRACT (System Commands) */ +cics_extract_system_programming: EXTRACT (cics_extract_exit | cics_extract_statistics); +cics_extract_exit: (EXIT | (PROGRAM | ENTRYNAME) cics_data_value | GALENGTH cics_data_area | GASET cics_ref | cics_handle_response)+; +cics_extract_statistics: (STATISTICS | cics_restype | cics_subrestype | (RESID | SUBRESID | LASTRESET | LASTRESETABS | LASTRESETHRS | LASTRESETMIN | LASTRESETSEC) cics_data_area | + SET cics_ref | (RESIDLEN | SUBRESIDLEN | APPLICATION | APPLMAJORVER | APPLMINORVER | APPLMICROVER | PLATFORM) cics_data_value | cics_handle_response)+; /** FORCE TIMER */ cics_force: FORCE cics_force_opts; @@ -382,9 +404,11 @@ cics_get_counter_dcounter: ((COUNTER | DCOUNTER | POOL) cics_name | VALUE cics_d WRAP | NOSUSPEND | REDUCE | cics_handle_response)*; /** GETMAIN */ -cics_getmain: GETMAIN (SET cics_ref | FLENGTH cics_data_value | BELOW | LENGTH cics_data_value | INITIMG cics_data_value | +cics_getmain: GETMAIN cics_getmain_body; +cics_getmain_body: (SET cics_ref | FLENGTH cics_data_value | BELOW | LENGTH cics_data_value | INITIMG cics_data_value | EXECUTABLE | SHARED | NOSUSPEND | USERDATAKEY | CICSDATAKEY | cics_handle_response)+; -cics_getmain64: GETMAIN64 (SET cics_ref | FLENGTH cics_data_value | LOCATION cics_cvda | +cics_getmain64: GETMAIN64 cics_getmain64_body; +cics_getmain64_body: (SET cics_ref | FLENGTH cics_data_value | LOCATION cics_cvda | EXECUTABLE | SHARED | NOSUSPEND | USERDATAKEY | CICSDATAKEY | cics_handle_response)+; @@ -399,27 +423,23 @@ cics_getnext_container: (CONTAINER cics_data_area | BROWSETOKEN cics_data_value /** HANDLE CONDITION / HANDLE AID / HANDLE ABEND: */ cics_handle: HANDLE (cics_handle_abend | cics_handle_aid | cics_handle_condition); -cics_handle_abend: ABEND (CANCEL | PROGRAM cics_name | LABEL cics_label | RESET | cics_handle_response)*; -cics_handle_aid: AID (ANYKEY (cics_label)? | CLEAR (empty_parens | cics_label)? | CLRPARTN (cics_label)? | ENTER (cics_label)? | - LIGHTPEN (cics_label)? | OPERID (cics_label)? | pa_option (cics_label)? | pf_option (cics_label)? | - TRIGGER (cics_label)? | cics_handle_response)*; -cics_handle_condition: CONDITION ((cics_conditions | cicsWord) cics_label? | cics_handle_response)+; - -pa_option: PA1 | PA2 | PA3; -pf_option: PF1 | PF2 | PF3 | PF4 | PF5 | PF6 | PF7 | PF8 | PF9 | PF10 | PF11 | PF12 | PF13 | PF14 | PF15 | PF16 | PF17 | - PF18 | PF19 | PF20 | PF21 | PF22 | PF23 | PF24; +cics_handle_abend: (ABEND | CANCEL | PROGRAM cics_name | LABEL cics_label | RESET | cics_handle_response)*; +cics_handle_aid: (AID | (ANYKEY | CLEAR | CLRPARTN | ENTER | LIGHTPEN | OPERID | PA1 | PA2 | PA3 | PF1 | PF2 | PF3 | PF4 | PF5 | + PF6 | PF7 | PF8 | PF9 | PF10 | PF11 | PF12 | PF13 | PF14 | PF15 | PF16 | PF17 | PF18 | PF19 | PF20 | PF21 | PF22 | + PF23 | PF24 | TRIGGER) (cics_label)? | cics_handle_response)+; +cics_handle_condition: (CONDITION | cics_conditions (cics_label)? | cics_handle_response)*; /** IGNORE CONDITION */ -cics_ignore: IGNORE CONDITION (cics_conditions | cicsWord | cics_handle_response)+; +cics_ignore: IGNORE cics_ignore_options; +cics_ignore_options : (CONDITION | cics_conditions | cics_handle_response)+; /** INQUIRE, Application Commands ACTIVITYID / CONTAINER / EVENT / PROCESS / TIMER */ cics_inquire: INQUIRE (cics_inquire_process | cics_inquire_activityid | cics_inquire_container | cics_inquire_event | cics_inquire_timer); -cics_inquire_activityid: (ACTIVITYID cics_data_value | (COMPSTATUS | MODE | SUSPSTATUS) cics_cvda | - (ABCODE | ABPROGRAM | ACTIVITY | EVENT | PROCESS | PROCESSTYPE | PROGRAM | TRANSID | USERID) cics_data_area | cics_handle_response)+; -cics_inquire_container: ((CONTAINER | ACTIVITYID | PROCESS | PROCESSTYPE) cics_data_value | (DATALENTH | SET) cics_data_area | cics_handle_response)+; -cics_inquire_event: ((EVENT | ACTIVITYID) cics_data_value | (EVENTTYPE | FIRESTATUS | PREDICATE) cics_cvda | (COMPOSITE | TIMER) cics_data_area | cics_handle_response)+; +cics_inquire_activityid: ((COMPSTATUS | MODE | SUSPSTATUS) cics_cvda | (ABCODE | ABPROGRAM | ACTIVITY | EVENT | PROCESS | PROCESSTYPE | PROGRAM | TRANSID | USERID) cics_data_area | cics_handle_response)* ACTIVITYID cics_data_value ((COMPSTATUS | MODE | SUSPSTATUS) cics_cvda | (ABCODE | ABPROGRAM | ACTIVITY | EVENT | PROCESS | PROCESSTYPE | PROGRAM | TRANSID | USERID) cics_data_area | cics_handle_response)*; +cics_inquire_container: CONTAINER cics_data_value ((ACTIVITYID | PROCESS | PROCESSTYPE) cics_data_value | (DATALENGTH | SET) cics_data_area | cics_handle_response)*; +cics_inquire_event: EVENT cics_data_value (ACTIVITYID cics_data_value | (EVENTTYPE | FIRESTATUS | PREDICATE) cics_cvda | (COMPOSITE | TIMER) cics_data_area | cics_handle_response)*; cics_inquire_process: PROCESS cics_data_value (PROCESSTYPE cics_data_value | ACTIVITYID cics_data_area | cics_handle_response)*; -cics_inquire_timer: ((TIMER | ACTIVITYID) cics_data_value | (EVENT | ABSTIME) cics_data_area| STATUS cics_cvda | cics_handle_response)+; +cics_inquire_timer: TIMER cics_data_value (ACTIVITYID cics_data_value | (EVENT | ABSTIME) cics_data_area| STATUS cics_cvda | cics_handle_response)*; cics_browse_start_end: (START | END); /** INQUIRE, System Commands */ @@ -436,7 +456,7 @@ cics_inquire_bundlepart: BUNDLEPART cics_data_area? (BUNDLE cics_data_value | (S cics_inquire_capdatapred: CAPDATAPRED ((START | END | NEXT) | (CAPTURESPEC | EVENTBINDING) cics_data_value | (CONTAINER | FIELDLENGTH | FIELDOFFSET | FILENAME | FILTERVALUE | LOCATION | STRUCTNAME | VARIABLENAME) cics_data_area | OPERATOR cics_cvda | cics_handle_response)*; cics_inquire_capinfosrce: CAPINFOSRCE ((START | END | NEXT) | (CAPTURESPEC | EVENTBINDING) cics_data_value | (CONTAINER | FIELDLENGTH | FIELDOFFSET | FILENAME | ITEMNAME | LOCATION | STRUCTNAME | VARIABLENAME) cics_data_area | cics_handle_response)*; cics_inquire_capoptpred: CAPOPTPRED ((START | END | NEXT) | (CAPTURESPEC | EVENTBINDING) cics_data_value | (FILTERVALUE | OPTIONNAME) cics_data_area | OPERATOR cics_cvda | cics_handle_response)*; -cics_inquire_capturespec: CAPTURESPEC cics_data_area? ((START | END | NEXT) | (CAPTUREPOINT | CURRPGM | CURRTRANID | CURRUSERID | EVENTNAME | NUMDATAPRD | NUMINFOSRCE | NUMOPTPRED | PRIMPRED) cics_data_area | EVENTBINDING cics_data_value | (CAPTUREPTYPE | CURRPGMOP | CURRTRANIDOP | CURRUSERIDOP | PRIMPREDOP | PRIMPREDTYPE) cics_cvda | cics_handle_response)*; +cics_inquire_capturespec: CAPTURESPEC cics_data_area? ((START | END | NEXT) | (CAPTUREPOINT | CURRPGM | CURRTRANID | CURRUSERID | EVENTNAME | NUMDATAPRED | NUMINFOSRCE | NUMOPTPRED | PRIMPRED) cics_data_area | EVENTBINDING cics_data_value | (CAPTUREPTYPE | CURRPGMOP | CURRTRANIDOP | CURRUSERIDOP | PRIMPREDOP | PRIMPREDTYPE) cics_cvda | cics_handle_response)*; cics_inquire_connection: CONNECTION cics_data_value? ((cics_browse_start_end | NEXT) | (ACCESSMETHOD | ACQSTATUS | AUTOCONNECT | CHANGEAGENT | CONNSTATUS | CONNTYPE | CQP | EXITTRACING | INSTALLAGENT | PENDSTATUS | PROTOCOL | RECOVSTATUS | SERVSTATUS | XLNSTATUS | ZCPTRACING) cics_cvda | (AIDCOUNT | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | GRNAME | INSTALLTIME | INSTALLUSRID | LINKSYSTEM | MEMBERNAME | NETNAME | NQNAME | RECEIVECOUNT | REMOTENAME | REMOTESYSNET | REMOTESYSTEM | SENDCOUNT) cics_data_area | cics_handle_response)*; cics_inquire_cfdtpool: CFDTPOOL cics_data_value? ((cics_browse_start_end | NEXT) | CONNSTATUS cics_cvda | cics_handle_response)*; cics_inquire_db2conn: DB2CONN ((ACCOUNTREC | AUTHTYPE | CHANGEAGENT | COMAUTHTYPE | CONNECTERROR | CONNECTST | DROLLBACK | INSTALLAGENT | NONTERMREL | PRIORITY | RESYNCMEMBER | STANDBYMODE | THREADERROR | THREADWAIT) cics_cvda | (AUTHID | CHANGEAGREL | CHANGETIME | CHANGEUSRID | COMAUTHID | COMTHREADLIM | COMTHREADS | DB2GROUPID | DB2ID | DB2RELEASE | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID | MSGQUEUE1 | MSGQUEUE2 | MSGQUEUE3 | PLAN | PLANEXITNAME | PURGECYCLEM | PURGECYCLES | REUSELIMIT | SIGNID | STATSQUEUE | TCBLIMIT | TCBS | THREADLIMIT | THREADS) cics_data_area | cics_handle_response)*; @@ -454,7 +474,7 @@ cics_inquire_epadapterset: EPADAPTERSET cics_data_area? ((cics_browse_start_end cics_inquire_epadaptinset: EPADAPTINSET ((START | END | NEXT) | EPADAPTERSET cics_data_value | EPADAPTER cics_data_area | cics_handle_response)*; cics_inquire_eventbinding: EVENTBINDING cics_data_value? ((cics_browse_start_end | NEXT) | (CHANGEAGENT | ENABLESTATUS | EPADAPTERRES | INSTALLAGENT) cics_cvda | (CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | EPADAPTER | EPADAPTERSET | INSTALLTIME | INSTALLUSRID | USERTAG) cics_data_area | cics_handle_response)*; cics_inquire_eventprocess: EVENTPROCESS (EPSTATUS cics_cvda | SCHEMALEVEL cics_data_area | cics_handle_response)*; -cics_inquire_exci: EXCI cics_data_value ((TASK | UTIL) cics_data_value | cics_handle_response)*; +cics_inquire_exci: EXCI cics_data_value? ((START | END | NEXT) | (TASK | UTIL) cics_data_value | cics_handle_response)*; cics_inquire_exitprogram: EXITPROGRAM cics_data_value? ((START | END | NEXT) | EXIT cics_data_value | (ENTRYNAME | GAENTRYNAME | GALENGTH | GAUSECOUNT | NUMEXITS | QUALIFIER | TALENGTH | USECOUNT) cics_data_area | (APIST | CONCURRENTST | CONNECTST | FORMATEDFST | INDOUBTST | PURGEABLEST | SHUTDOWNST | SPIST | STARTSTATUS | TASKSTARTST) cics_cvda | ENTRY cics_ref | cics_handle_response)*; cics_inquire_featurekey: FEATUREKEY cics_data_value? ((START | END | NEXT) | (VALUE | FILEPATH) cics_data_area | cics_handle_response)*; cics_inquire_file: FILE cics_data_value? ((cics_browse_start_end | NEXT) | (ACCESSMETHOD | ADD | BLOCKFORMAT | BROWSE | CHANGEAGENT | DELETE | DISPOSITION | EMPTYSTATUS | ENABLESTATUS | EXCLUSIVE | FWDRECSTATUS | INSTALLAGENT | LOADTYPE | OBJECT | OPENSTATUS | RBATYPE | READ | READINTEG | RECORDFORMAT | RECOVSTATUS | RELTYPE | REMOTETABLE | RLSACCESS | TABLE | TYPE | UPDATE | UPDATEMODEL) cics_cvda |(BASEDSNAME | BLOCKKEYLEN | BLOCKSIZE | CFDTPOOL | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | DSNAME | INSTALLTIME | INSTALLUSRID | JOURNALNUM | KEYLENGTH | KEYPOSITION | LSRPOOLNUM | MAXNUMRECS | RECORDSIZE | REMOTENAME | REMOTESYSTEM | STRINGS | TABLENAME) cics_data_area | cics_handle_response)*; @@ -469,7 +489,7 @@ cics_inquire_jvmserver: JVMSERVER cics_data_value? ((cics_browse_start_end | NEX cics_inquire_library: LIBRARY cics_data_value? ((cics_browse_start_end | NEXT) | (APPLICATION | APPLMAJORVER | APPLMINORVER | APPLMICROVER | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | DSNAME01 | DSNAME02 | DSNAME03 | DSNAME04 | DSNAME05 | DSNAME06 | DSNAME07 | DSNAME08 | DSNAME09 | DSNAME10 | DSNAME11 | DSNAME12 | DSNAME13 | DSNAME14 | DSNAME15 | DSNAME16 | INSTALLUSRID | INSTALLTIME | NUMDSNAMES | PLATFORM | RANKING | SEARCHPOS) cics_data_area | (CHANGEAGENT | CRITICALST | ENABLESTATUS | INSTALLAGENT) cics_cvda | DSNAMELIST cics_ref | cics_handle_response)*; cics_inquire_modename: MODENAME cics_data_value? ((START | END | NEXT) | CONNECTION cics_data_value | (ACTIVE | AVAILABLE | MAXIMUM | MAXWINNERS) cics_data_area | AUTOCONNECT cics_cvda | cics_handle_response)*; cics_inquire_monitor: MONITOR ((APPLNAMEST | COMPRESSST | CONVERSEST | EXCEPTCLASS | IDNTYCLASS | PERFCLASS | RESRCECLASS | RMIST | STATUS | SYNCPOINTST | TIME) cics_cvda | (DPLLIMIT | FILELIMIT | FREQUENCY | FREQUENCYHRS | FREQUENCYMINS | FREQUENCYSECS | TSQUEUELIMIT | URIMAPLIMIT | WEBSERVLIMIT) cics_data_area | cics_handle_response)*; -cics_inquire_mqconn: MQCONN ((CHANGEAGENT | CONNECTST | INSTALLAGENT | RESYNCNUMBER) cics_cvda | (CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID | MQNAME | MQQMGR | MQRELEASE | TASKS | TRIGMONTASKS) cics_data_area | cics_handle_response)*; +cics_inquire_mqconn: MQCONN ((CHANGEAGENT | CONNECTST | INSTALLAGENT | RESYNCMEMBER) cics_cvda | (CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID | MQNAME | MQQMGR | MQRELEASE | TASKS | TRIGMONTASKS) cics_data_area | cics_handle_response)*; cics_inquire_mqini: MQINI cics_data_value ((CHANGEAGENT | INSTALLAGENT) cics_cvda | (CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INITQNAME | INSTALLTIME | INSTALLUSRID) cics_data_area | cics_handle_response)*; cics_inquire_mqmonitor: MQMONITOR cics_data_value? ((cics_browse_start_end | NEXT) | (CHANGEAGENT | ENABLESTATUS | INSTALLAGENT | MONSTATUS) cics_cvda | (CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID | MONDATA | MONUSERID | QNAME | TASKID | TRANSACTION | USERID) cics_data_area | cics_handle_response)*; cics_inquire_mvstcb: MVSTCB cics_ref? ((START | END | NEXT) | SET cics_ref | NUMELEMENTS cics_data_area | cics_handle_response)*; @@ -485,28 +505,30 @@ cics_inquire_profile: PROFILE cics_data_value? ((cics_browse_start_end | NEXT) | cics_inquire_program: PROGRAM cics_data_value? (AT cics_data_value | (START | END | NEXT) | (APIST | CEDFSTATUS | CHANGEAGENT | COBOLTYPE | COPY | CONCURRENCY | DATALOCATION | DYNAMSTATUS | EXECKEY | EXECUTIONSET | HOLDSTATUS | INSTALLAGENT | LANGDEDUCED | LANGUAGE | LPASTATUS | PROGTYPE | REPLICATION | RESIDENCY | RUNTIME | SHARESTATUS | STATUS) cics_cvda | (APPLICATION | APPLMAJORVER | APPLMINORVER | APPLMICROVER | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID | JVMCLASS | JVMPROFILE | JVMSERVER | LENGTH | LIBRARY | LIBRARYDSN | OPERATION | PLATFORM | REMOTENAME | REMOTESYSTEM | RESCOUNT | TRANSID | USECOUNT) cics_data_area | (ENTRYPOINT | LOADPOINT) cics_ref | cics_handle_response)*; cics_inquire_reqid: REQID cics_data_value? ((START | END | NEXT) | (REQTYPE | FMHSTATUS) cics_cvda | SET cics_ref | (TERMID | TRANSID | TIME | INTERVAL | HOURS | MINUTES | SECONDS | LENGTH | RTRANSID | RTERMID | QUEUE | USERID) cics_data_area | AFTER | AT | cics_handle_response)*; cics_inquire_rrms: RRMS (OPENSTATUS cics_cvda | cics_handle_response)*; -cics_inquire_secdiscovery: SECDISCOVERY ((STATUS | CMD | DB2 | DCT | FCT | HFS | JCT | PCT | PPT | PSB | RES | TRAN | TST | USER) cics_cvda | (LATSECDTIME | LASTWRITTIME | SECDCOUNT | NEWSECDCOUNT) cics_data_area | cics_handle_response)*; +cics_inquire_secdiscovery: SECDISCOVERY ((STATUS | CMD | DB2 | DCT | FCT | HFS | JCT | PCT | PPT | PSB | RES | TRAN | TST | USER) cics_cvda | (LASTSECDTIME | LASTWRITTIME | SECDCOUNT | NEWSECDCOUNT) cics_data_area | cics_handle_response)*; cics_inquire_secrecording: SECRECORDING cics_data_value? ((cics_browse_start_end | NEXT) | (ODADPTRID | ODADPTRDATA1 | ODADPTRDATA2 | ODADPTRDATA3 | ODAPPLID | ODCLNTIPADDR | ODCLNTPORT | ODFACILNAME | ODFACILTYPE | ODIPFAMILY | ODLUNAME | ODNETID | ODNETWORKID | ODSERVERPORT | ODTCPIPS | ODTRANSID | ODUSERID) cics_data_value | (MAXIMUM | CURRENT) cics_data_area | cics_handle_response)*; cics_inquire_statistics: STATISTICS (RECORDING cics_cvda | (ENDOFDAY | ENDOFDAYHRS | ENDOFDAYMINS | ENDOFDAYSECS | INTERVAL | INTERVALHRS | INTERVALMINS | INTERVALSECS | NEXTTIME | NEXTTIMEHRS | NEXTTIMEMINS | NEXTTIMESECS) cics_data_area | cics_handle_response)*; cics_inquire_storage: STORAGE ((ADDRESS | ELEMENT | ELEMENTLIST | LENGTHLIST) cics_ref | (FLENGTH | NUMELEMENTS) cics_data_area | TASK cics_data_value | cics_handle_response)*; -cics_inquire_storage64: STORAGE64 ((ELEMENT64 | ELEMENTLIST | LENGTHLIST) cics_ref | (ADRESS64 | DSANAME | TASK) cics_data_value | (FLENGTH | NUMELEMENTS) cics_data_area | cics_handle_response)*; +cics_inquire_storage64: STORAGE64 ((ELEMENT64 | ELEMENTLIST | LENGTHLIST) cics_ref | (ADDRESS64 | DSANAME | TASK) cics_data_value | (FLENGTH | NUMELEMENTS) cics_data_area | cics_handle_response)*; cics_inquire_streamname: STREAMNAME cics_data_value? ((cics_browse_start_end | NEXT) | (STATUS | SYSTEMLOG) cics_cvda | USECOUNT cics_data_area | cics_handle_response)*; -cics_inquire_subpool: SUBPOOL cics_data_area (DSANAME cics_data_area | cics_handle_response)*; +cics_inquire_subpool: SUBPOOL cics_data_area? (AT cics_data_value | (START | END | NEXT) | DSANAME cics_data_area | cics_handle_response)*; cics_inquire_sysdumpcode: SYSDUMPCODE cics_data_value? ((cics_browse_start_end | NEXT) | (CHANGEAGENT | DAEOPTION | DUMPSCOPE | INSTALLAGENT | SHUTOPTION | SYSDUMPING) cics_cvda | (CHANGEAGREL | CHANGETIME | CHANGEUSRID | CURRENT | DEFINESOURCE | DEFINETIME | DSPLIST | INSTALLTIME | INSTALLUSRID | JOBLIST | MAXIMUM) cics_data_area | cics_handle_response)*; cics_inquire_system: SYSTEM ((ACTOPENTCBS | AIDCOUNT | AKP | CDSASIZE | CICSSYS | CICSTSLEVEL | DB2CONN | DFLTUSER | DSALIMIT | DSRTPROGRAM | DTRPROGRAM | ECDSASIZE | EDSALIMIT | EPCDSASIZE | EPUDSASIZE | ERDSASIZE | ESDSASIZE | EUDSASIZE | GCDSASIZE | GMMTEXT | GMMLENGTH | GSDSASIZE | GUDSASIZE | GMMTRANID | JOBNAME | LASTCOLDTIME | LASTEMERTIME | LASTINITTIME | LASTWARMTIME | LOGDEFER | MAXOPENTCBS | MAXTASKS | MEMLIMIT | MQCONN | MROBATCH | MVSSMFID | MVSSYSNAME | OPREL | OPSYS | OSLEVEL | PCDSASIZE | PLTPIUSR | PROGAUTOEXIT | PRTYAGING | PUDSASIZE | RDSASIZE | REGIONUSERID | RELEASE | RUNAWAY | SCANDELAY | SDSASIZE | SDTMEMLIMIT | SDTRAN | STARTUPDATE | TIME | UDSASIZE) cics_data_area | SRRTASKS cics_data_value | (CICSSTATUS | CMDPROTECT | COLDSTATUS | DEBUGTOOL | DUMPING | FORCEQR | HEALTHCHECK | INITSTATUS | MESSAGECASE | PROGAUTOCTLG | PROGAUTOINST | REENTPROTECT | RLSSTATUS | SECURITYMGR | SHUTSTATUS | SOSABOVEBAR | SOSABOVELINE | SOSBELOWLINE | SOSSTATUS | STARTUP | STOREPROTECT | TRANISOLATE | XRFSTATUS) cics_cvda | cics_handle_response)*; -cics_inquire_tag: TAG (START | NEXT | END | cics_handle_response)*; -cics_inquire_task: TASK ((ACTIVITY | ACTIVITYID | ATTACHTIME | BRFACILITY | BRIDGE | CURRENTPROG | DB2PLAN | DTIMEOUT | FACILITY | IDENTIFIER | INDOUBTMINS | IPFLISTSIZE | PRIORITY | PROCESS | PROCESSTYPE | PROFILE | PROGRAM | REMOTENAME | REMOTESYSTEM | RTIMEOUT | RUNAWAY | STARTCODE | SUSPENDTIME | SUSPENDTYPE | SUSPENDVALUE | RESNAME | TRANCLASS | TCLASS | TRANPRIORITY | TRANSACTION | TRPROF | TWASIZE | UOW | USERID) cics_data_area | (CMDSEC | DUMPING | FACILITYTYPE | INDOUBT | INDOUBTWAIT | ISOLATEST | PURGEABILITY | RESSEC | ROUTING | RUNSTATUS | SCRNSIZE | SRRSTATUS | STORAGECLEAR | TASKDATAKEY | TASKDATALOC | TCB | TRACING) cics_cvda | IPFACILITIES cics_ref | cics_handle_response)*; +cics_inquire_tag: TAG cics_data_value? ((START | END | NEXT) | cics_handle_response)*; +cics_inquire_task: TASK cics_data_value? ((ACTIVITY | ACTIVITYID | ATTACHTIME | BRFACILITY | BRIDGE | CURRENTPROG | DB2PLAN | DTIMEOUT | FACILITY | IDENTIFIER | INDOUBTMINS | IPFLISTSIZE | PRIORITY | PROCESS | PROCESSTYPE | PROFILE | PROGRAM | REMOTENAME | REMOTESYSTEM | RTIMEOUT | RUNAWAY | STARTCODE | SUSPENDTIME | SUSPENDTYPE | SUSPENDVALUE | RESNAME | TRANCLASS | TCLASS | TRANPRIORITY | TRANSACTION | TRPROF | TWASIZE | UOW | USERID) cics_data_area | (CMDSEC | DUMPING | FACILITYTYPE | INDOUBT | INDOUBTWAIT | ISOLATEST | PURGEABILITY | RESSEC | ROUTING | RUNSTATUS | SCRNSIZE | SRRSTATUS | STORAGECLEAR | TASKDATAKEY | TASKDATALOC | TCB | TRACING) cics_cvda | IPFACILITIES cics_ref | cics_handle_response)*; cics_inquire_task_list: TASK (LIST | DISPATCHABLE | RUNNING | SUSPENDED | LISTSIZE cics_data_area | (SET | SETTRANSID) cics_ref | cics_handle_response)*; cics_inquire_tclass: TCLASS cics_data_value ((CURRENT | MAXIMUM) cics_data_area | cics_handle_response)*; cics_inquire_tcpip: TCPIP ((ACTSOCKETS | CRLPROFILE | MAXSOCKETS) cics_data_value | (OPENSTATUS | SSLCACHE) cics_cvda | cics_handle_response)*; -cics_inquire_tcpipservice: TCPIPSERVICE cics_data_value ((CERTIFICATE | CHANGEAGREL | CHANGETIME | CHANGEUSRID | CIPHERS | CLOSETIMEOUT | CONNECTIONS | DEFINESOURCE | DEFINETIME | GENERICTCPS | HOST | INSTALLTIME | INSTALLUSRID | IPADDRESS | IPRESOLVED | MAXDATALEN | MAXPERSIST | NUMCIPHERS | OPTIONSPGM | PORT | REALM | SPECIFTCPS | TRANSID | URM) cics_data_area | BACKLOG cics_data_value | (ATTACHSEC | ATTLS | AUTHENTICATE | CHANGEAGENT | HOSTTYPE | INSTALLAGENT | IPFAMILY | OPENSTATUS | PRIVACY | PROTOCOL | SOCKETCLOSE | SSLTYPE) cics_cvda | cics_handle_response)*; -cics_inquire_tdqueue: TDQUEUE cics_data_value? ((cics_browse_start_end | NEXT) | (ATITERMID | ATITRANID | ATIUSERID | BLOCKSIZE | DATABUFFERS | DDNAME | DSNAME | INDIRECTNAME | MEMBER | NUMITEMS | RECORDLENGTH | REMOTENAME | REMOTESYSTEM | TRIGGERLEVEL) cics_data_area | (ATIFACILITY | BLOCKFORMAT | DISPOSITION | EMPTYSTATUS | ENABLESTATUS | ERROROPTION | INDOUBT | INDOUBTWAIT | IOTYPE | OPENSTATUS | PRINTCONTROL | RECORDFORMAT | RECOVSTATUS | REWIND | SYSOUTCLASS | TYPE) cics_cvda | cics_handle_response)*; +cics_inquire_tcpipservice: TCPIPSERVICE cics_data_value? ((cics_browse_start_end | NEXT) | (CERTIFICATE | CHANGEAGREL | CHANGETIME | CHANGEUSRID | CIPHERS | CLOSETIMEOUT | CONNECTIONS | DEFINESOURCE | DEFINETIME | GENERICTCPS | HOST | INSTALLTIME | INSTALLUSRID | IPADDRESS | IPRESOLVED | MAXDATALEN | MAXPERSIST | NUMCIPHERS | OPTIONSPGM | PORT | REALM | SPECIFTCPS | TRANSID | URM) cics_data_area | BACKLOG cics_data_value | (ATTACHSEC | ATTLS | AUTHENTICATE | CHANGEAGENT | HOSTTYPE | INSTALLAGENT | IPFAMILY | OPENSTATUS | PRIVACY | PROTOCOL | SOCKETCLOSE | SSLTYPE) cics_cvda | cics_handle_response)*; +cics_inquire_tdqueue: TDQUEUE cics_data_value? ((cics_browse_start_end | NEXT) | (ATITERMID | ATITRANID | ATIUSERID | BLOCKSIZE | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DATABUFFERS | DDNAME | DEFINESOURCE | DEFINETIME | DSNAME | INDIRECTNAME | INSTALLTIME | INSTALLUSRID | MEMBER | NUMITEMS | RECORDLENGTH | REMOTENAME | REMOTESYSTEM | TRIGGERLEVEL) cics_data_area | (ATIFACILITY | BLOCKFORMAT | CHANGEAGENT | DISPOSITION | EMPTYSTATUS | ENABLESTATUS | ERROROPTION | INDOUBT | INDOUBTWAIT | INSTALLAGENT | IOTYPE | OPENSTATUS | PRINTCONTROL | RECORDFORMAT | RECOVSTATUS | REWIND | SYSOUTCLASS | TYPE) cics_cvda | cics_handle_response)*; cics_inquire_tempstorage: TEMPSTORAGE ((TSMAININUSE | TSMAINLIMIT) cics_data_value | cics_handle_response)*; -cics_inquire_netname: NETNAME cics_data_value? (TERMINAL cics_data_value?)? ((START | END | NEXT) | (NETNAME | AIDCOUNT | ALTPAGEHT | ALTPAGEWD | ALTPRINTER | ALTSCRNHT | ALTSCRNWD | ALTSUFFIX | CONSOLE | CORRELID | DEFPAGEHT | DEFPAGEWD | DEFSCRNHT | DEFSCRNWD | GCHARS | GCODES | LINKSYSTEM | MAPNAME | MAPSETNAME | MODENAME | NATLANG | NEXTTRANSID | NQNAME | OPERID | PAGEHT | PAGEWD | PRINTER | REMOTENAME | REMOTESYSNET | REMOTESYSTEM | SCRNHT | SCRNWD | TASKID | TCAMCONTROL | TERMMODEL | TERMPRIORITY | TNADDR | TNPORT | TRANSACTION | USERAREALEN | USERID | USERNAME) cics_data_area | (ACCESSMETHOD | ACQSTATUS | ALTPRTCOPYST | APLKYBDST | APLTEXTST | ASCII | ATISTATUS | AUDALARMST | AUTOCONNECT | BACKTRANSST | COLORST | COPYST | CREATESESS | DATASTREAM | DEVICE | DISCREQST | DUALCASEST | EXITTRACING | EXTENDEDDSST | FMHPARMST | FORMFEEDST | HFORMST | HILIGHTST | KATAKANAST | LIGHTPENST | MSRCONTROLST | NATURE | OBFORMATST | OBOPERIDST | OUTLINEST | PAGESTATUS | PARTITIONSST | PRINTADAPTST | PROGSYMBOLST | PRTCOPYST | QUERYST | RELREQST | SECURITY | SERVSTATUS | SESSIONTYPE | SIGNONSTATUS | SOSIST | TERMSTATUS | TEXTKYBDST | TEXTPRINTST | TNIPFAMILY | TRACING | TTISTATUS | UCTRANST | VALIDATIONST | VFORMST | ZCPTRACING) cics_cvda | USERAREA cics_ref | cics_handle_response)*; +cics_inquire_netname: NETNAME cics_data_value? (TERMINAL cics_data_value?)? ((START | END | NEXT) | (NETNAME | AIDCOUNT | ALTPAGEHT | ALTPAGEWD | ALTPRINTER | ALTSCRNHT | ALTSCRNWD | ALTSUFFIX | CONSOLE | CORRELID | DEFPAGEHT | DEFPAGEWD | DEFSCRNHT | DEFSCRNWD | GCHARS | GCODES | LINKSYSTEM | MAPNAME | MAPSETNAME | MODENAME | NATLANG | NEXTTRANSID | NQNAME | OPERID | PAGEHT | PAGEWD | PRINTER | REMOTENAME | REMOTESYSNET | REMOTESYSTEM | SCRNHT | SCRNWD | TASKID | TCAMCONTROL | TERMINAL | TERMMODEL | TERMPRIORITY | TNADDR | TNPORT | TRANSACTION | USERAREALEN | USERID | USERNAME) cics_data_area | (ACCESSMETHOD | ACQSTATUS | ALTPRTCOPYST | APLKYBDST | APLTEXTST | ASCII | ATISTATUS | AUDALARMST | AUTOCONNECT | BACKTRANSST | COLORST | COPYST | CREATESESS | DATASTREAM | DEVICE | DISCREQST | DUALCASEST | EXITTRACING | EXTENDEDDSST | FMHPARMST | FORMFEEDST | HFORMST | HILIGHTST | KATAKANAST | LIGHTPENST | MSRCONTROLST | NATURE | OBFORMATST | OBOPERIDST | OUTLINEST | PAGESTATUS | PARTITIONSST | PRINTADAPTST | PROGSYMBOLST | PRTCOPYST | QUERYST | RELREQST | SECURITY | SERVSTATUS | SESSIONTYPE | SIGNONSTATUS | SOSIST | TERMSTATUS | TEXTKYBDST | TEXTPRINTST | TNIPFAMILY | TRACING | TTISTATUS | UCTRANST | VALIDATIONST | VFORMST | ZCPTRACING) cics_cvda | USERAREA cics_ref | cics_handle_response)*; cics_inquire_terminal: TERMINAL cics_data_value? (NETNAME cics_data_value?)? ((START | END | NEXT) | (NETNAME | AIDCOUNT | ALTPAGEHT | ALTPAGEWD | ALTPRINTER | ALTSCRNHT | ALTSCRNWD | ALTSUFFIX | CONSOLE | CORRELID | DEFPAGEHT | DEFPAGEWD | DEFSCRNHT | DEFSCRNWD | GCHARS | GCODES | LINKSYSTEM | MAPNAME | MAPSETNAME | MODENAME | NATLANG | NEXTTRANSID | NQNAME | OPERID | PAGEHT | PAGEWD | PRINTER | REMOTENAME | REMOTESYSNET | REMOTESYSTEM | SCRNHT | SCRNWD | TASKID | TCAMCONTROL | TERMMODEL | TERMPRIORITY | TNADDR | TNPORT | TRANSACTION | USERAREALEN | USERID | USERNAME) cics_data_area | (ACCESSMETHOD | ACQSTATUS | ALTPRTCOPYST | APLKYBDST | APLTEXTST | ASCII | ATISTATUS | AUDALARMST | AUTOCONNECT | BACKTRANSST | COLORST | COPYST | CREATESESS | DATASTREAM | DEVICE | DISCREQST | DUALCASEST | EXITTRACING | EXTENDEDDSST | FMHPARMST | FORMFEEDST | HFORMST | HILIGHTST | KATAKANAST | LIGHTPENST | MSRCONTROLST | NATURE | OBFORMATST | OBOPERIDST | OUTLINEST | PAGESTATUS | PARTITIONSST | PRINTADAPTST | PROGSYMBOLST | PRTCOPYST | QUERYST | RELREQST | SECURITY | SERVSTATUS | SESSIONTYPE | SIGNONSTATUS | SOSIST | TERMSTATUS | TEXTKYBDST | TEXTPRINTST | TNIPFAMILY | TRACING | TTISTATUS | UCTRANST | VALIDATIONST | VFORMST | ZCPTRACING) cics_cvda | USERAREA cics_ref | cics_handle_response)*; cics_inquire_tracedest: TRACEDEST ((CURAUXDS | TABLESIZE) cics_data_area | (AUXSTATUS | GTFSTATUS | INTSTATUS | SWITCHSTATUS) cics_cvda | cics_handle_response)*; cics_inquire_traceflag: TRACEFLAG ((SINGLESTATUS | SYSTEMSTATUS | TCEXITSTATUS | USERSTATUS) cics_cvda | cics_handle_response)*; -cics_inquire_tracetype: TRACETYPE (TRACETYPE | SPECIAL | STANDARD | COMPID cics_data_area | FLAGSET cics_cvda | cics_handle_response)*; +cics_inquire_tracetype: TRACETYPE (TRACETYPE | SPECIAL | STANDARD | FLAGSET cics_cvda | (AP | AS | BA | BM | BR | CP | DC | DD | DH | DM | DP | DS | DU | EC | EI | EJ | EM | EP | FC | GC | IC | IE | IS | KC | KE | LC | LD | LG | LM | ME | ML | MN | MP | NQ | OT | PA | PC | PG | PI | PT | RA | RI | RL | RM | RS | RX | RZ | SC | SH | SJ | SM | SO | ST | SZ | TC | TD | TI | TR | TS | UE | US | WB | WU | W2 | XM | XS | + APPLICATION | ASYNCSERVICE | BUSAPPMGR | BRIDGE | CPI | DIRMGR | DOCUMENT | DOMAINMGR | DEBUGTOOL | DISPATCHER | DUMP | EVENTCAPTURE | ENTJAVA | EVENTMGR | EVENTPROC | GLOBALCATLG | IPECI | KERNEL | LOCALCATLG | LOADER | LOGGER | LOCKMGR | MESSAGE | MONITOR | MANAGEDPLAT | ENQUEUE | OBJECTTRAN | PARAMGR | PROGMGR | PIPEMGR | PARTNER | + RMIADAPTERS | RMI | RESLIFEMGR | RECOVERY | REGIONSTAT | RRS | REQUESTSTRM | SCHEDULER | SJVM | STORAGE | SOCKETS | STATISTICS | TIMER | TRACE | TEMPSTORAGE | USER | WEB | WEBRESTMGR | WEB2 | TRANMGR | SECURITY) cics_data_area | cics_handle_response)*; cics_inquire_tranclass: TRANCLASS cics_data_value? (AT cics_data_value | (START | END | NEXT) | (ACTIVE | MAXACTIVE | PURGETHRESH | QUEUED | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID) cics_data_area | (CHANGEAGENT | INSTALLAGENT | PURGEACTION) cics_cvda | cics_handle_response)*; cics_inquire_trandumpcode: TRANDUMPCODE cics_data_value? ((cics_browse_start_end | NEXT) | (CURRENT | MAXIMUM | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID) cics_data_area | (DUMPSCOPE | SHUTOPTION | SYSDUMPING | TRANDUMPING | CHANGEAGENT | INSTALLAGENT) cics_cvda | cics_handle_response)*; cics_inquire_transaction: TRANSACTION cics_data_value? (AT cics_data_value | (cics_browse_start_end | NEXT) | (BREXIT | DTIMEOUT | FACILITYLIKE | INDOUBTMINS | OTSTIMEOUT | PRIORITY | PROFILE | PROGRAM | REMOTENAME | REMOTESYSTEM | RTIMEOUT | RUNAWAY | TCLASS | TRANCLASS | TRPROF | TWASIZE | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID) cics_data_area | (APPLICATION | APPLMAJORVER | APPLMICROVER | APPLMINORVER | OPERATION | PLATFORM) cics_data_value | (AVAILSTATUS | CMDSEC | DUMPING | INDOUBT | INDOUBTWAIT | ISOLATEST | PURGEABILITY | RESSEC | ROUTING | ROUTESTATUS | RUNAWAYTYPE | SCRNSIZE | SHUTDOWN | STATUS | STORAGECLEAR | TASKDATAKEY | TASKDATALOC | TRACING | CHANGEAGENT | INSTALLAGENT) cics_cvda | cics_handle_response)*; @@ -525,7 +547,6 @@ cics_inquire_wlmhealth: WLMHEALTH ((ADJUSTMENT | HEALTH | HEALTHABSTIM | INTERVA cics_inquire_xmltransform: XMLTRANSFORM cics_name? ((cics_browse_start_end | NEXT) | (BUNDLE | CCSID | MAPPINGLEVEL | MAPPINGRNUM | MAPPINGVNUM | MINRUNLEVEL | MINRUNRNUM | MINRUNVNUM | XMLSCHEMA | XSDBIND | CHANGEAGREL | CHANGETIME | CHANGEUSRID | DEFINESOURCE | DEFINETIME | INSTALLTIME | INSTALLUSRID) cics_data_area | (VALIDATIONST | CHANGEAGENT | ENABLESTATUS | INSTALLAGENT) cics_cvda | cics_handle_response)*; - /** INVOKE APPLICATION / INVOKE SERVICE */ cics_invoke: INVOKE (cics_invoke_application | cics_invoke_service); @@ -632,7 +653,8 @@ cics_monitor: MONITOR cics_monitor_options; cics_monitor_options: (POINT cics_data_value | (DATA1 | DATA2 | ENTRYNAME) cics_data_area | cics_handle_response)+; /** MOVE CONTAINER (both) */ -cics_move: MOVE ((CONTAINER | FROMACTIVITY | TOACTIVITY | AS | CHANNEL | TOCHANNEL) cics_data_value | FROMPROCESS | +cics_move: MOVE cics_move_body; +cics_move_body: ((CONTAINER | FROMACTIVITY | TOACTIVITY | AS | CHANNEL | TOCHANNEL) cics_data_value | FROMPROCESS | TOPROCESS | cics_handle_response)+; /** POINT */ @@ -676,7 +698,8 @@ cics_read: READ (cics_file_name | UNCOMMITTED | CONSISTENT | REPEATABLE | UPDATE XRBA | EQUAL | GTEQ | NOSUSPEND | cics_handle_response)+; /** READNEXT | READPREV*/ -cics_readnext_readprev: (READNEXT | READPREV) (cics_file_name | INTO cics_data_area | SET cics_ref | UNCOMMITTED | CONSISTENT | REPEATABLE | +cics_readnext_readprev: (READNEXT | READPREV) cics_readnext_readprev_body; +cics_readnext_readprev_body: (cics_file_name | INTO cics_data_area | SET cics_ref | UNCOMMITTED | CONSISTENT | REPEATABLE | UPDATE | TOKEN cics_data_area | RIDFLD cics_data_area | KEYLENGTH cics_data_value | REQID cics_data_value | SYSID cics_data_area | LENGTH cics_data_area | RBA | RRN | XRBA | NOSUSPEND | cics_handle_response)*; @@ -703,6 +726,15 @@ cics_resetbr: RESETBR cics_resetbr_options; cics_resetbr_options: ((FILE | DATASET) cics_name | (RIDFLD | SYSID) cics_data_area | (KEYLENGTH | REQID) cics_data_value | GENERIC | GTEQ | EQUAL | RBA | RRN |XRBA | cics_handle_response)+; +/** RESTYPE HELPER */ +cics_restype: RESTYPE cics_cvda | ASYNCSERVICE | ATOMSERVICE | BUNDLE | DB2CONN | DB2ENTRY | DISPATCHER | DOCTEMPLATE | + EPADAPTER | ENQUEUE | EVENTBINDING | EVENTPROCESS | FILE | IPCONN | JOURNALNAME | JVMPROGRAM | JVMSERVER | + LIBRARY | LSRPOOL | MONITOR | MQCONN | MQMONITOR | MVSTCB | NODEJSAPP | PIPELINE | POLICY | PROGAUTO | + PROGRAM | PROGRAMDEF | RECOVERY | SECURITY | STATS | STORAGE | STREAMNAME | SUBPOOL | SYSDUMPCODE | TASKSUBPOOL | + TCPIP | TCPIPSERVICE | TDQUEUE | TRANCLASS | TRANDUMPCODE | TRANSACTION | TSQUEUE | URIMAP | USER | WEBSERVICE | + XMLTRANSFORM; +cics_subrestype: SUBRESTYPE cics_cvda | CAPTURESPEC | POLICYRULE; + /** RESUME */ cics_resume: RESUME (ACQACTIVITY | ACQPROCESS | ACTIVITY cics_data_value | cics_handle_response)+; @@ -718,9 +750,8 @@ cics_return_transid: (TRANSID cics_name | CHANNEL cics_name | COMMAREA cics_data cics_return_inputmsg: (INPUTMSG cics_data_area | INPUTMSGLEN cics_data_value | cics_handle_response)+; /** REWIND COUNTER / DCOUNTER */ -cics_rewind: REWIND (cics_rewind_counter | cics_rewind_dcounter); -cics_rewind_counter: COUNTER cics_name (POOL cics_name | INCREMENT cics_data_value | cics_handle_response)*; -cics_rewind_dcounter: DCOUNTER cics_name (POOL cics_name | INCREMENT cics_data_area | cics_handle_response)*; +cics_rewind: REWIND cics_rewind_opts; +cics_rewind_opts:(COUNTER cics_name | DCOUNTER cics_name | NOSUSPEND | POOL cics_name | INCREMENT cics_data_value | cics_handle_response)+; /** REWRITE: */ cics_rewrite: REWRITE cics_file_name (TOKEN cics_data_area | FROM cics_data_area | SYSID cics_data_area @@ -737,7 +768,8 @@ cics_run_default: ((ACTIVITY | FACILITYTOKN | INPUTEVENT) cics_data_value | ACQA cics_run_transid: (TRANSID cics_name | CHANNEL cics_name | CHILD cics_data_area | cics_handle_response)+; /** SIGNAL EVENT */ -cics_signal: SIGNAL (EVENT cics_data_value | FROMCHANNEL cics_data_value | FROM cics_data_area | FROMLENGTH cics_data_value | cics_handle_response)*; +cics_signal: SIGNAL cics_signal_options; +cics_signal_options: ((EVENT | FROMCHANNEL | FROMLENGTH) cics_data_value | FROM cics_data_area | cics_handle_response)+; /** SIGNOFF */ cics_signoff: SIGNOFF cics_handle_response?; @@ -792,8 +824,9 @@ cics_start_brexit: BREXIT name? (TRANSID cics_name | BRDATA cics_data_area | BRD cics_zero_digit: LPARENCHAR ZERO_DIGIT RPARENCHAR; /** STARTBR */ -cics_startbr: STARTBR cics_file_name (RIDFLD cics_data_area | KEYLENGTH cics_data_value | GENERIC | REQID cics_data_value | - SYSID cics_data_area | DEBKEY | DEBREC | RBA | RBN | XRBA | GTEQ | EQUAL | cics_handle_response)+; +cics_startbr: STARTBR cics_startbr_options; +cics_startbr_options: ((FILE | DATASET) cics_name | (RIDFLD | SYSID) cics_data_area | (KEYLENGTH | REQID) cics_data_value | GENERIC | + DEBKEY | DEBREC | RBA | RRN | XRBA | GTEQ | EQUAL | cics_handle_response)+; /** STARTBROWSE ACTIVITY / CONTAINER / EVENT / PROCESS */ cics_startbrowse: STARTBROWSE (cics_startbrowse_activity | cics_startbrowse_container | cics_startbrowse_event | @@ -810,10 +843,12 @@ cics_suspend: SUSPEND cics_suspend_body; cics_suspend_body: (ACQACTIVITY | ACQPROCESS | ACTIVITY cics_data_value | cics_handle_response)*; /** SYNCPOINT / SYNCPOINT ROLLBACK */ -cics_syncpoint: SYNCPOINT (cics_handle_response | ROLLBACK)*; +cics_syncpoint: SYNCPOINT cics_syncpoint_rollback; +cics_syncpoint_rollback: (ROLLBACK | cics_handle_response)*; /** TEST EVENT */ -cics_test: TEST (EVENT cics_data_value | FIRESTATUS cics_cvda | cics_handle_response)+; +cics_test: TEST cics_test_body; +cics_test_body: (EVENT cics_data_value | FIRESTATUS cics_cvda | cics_handle_response)+; /** TRANSFORM DATATOXML / XMLTODATA */ cics_transform: TRANSFORM (cics_transform_datatoxml | cics_transform_xmltodata); @@ -830,12 +865,12 @@ cics_transform_xmltodata: XMLTODATA (CHANNEL cics_data_value | DATCONTAINER cics cics_transform_typens | XMLCONTAINER cics_data_value | XMLTRANSFORM cics_name | cics_handle_response)+; /** UNLOCK */ -cics_unlock: UNLOCK (cics_file_name | TOKEN cics_data_area | SYSID cics_data_area | cics_handle_response)+; +cics_unlock: UNLOCK cics_unlock_body; +cics_unlock_body: (cics_file_name | TOKEN cics_data_area | SYSID cics_data_area | cics_handle_response)+; -/** UPDATE COUNTER / DCOUNTER */ -cics_update: UPDATE (cics_update_counter | cics_update_dcounter); -cics_update_counter: COUNTER cics_name (POOL cics_name | VALUE cics_data_value | COMPAREMIN cics_data_value | COMPAREMAX cics_data_value | cics_handle_response)+; -cics_update_dcounter: DCOUNTER cics_name (POOL cics_name | VALUE cics_data_area | COMPAREMIN cics_data_area | COMPAREMAX cics_data_area | cics_handle_response)+; +/** UPDATE COUNTER / UPDATE DCOUNTER */ +cics_update: UPDATE cics_update_counter_dcounter; +cics_update_counter_dcounter: ((COUNTER | DCOUNTER | POOL) cics_name | (VALUE | COMPAREMIN | COMPAREMAX) cics_data_value | NOSUSPEND | cics_handle_response)+; /** VERIFY PASSWORD / VERIFY PHRASE / VERIFY TOKEN */ cics_verify: VERIFY (cics_verify_password | cics_verify_phrase | cics_verify_token); @@ -856,7 +891,8 @@ cics_wait_signal: (SIGNAL | cics_handle_response)+; cics_wait_terminal: (TERMINAL | (CONVID | SESSION) cics_name | cics_handle_response)+; /** WAITCICS */ -cics_waitcics: WAITCICS (ECBLIST cics_value | NUMEVENTS cics_data_value | PURGEABLE | PURGEABILITY cics_cvda | +cics_waitcics: WAITCICS cics_waitcics_body; +cics_waitcics_body: (ECBLIST cics_value | NUMEVENTS cics_data_value | PURGEABLE | PURGEABILITY cics_cvda | NOTPURGEABLE | NAME cics_name | cics_handle_response)+; /** WEB (all) */ @@ -981,12 +1017,14 @@ cics_wsacontext_grelatesuri: RELATESURI cics_data_area (RELATESTYPE cics_data_ar cics_wsacontext_geprtype: EPRTYPE cics_cvda (EPRFIELD cics_cvda | EPRINTO cics_data_area | EPRSET cics_ref | EPRLENGTH cics_data_area | cics_handle_response)+; /** WSAEPR CREATE */ -cics_wsaepr: WSAEPR (CREATE | EPRINTO cics_data_area | EPRSET cics_data_area | EPRLENGTH cics_data_area | ADDRESS cics_data_value | +cics_wsaepr: WSAEPR cics_wsaepr_body; +cics_wsaepr_body: (CREATE | EPRINTO cics_data_area | EPRSET cics_data_area | EPRLENGTH cics_data_area | ADDRESS cics_data_value | REFPARMS cics_data_value | REFPARMSLEN cics_data_value | METADATA cics_data_value | METADATALEN cics_data_value | FROMCCSID cics_data_value | FROMCODEPAGE cics_data_value | cics_handle_response)+; /** XCTL: */ -cics_xctl: XCTL (PROGRAM cics_name | COMMAREA cics_data_area | LENGTH cics_data_value | CHANNEL cics_name | INPUTMSG cics_data_area | +cics_xctl: XCTL cics_xctl_body; +cics_xctl_body: (PROGRAM cics_name | COMMAREA cics_data_area | LENGTH cics_data_value | CHANNEL cics_name | INPUTMSG cics_data_area | INPUTMSGLEN cics_data_value | cics_handle_response)+; /** FILE or DATASET */ @@ -1138,1520 +1176,1746 @@ ABORT cicsLexerDefinedVariableUsageTokens: ABCODE - | ABDUMP - | ABEND - | ABENDCODE - | ABOFFSET - | ABORT - | ABPROGRAM - | ABSTIME - | ACAPPLNAME - | ACCESSMETHOD - | ACCOUNTREC - | ACCUM - | ACEE - | ACMAJORVER - | ACMICROVER - | ACMINORVER - | ACOPERNAME - | ACPLATNAME - | ACQACTIVITY - | ACQPROCESS - | ACQSTATUS - | ACQUACTIVITY - | ACTION - | ACTIONCOUNT - | ACTIONTYPE - | ACTIVE - | ACTIVITY - | ACTIVITYID - | ACTOPENTCBS - | ACTPARTN - | ACTSOCKETS - | ACTSSLTCBS - | ACTTHRDTCBS - | ACTXPTCBS - | ADAPTERTYPE - | ADD - | ADDRESS - | ADJUSTMENT - | ADRESS64 - | AGE - | AIBRIDGE - | AID - | AIDCOUNT - | AKP - | ALARM - | ALTPAGEHT - | ALTPAGEWD - | ALTPRINTER - | ALTPRTCOPYST - | ALTSCRNHT - | ALTSCRNWD - | ALTSUFFIX - | ANALYZERSTAT - | ANYKEY - | APIST - | APLKYBD - | APLKYBDST - | APLTEXT - | APLTEXTST - | APPENDCRLF - | APPLDATA - | APPLICATION - | APPLID - | APPLMAJORVER - | APPLMICROVER - | APPLMINORVER - | APPLNAMEST - | ARCHIVEFILE - | AS - | ASA - | ASCII - | ASIS - | ASKTIME - | ASRAINTRPT - | ASRAKEY - | ASRAPSW - | ASRAPSW16 - | ASRAREGS - | ASRAREGS64 - | ASRASPC - | ASRASTG - | ASSOCIATION - | ASYNCHRONOUS - | AT - | ATIFACILITY - | ATISTATUS - | ATITERMID - | ATITRANID - | ATIUSERID - | ATOMSERVICE - | ATOMTYPE - | ATTACH - | ATTACHID - | ATTACHSEC - | ATTACHTIME - | ATTLS - | ATTRIBUTES - | AUDALARMST - | AUDITLEVEL - | AUDITLOG - | AUTHENTICATE - | AUTHID - | AUTHORITY - | AUTHTYPE - | AUTHUSERID - | AUTINSTMODEL - | AUTOCONNECT - | AUTOINSTALL - | AUTOPAGE - | AUXILIARY - | AUXSTATUS - | AVAILABILITY - | AVAILABLE - | AVAILSTATUS - | BACKLOG - | BACKTRANSST - | BACKUPTYPE - | BASE64 - | BASEDSNAME - | BASESCOPE - | BASICAUTH - | BELOW - | BIF - | BINDFILE - | BINDING - | BLOCKFORMAT - | BLOCKKEYLEN - | BLOCKSIZE - | BODYCHARSET - | BOOKMARK - | BRANCHQUAL - | BRDATA - | BRDATALENGTH - | BREXIT - | BRFACILITY - | BRIDGE - | BROWSE - | BROWSETOKEN - | BTRANS - | BUFFER - | BUILD - | BUNDLE - | BUNDLEDIR - | BUNDLEID - | BUNDLEPART - | CACHESIZE - | CADDRLENGTH - | CAPTUREPOINT - | CAPTUREPTYPE - | CAPTURESPEC - | CARD - | CAUSE - | CBUFF - | CCSID - | CDSASIZE - | CEDFSTATUS - | CERTIFICATE - | CFDTPOOL - | CHANGE - | CHANGEAGENT - | CHANGEAGREL - | CHANGETIME - | CHANGEUSRID - | CHANNEL - | CHAR - | CHARACTERSET - | CHECK - | CHILD - | CHUNKEND - | CHUNKING - | CHUNKNO - | CHUNKYES - | CICSDATAKEY - | CICSSTATUS - | CICSSYS - | CICSTSLEVEL - | CIDDOMAIN - | CIPHERS - | CLEAR - | CLICONVERT - | CLIENT - | CLIENTADDR - | CLIENTADDRNU - | CLIENTCONV - | CLIENTIPADDR - | CLIENTLOC - | CLIENTNAME - | CLIENTPORT - | CLNTADDR6NU - | CLNTCODEPAGE - | CLNTIPFAMILY - | CLOSESTATUS - | CLOSETIMEOUT - | CLRPARTN - | CMD - | CMDPROTECT - | CMDSEC - | CNAMELENGTH - | CNOTCOMPL - | COBOLTYPE - | CODEPAGE - | COLDSTATUS - | COLOR - | COLORST - | COMAUTHID - | COMAUTHTYPE - | COMMAREA - | COMMONNAME - | COMMONNAMLEN - | COMPAREMAX - | COMPAREMIN - | COMPID - | COMPLETE - | COMPOSITE - | COMPRESSST - | COMPSTATUS - | COMTHREADLIM - | COMTHREADS - | CONCURRENCY - | CONCURRENTST - | CONFIGDATA1 - | CONFIGFILE - | CONFIRM - | CONFIRMATION - | CONNECT - | CONNECTERROR - | CONNECTION - | CONNECTIONS - | CONNECTST - | CONNSTATUS - | CONNTYPE - | CONSISTENT - | CONSOLE - | CONSOLES - | CONTAINER - | CONTEXTTYPE - | CONVDATA - | CONVERSE - | CONVERSEST - | CONVERTER - | CONVERTST - | CONVERTTIME - | CONVID - | COPY - | COPYST - | CORRELID - | COUNTER - | COUNTRY - | COUNTRYLEN - | CQP - | CREATE - | CREATESESS - | CRITICAL - | CRITICALST - | CRLPROFILE - | CTLCHAR - | CURAUXDS - | CURRENT - | CURRENTDDS - | CURRENTHEAP - | CURRENTPROG - | CURREQS - | CURRPGM - | CURRPGMOP - | CURRTRANID - | CURRTRANIDOP - | CURRUSERID - | CURRUSERIDOP - | CWA - | CWALENG - | DAEOPTION - | DATA1 - | DATA2 - | DATABUFFERS - | DATAFORMAT - | DATALENGTH - | DATALENTH - | DATALOCATION - | DATAONLY - | DATAPOINTER - | DATASET - | DATASTR - | DATASTREAM - | DATATOXML - | DATATYPE - | DATCONTAINER - | DATEFORM - | DATESEP - | DATESTRING - | DAYCOUNT - | DAYOFMONTH - | DAYOFWEEK - | DAYOFYEAR - | DAYS - | DAYSLEFT - | DB2 - | DB2CONN - | DB2ENTRY - | DB2GROUPID - | DB2ID - | DB2PLAN - | DB2RELEASE - | DCOUNTER - | DCT - | DDMMYY - | DDMMYYYY - | DDNAME - | DEBKEY - | DEBREC - | DEBUGTOOL - | DEEDIT - | DEFINE - | DEFINESOURCE - | DEFINETIME - | DEFPAGEHT - | DEFPAGEWD - | DEFRESP - | DEFSCRNHT - | DEFSCRNWD - | DELAY - | DELETE - | DELETEQ - | DEQ - | DESTCOUNT - | DESTID - | DESTIDLENG - | DETAILLENGTH - | DEVICE - | DFHRESP - | DFHVALUE - | DFLTUSER - | DIGEST - | DIGESTTYPE - | DISABLEDACT - | DISCARD - | DISCONNECT - | DISCREQST - | DISPOSITION - | DNAME - | DNAMELEN - | DOCDELETE - | DOCSIZE - | DOCSTATUS - | DOCTOKEN - | DOCUMENT - | DPLLIMIT - | DROLLBACK - | DS3270 - | DSALIMIT - | DSANAME - | DSNAME - | DSNAME01 - | DSNAME02 - | DSNAME03 - | DSNAME04 - | DSNAME05 - | DSNAME06 - | DSNAME07 - | DSNAME08 - | DSNAME09 - | DSNAME10 - | DSNAME11 - | DSNAME12 - | DSNAME13 - | DSNAME14 - | DSNAME15 - | DSNAME16 - | DSNAMELIST - | DSPLIST - | DSRTPROGRAM - | DSSCS - | DTIMEOUT - | DTRPROGRAM - | DUALCASEST - | DUMP - | DUMPCODE - | DUMPID - | DUMPING - | DUMPSCOPE - | DUPREC - | DURATION - | DYNAMSTATUS - | ECADDR - | ECBLIST - | ECDSASIZE - | EDSALIMIT - | EIB - | ELEMENT - | ELEMENT64 - | ELEMENTLIST - | ELEMNAME - | ELEMNAMELEN - | ELEMNS - | ELEMNSLEN - | EMITMODE - | EMPTYSTATUS - | ENABLEDCOUNT - | ENABLESTATUS - | ENCRYPTKEY - | ENDACTIVITY - | ENDBR - | ENDBROWSE - | ENDFILE - | ENDOFDAY - | ENDOFDAYHRS - | ENDOFDAYMINS - | ENDOFDAYSECS - | ENDOUTPUT - | ENDPOINT - | ENQ - | ENQFAILS - | ENQNAME - | ENQSCOPE - | ENTRY - | ENTRYNAME - | ENTRYPOINT - | EOC - | EODS - | EPADAPTER - | EPADAPTERNUM - | EPADAPTERRES - | EPADAPTERSET - | EPCDSASIZE - | EPRFIELD - | EPRFROM - | EPRINTO - | EPRLENGTH - | EPRSET - | EPRTYPE - | EPSTATUS - | EPUDSASIZE - | ERASE - | ERASEAUP - | ERDSASIZE - | ERRORMSG - | ERRORMSGLEN - | ERROROPTION - | ERRTERM - | ESDSASIZE - | ESMREASON - | ESMRESP - | EUDSASIZE - | EVENT - | EVENTBINDING - | EVENTNAME - | EVENTTYPE - | EVENTUAL - | EWASUPP - | EXACTMATCH - | EXCEPTCLASS - | EXCLUSIVE - | EXECKEY - | EXECUTABLE - | EXECUTIONSET - | EXIT - | EXITPGM - | EXITTRACING - | EXPECT - | EXPIRYINT - | EXPIRYINTMIN - | EXPIRYTIME - | EXTDS - | EXTENDEDDSST - | EXTRACT - | FACILITY - | FACILITYLIKE - | FACILITYTOKN - | FACILITYTYPE - | FACILNAME - | FACILTYPE - | FAULTACTLEN - | FAULTACTOR - | FAULTCODE - | FAULTCODELEN - | FAULTCODESTR - | FAULTSTRING - | FAULTSTRLEN - | FCI - | FCT - | FIELD - | FIELDLENGTH - | FIELDOFFSET - | FILE - | FILECOUNT - | FILELIMIT - | FILENAME - | FILEPATH - | FILTERVALUE - | FIRESTATUS - | FLAGSET - | FLENGTH - | FMH - | FMHPARM - | FMHPARMST - | FMHSTATUS - | FORCE - | FORCEQR - | FORMATEDFST - | FORMATTIME - | FORMFEED - | FORMFEEDST - | FORMFIELD - | FREEKB - | FREEMAIN - | FREEMAIN64 - | FREQUENCY - | FREQUENCYHRS - | FREQUENCYMINS - | FREQUENCYSECS - | FROMACTIVITY - | FROMCCSID - | FROMCHANNEL - | FROMCODEPAGE - | FROMDOC - | FROMFLENGTH - | FROMLENGTH - | FROMPROCESS - | FRSET - | FULLDATE - | FWDRECOVLOG - | FWDRECOVLSN - | FWDRECSTATUS - | GAENTRYNAME - | GALENGTH - | GARBAGEINT - | GAUSECOUNT - | GCDSASIZE - | GCHARS - | GCODES - | GCPOLICY - | GDS - | GENERIC - | GENERICTCPS - | GET - | GETMAIN - | GETMAIN64 - | GETNEXT - | GMEXITOPT - | GMMI - | GMMLENGTH - | GMMTEXT - | GMMTRANID - | GRNAME - | GROUPID - | GRSTATUS - | GSDSASIZE - | GTEQ - | GTFSTATUS - | GUDSASIZE - | HA - | HANDLE - | HEAD - | HEADER - | HEALTH - | HEALTHABSTIM - | HEALTHCHECK - | HEX - | HFORMST - | HFS - | HFSFILE - | HIGH_VALUE - | HIGH_VALUES - | HILIGHT - | HILIGHTST - | HOLD - | HOLDSTATUS - | HONEOM - | HOST - | HOSTCODEPAGE - | HOSTLENGTH - | HOSTTYPE - | HOURS - | HTTPHEADER - | HTTPMETHOD - | HTTPRNUM - | HTTPVERSION - | HTTPVNUM - | IDENTIFIER - | IDLE - | IDLEHRS - | IDLEMINS - | IDLESECS - | IDNTYCLASS - | IDPROP - | IGNORE - | IMMEDIATE - | INCREMENT - | INDIRECTNAME - | INDOUBT - | INDOUBTMINS - | INDOUBTST - | INDOUBTWAIT - | INITHEAP - | INITIALDDS - | INITIMG - | INITPARM - | INITPARMLEN - | INITQNAME - | INITSTATUS - | INITUSERID - | INPARTN - | INPUTEVENT - | INPUTMSG - | INPUTMSGLEN - | INQUIRE - | INSTALLAGENT - | INSTALLTIME - | INSTALLUSRID - | INTEGER - | INTERVAL - | INTERVALHRS - | INTERVALMINS - | INTERVALSECS - | INTOCCSID - | INTOCODEPAGE - | INTSTATUS - | INVALIDCOUNT - | INVITE - | INVMPSZ - | INVOKE - | INVOKETYPE - | INVOKINGPROG - | INVPARTN - | INVREQ - | IOTYPE - | IPADDRESS - | IPCONN - | IPFACILITIES - | IPFACILTYPE - | IPFAMILY - | IPFLISTSIZE - | IPRESOLVED - | ISOLATEST - | ISSUE - | ISSUER - | ISUSERID - | ITEM - | ITEMNAME - | IUTYPE - | JAVAHOME - | JCT - | JOBLIST - | JOBNAME - | JOURNALNAME - | JOURNALNUM - | JTYPEID - | JUSFIRST - | JUSLAST - | JUSTIFY - | JVMCLASS - | JVMPROFILE - | JVMSERVER - | JWT - | KATAKANA - | KATAKANAST - | KEEP - | KEEPTIME - | KERBEROS - | KEYLENGTH - | KEYNUMBER - | KEYPOSITION - | L40 - | L64 - | L80 - | LANGDEDUCED - | LANGINUSE - | LANGUAGE - | LANGUAGECODE - | LASTACTTIME - | LASTCOLDTIME - | LASTEMERTIME - | LASTINITTIME - | LASTMODTIME - | LASTUSEDINT - | LASTUSETIME - | LASTWARMTIME - | LASTWRITTIME - | LATSECDTIME - | LDC - | LDCMNEM - | LDCNUM - | LEAVEKB - | LENGTH - | LENGTHLIST - | LERUNOPTS - | LEVEL - | LIBRARY - | LIBRARYDSN - | LIGHTPEN - | LIGHTPENST - | LINAGE_COUNTER - | LINEADDR - | LINK - | LINKAGE - | LINKAUTH - | LINKLEVEL - | LINKSYSNET - | LINKSYSTEM - | LIST - | LISTLENGTH - | LISTSIZE - | LLID - | LOAD - | LOADPOINT - | LOADTYPE - | LOCALCCSID - | LOCALITY - | LOCALITYLEN - | LOCATION - | LOG - | LOGDEFER - | LOGMESSAGE - | LOGMODE - | LOGONLOGMODE - | LOGONMSG - | LOGREPSTATUS - | LOSTLOCKS - | LOW_VALUE - | LOW_VALUES - | LPASTATUS - | LSRPOOLNUM - | LUNAME - | MAIN - | MAJORVERSION - | MAP - | MAPCOLUMN - | MAPFAIL - | MAPHEIGHT - | MAPLINE - | MAPNAME - | MAPONLY - | MAPPED - | MAPPINGDEV - | MAPPINGLEVEL - | MAPPINGRNUM - | MAPPINGVNUM - | MAPSET - | MAPSETNAME - | MAPWIDTH - | MASSINSERT - | MAXACTIVE - | MAXDATALEN - | MAXFLENGTH - | MAXHEAP - | MAXIMUM - | MAXITEMLEN - | MAXLENGTH - | MAXLIFETIME - | MAXNUMRECS - | MAXOPENTCBS - | MAXPERSIST - | MAXPROCLEN - | MAXQTIME - | MAXREQS - | MAXSOCKETS - | MAXSSLTCBS - | MAXTASKS - | MAXTHRDTCBS - | MAXWINNERS - | MAXXPTCBS - | MCC - | MEDIATYPE - | MEMBER - | MEMBERNAME - | MEMLIMIT - | MESSAGECASE - | MESSAGEID - | METADATA - | METADATAFILE - | METADATALEN - | METHODLENGTH - | MGMTPART - | MICROVERSION - | MILLISECONDS - | MINIMUM - | MINITEMLEN - | MINORVERSION - | MINRUNLEVEL - | MINRUNRNUM - | MINRUNVNUM - | MINUTES - | MIRRORLIFE - | MMDDYY - | MMDDYYYY - | MODE - | MODENAME - | MONDATA - | MONITOR - | MONSTATUS - | MONTH - | MONTHOFYEAR - | MONUSERID - | MQCONN - | MQNAME - | MQQMGR - | MQRELEASE - | MROBATCH - | MSGFORMAT - | MSGQUEUE1 - | MSGQUEUE2 - | MSGQUEUE3 - | MSR - | MSRCONTROL - | MSRCONTROLST - | MTOMNOXOPST - | MTOMST - | MVSIMAGE - | MVSSMFID - | MVSSYSNAME - | NAME - | NAMELENGTH - | NAMESPACE - | NATLANG - | NATLANGINUSE - | NATURE - | NETID - | NETNAME - | NETUOWID - | NETWORK - | NETWORKID - | NEWPASSWORD - | NEWPHRASE - | NEWPHRASELEN - | NEWSECDCOUNT - | NEXTTIME - | NEXTTIMEHRS - | NEXTTIMEMINS - | NEXTTIMESECS - | NEXTTRANSID - | NLEOM - | NOAUTOPAGE - | NOCC - | NOCHECK - | NOCLICONVERT - | NOCLOSE - | NODATA - | NODE - | NODEHOME - | NODOCDELETE - | NODUMP - | NOEDIT - | NOFLUSH - | NOHANDLE - | NOINCONVERT - | NONE - | NONTERMREL - | NOOUTCONVERT - | NOQUEUE - | NOQUIESCE - | NOSRVCONVERT - | NOSUSPEND - | NOTE - | NOTPURGEABLE - | NOTRUNCATE - | NOWAIT - | NQNAME - | NSCONTAINER - | NUMCIPHERS - | NUMDATAPRD - | NUMDSNAMES - | NUMELEMENTS - | NUMEVENTS - | NUMEXITS - | NUMINFOSRCE - | NUMITEMS - | NUMOPTPRED - | NUMREC - | NUMROUTES - | NUMSEGMENTS - | NUMTAB - | OBFORMATST - | OBJECT - | OBOPERIDST - | OCCUPANCY - | ODADPTRDATA1 - | ODADPTRDATA2 - | ODADPTRDATA3 - | ODADPTRID - | ODAPPLID - | ODCLNTIPADDR - | ODCLNTPORT - | ODFACILNAME - | ODFACILTYPE - | ODIPFAMILY - | ODLUNAME - | ODNETID - | ODNETWORKID - | ODSERVERPORT - | ODSTARTTIME - | ODTASKID - | ODTCPIPS - | ODTRANSID - | ODUSERID - | OIDCARD - | OPCLASS - | OPENSTATUS - | OPERATION - | OPERATOR - | OPERID - | OPERKEYS - | OPERPURGE - | OPID - | OPREL - | OPSECURITY - | OPSYS - | OPTIONNAME - | OPTIONS - | OPTIONSPGM - | ORGABCODE - | ORGANIZATLEN - | ORGUNIT - | ORGUNITLEN - | OSGIBUNDLE - | OSGIBUNDLEID - | OSGISTATUS - | OSGIVERSION - | OSLEVEL - | OTSTID - | OTSTIMEOUT - | OUTDESCR - | OUTLINE - | OUTLINEST - | OUTPARTN - | OUTTOKEN - | OUTTOKENLEN - | OWNER - | PA1 - | PA2 - | PA3 - | PAGEHT - | PAGENUM - | PAGESTATUS - | PAGEWD - | PAGE_COUNTER - | PAGING - | PARSE - | PARTCLASS - | PARTCOUNT - | PARTITIONSST - | PARTN - | PARTNER - | PARTNFAIL - | PARTNPAGE - | PARTNS - | PARTNSET - | PARTTYPE - | PASS - | PASSBK - | PASSWORDLEN - | PATCH - | PATH - | PATHLENGTH - | PCDSASIZE - | PCT - | PENDSTATUS - | PERFCLASS - | PF1 - | PF10 - | PF11 - | PF12 - | PF13 - | PF14 - | PF15 - | PF16 - | PF17 - | PF18 - | PF19 - | PF2 - | PF20 - | PF21 - | PF22 - | PF23 - | PF24 - | PF3 - | PF4 - | PF5 - | PF6 - | PF7 - | PF8 - | PF9 - | PFXLENG - | PGMINTERFACE - | PHAPPLID - | PHCOUNT - | PHNETWORKID - | PHRASE - | PHRASELEN - | PHSTARTTIME - | PHTASKID - | PHTRANSID - | PID - | PIPELINE - | PIPLENGTH - | PIPLIST - | PLAN - | PLANEXITNAME - | PLATFORM - | PLTPIUSR - | POINT - | POLICY - | POOL - | POOLNAME - | POP - | PORT - | PORTNUMBER - | PORTNUMNU - | POST - | PPT - | PREDICATE - | PREFIX - | PREPARE - | PRIMPRED - | PRIMPREDOP - | PRIMPREDTYPE - | PRINCONVID - | PRINSYSID - | PRINT - | PRINTADAPTST - | PRINTCONTROL - | PRINTER - | PRIORITY - | PRIVACY - | PROCESS - | PROCESSTYPE - | PROCLENGTH - | PROCNAME - | PROFILE - | PROFILEDIR - | PROGAUTOCTLG - | PROGAUTOEXIT - | PROGAUTOINST - | PROGRAM - | PROGSYMBOLST - | PROGTYPE - | PROTECT - | PROTECTNUM - | PROTOCOL - | PRTCOPYST - | PRTYAGING - | PS - | PSB - | PSDINTERVAL - | PSDINTHRS - | PSDINTMINS - | PSDINTSECS - | PSTYPE - | PTCOUNT - | PTHREADS - | PTSTARTTIME - | PTTASKID - | PTTRANSID - | PUDSASIZE - | PUNCH - | PURGEABILITY - | PURGEABLE - | PURGEABLEST - | PURGEACTION - | PURGECYCLEM - | PURGECYCLES - | PURGETHRESH - | PUSH - | PUT - | QNAME - | QUALIFIER - | QUALLEN - | QUERY - | QUERYPARM - | QUERYST - | QUERYSTRING - | QUERYSTRLEN - | QUEUE - | QUEUED - | QUEUELIMIT - | QUIESCESTATE - | RANKING - | RBA - | RBATYPE - | RBN - | RDATT - | RDSASIZE - | READ - | READINTEG - | READNEXT - | READPREV - | READQ - | REALM - | REALMLEN - | REASON - | REATTACH - | RECEIVECOUNT - | RECEIVER - | RECFM - | RECORDFORMAT - | RECORDING - | RECORDLEN - | RECORDLENGTH - | RECORDSIZE - | RECOVSTATUS - | REDIRECTTYPE - | REDUCE - | REENTPROTECT - | REFPARMS - | REFPARMSLEN - | REGIONUSERID - | RELATESINDEX - | RELATESTYPE - | RELATESURI - | RELATION - | RELEASE - | RELREQST - | RELTYPE - | REMOTENAME - | REMOTEPREFIX - | REMOTESYSNET - | REMOTESYSTEM - | REMOTETABLE - | REMOVE - | REPEATABLE - | REPETABLE - | REPLICATION - | REPLY - | REPLYLENGTH - | REQID - | REQTYPE - | REQUESTTYPE - | RES - | RESCLASS - | RESCOUNT - | RESETBR - | RESID - | RESIDENCY - | RESIDLENGTH - | RESLEN - | RESNAME - | RESOURCE - | RESOURCENAME - | RESOURCETYPE - | RESP - | RESP2 - | RESPWAIT - | RESRCECLASS - | RESSEC - | RESTART - | RESTYPE - | RESULT - | RESUME - | RESYNCMEMBER - | RESYNCNUMBER - | RESYNCSTATUS - | RETAIN - | RETCODE - | RETCORD - | RETLOCKS - | RETRIECE - | RETRIEVE - | RETURNPROG - | REUSELIMIT - | REWIND - | RIDFLD - | RLSACCESS - | RLSSTATUS - | RMIQFY - | RMIST - | ROLE - | ROLELENGTH - | ROLLBACK - | ROUTE - | ROUTECODES - | ROUTESTATUS - | ROUTING - | RPROCESS - | RRESOURCE - | RRN - | RTERMID - | RTIMEOUT - | RTRANSID - | RULEGROUP - | RULEITEM - | RULETYPE - | RUNAWAY - | RUNAWAYTYPE - | RUNSTATUS - | RUNTIME - | SADDRLENGTH - | SCANDELAY - | SCHEMALEVEL - | SCHEME - | SCHEMENAME - | SCOPE - | SCOPELEN - | SCRNHT - | SCRNSIZE - | SCRNWD - | SDSASIZE - | SDTMEMLIMIT - | SDTRAN - | SEARCHPOS - | SECDCOUNT - | SECONDS - | SECPORT - | SECURITY - | SECURITYMGR - | SECURITYNAME - | SECURITYST - | SEGMENTLIST - | SENDCOUNT - | SENDER - | SENDMTOMST - | SERIALNUM - | SERIALNUMLEN - | SERVER - | SERVERADDR - | SERVERADDRNU - | SERVERCONV - | SERVERIPADDR - | SERVERNAME - | SERVERPORT - | SERVSTATUS - | SESSION - | SESSIONTYPE - | SESSTOKEN - | SET - | SETTRANSID - | SHARED - | SHARELOCKS - | SHARESTATUS - | SHELF - | SHUTDOWN - | SHUTDOWNST - | SHUTOPTION - | SHUTSTATUS - | SIGDATA - | SIGNAL - | SIGNID - | SIGNOFF - | SIGNON - | SIGNONSTATUS - | SINGLESTATUS - | SIT - | SNAMELENGTH - | SOAPFAULT - | SOAPLEVEL - | SOAPRNUM - | SOAPVNUM - | SOCKETCLOSE - | SOCKPOOLSIZE - | SOSABOVEBAR - | SOSABOVELINE - | SOSBELOWLINE - | SOSI - | SOSIST - | SOSSTATUS - | SPECIFTCPS - | SPIST - | SPOOLCLOSE - | SPOOLOPEN - | SPOOLREAD - | SPOOLWRITE - | SRRSTATUS - | SRRTASKS - | SRVCNAME - | SRVCONVERT - | SRVCSTATUS - | SRVRADDR6NU - | SRVRIPFAMILY - | SSLCACHE - | SSLTYPE - | STANDBYMODE - | STARTBR - | STARTBROWSE - | STARTCODE - | STARTSCRIPT - | STARTSTATUS - | STARTTIME - | STARTUP - | STARTUPDATE - | STATE - | STATELEN - | STATIONID - | STATSQUEUE - | STATUS - | STATUSCODE - | STATUSLEN - | STATUSTEXT - | STDERR - | STDOUT - | STORAGE - | STORAGECLEAR - | STOREPROTECT - | STREAMNAME - | STRFIELD - | STRINGFORMAT - | STRINGS - | STRINGZONE - | STRUCTNAME - | SUBADDR - | SUBCODELEN - | SUBCODESTR - | SUBEVENT - | SUBEVENT1 - | SUBEVENT2 - | SUBEVENT3 - | SUBEVENT4 - | SUBEVENT5 - | SUBEVENT6 - | SUBEVENT7 - | SUBEVENT8 - | SUBTASKS - | SUSPEND - | SUSPENDTIME - | SUSPENDTYPE - | SUSPENDVALUE - | SUSPSTATUS - | SWITCHSTATUS - | SYMBOL - | SYMBOLLIST - | SYNCHRONOUS - | SYNCLEVEL - | SYNCONRETURN - | SYNCPOINT - | SYNCPOINTST - | SYSDUMPING - | SYSID - | SYSOUTCLASS - | SYSTEMLOG - | SYSTEMSTATUS - | TABLE - | TABLENAME - | TABLES - | TABLESIZE - | TALENGTH - | TARGETCOUNT - | TASK - | TASKDATAKEY - | TASKDATALOC - | TASKID - | TASKPRIORITY - | TASKS - | TASKSTARTST - | TCAMCONTROL - | TCB - | TCBLIMIT - | TCBS - | TCEXITSTATUS - | TCLASS - | TCPIP - | TCPIPJOB - | TCPIPSERVICE - | TCPIPZONE - | TCT - | TCTUA - | TCTUALENG - | TD - | TDQUEUE - | TELLERID - | TEMPLATE - | TEMPLATENAME - | TEMPLATETYPE - | TERMCODE - | TERMID - | TERMINAL - | TERMMODEL - | TERMPRIORITY - | TERMSTATUS - | TEXTKYBD - | TEXTKYBDST - | TEXTLENGTH - | TEXTPRINT - | TEXTPRINTST - | THREADCOUNT - | THREADERROR - | THREADLIMIT - | THREADS - | THREADWAIT - | THRESHOLD - | TIME - | TIMEOUT - | TIMEOUTINT - | TIMER - | TIMESEP - | TNADDR - | TNIPFAMILY - | TNPORT - | TOACTIVITY - | TOCHANNEL - | TOCONTAINER - | TOFLENGTH - | TOKEN - | TOKENLEN - | TOKENTYPE - | TOLENGTH - | TOPROCESS - | TPNAME - | TPNAMELEN - | TRACE - | TRACENUM - | TRACING - | TRAILER - | TRAN - | TRANCLASS - | TRANDUMPING - | TRANISOLATE - | TRANPRIORITY - | TRANSACTION - | TRANSFORM - | TRANSID - | TRANSMODE - | TRIGGER - | TRIGGERLEVEL - | TRIGMONTASKS - | TRNGRPID - | TRPROF - | TRT - | TS - | TSMAININUSE - | TSMAINLIMIT - | TSMODEL - | TSQUEUE - | TSQUEUELIMIT - | TST - | TTISTATUS - | TWA - | TWALENG - | TWASIZE - | TYPE - | TYPENAME - | TYPENAMELEN - | TYPENS - | TYPENSLEN - | UCTRANST - | UDSASIZE - | UNATTEND - | UNCOMMITTED - | UNESCAPED - | UNEXPIN - | UNLOCK - | UOW - | UOWSTATE - | UPDATE - | UPDATEMODEL - | URI - | URID - | URIMAP - | URIMAPLIMIT - | URL - | URLLENGTH - | URM - | USAGE - | USECOUNT - | USER - | USERAREA - | USERAREALEN - | USERAUTH - | USERCORRDATA - | USERDATAKEY - | USERID - | USERNAME - | USERNAMELEN - | USERPRIORITY - | USERSTATUS - | USERTAG - | UTIL - | VALIDATION - | VALIDATIONST - | VALIDITY - | VALUE - | VALUELENGTH - | VARIABLENAME - | VERIFY - | VERSIONLEN - | VFORMST - | VOLUME - | VOLUMELENG - | WAIT - | WAITCAUSE - | WAITCICS - | WAITSTATE - | WEB - | WEBSERVICE - | WEBSERVLIMIT - | WHEN_COMPILED - | WLMOPENST - | WORKDIR - | WPMEDIA1 - | WPMEDIA2 - | WPMEDIA3 - | WPMEDIA4 - | WRAP - | WRITEQ - | WSACONTEXT - | WSAEPR - | WSBIND - | WSDIR - | WSDLFILE - | XCFGROUP - | XCTL - | XID - | XLNSTATUS - | XMLCONTAINER - | XMLSCHEMA - | XMLTODATA - | XMLTRANSFORM - | XOPDIRECTST - | XOPSUPPORTST - | XRBA - | XRFSTATUS - | XSDBIND - | YEAR - | YYDDD - | YYDDMM - | YYMMDD - | YYYYDDD - | YYYYDDMM - | YYYYMMDD - | ZCPTRACING; + | ABDUMP + | ABEND + | ABENDCODE + | ABOFFSET + | ABORT + | ABPROGRAM + | ABSTIME + | ACAPPLNAME + | ACCESSMETHOD + | ACCOUNTREC + | ACCUM + | ACEE + | ACMAJORVER + | ACMICROVER + | ACMINORVER + | ACOPERNAME + | ACPLATNAME + | ACQACTIVITY + | ACQPROCESS + | ACQSTATUS + | ACQUACTIVITY + | ACTION + | ACTIONCOUNT + | ACTIONTYPE + | ACTIVE + | ACTIVITY + | ACTIVITYBUSY + | ACTIVITYERR + | ACTIVITYID + | ACTOPENTCBS + | ACTPARTN + | ACTSOCKETS + | ACTSSLTCBS + | ACTTHRDTCBS + | ACTXPTCBS + | ADAPTERTYPE + | ADD + | ADDRESS + | ADJUSTMENT + | ADRESS64 + | AGE + | AIBRIDGE + | AID + | AIDCOUNT + | AKP + | ALARM + | ALLOCERR + | ALTPAGEHT + | ALTPAGEWD + | ALTPRINTER + | ALTPRTCOPYST + | ALTSCRNHT + | ALTSCRNWD + | ALTSUFFIX + | ANALYZERSTAT + | ANYKEY + | AP + | APIST + | APLKYBD + | APLKYBDST + | APLTEXT + | APLTEXTST + | APPENDCRLF + | APPLDATA + | APPLICATION + | APPLID + | APPLMAJORVER + | APPLMICROVER + | APPLMINORVER + | APPLNAMEST + | APPNOTFOUND + | ARCHIVEFILE + | AS + | ASA + | ASCII + | ASIS + | ASKTIME + | ASRAINTRPT + | ASRAKEY + | ASRAPSW + | ASRAPSW16 + | ASRAREGS + | ASRAREGS64 + | ASRASPC + | ASRASTG + | ASSOCIATION + | ASYNCHRONOUS + | ASYNCSERVICE + | AT + | ATIFACILITY + | ATISTATUS + | ATITERMID + | ATITRANID + | ATIUSERID + | ATOMSERVICE + | ATOMTYPE + | ATTACH + | ATTACHID + | ATTACHSEC + | ATTACHTIME + | ATTLS + | ATTRIBUTES + | ATTRLEN + | AUDALARMST + | AUDITLEVEL + | AUDITLOG + | AUTHENTICATE + | AUTHID + | AUTHORITY + | AUTHTYPE + | AUTHUSERID + | AUTINSTMODEL + | AUTOCONNECT + | AUTOINSTALL + | AUTOPAGE + | AUXILIARY + | AUXSTATUS + | AVAILABILITY + | AVAILABLE + | AVAILSTATUS + | BA + | BACKLOG + | BACKTRANSST + | BACKUPTYPE + | BASE64 + | BASEDSNAME + | BASESCOPE + | BASICAUTH + | BELOW + | BIF + | BINDFILE + | BINDING + | BLOCKFORMAT + | BLOCKKEYLEN + | BLOCKSIZE + | BM + | BODYCHARSET + | BOOKMARK + | BR + | BRANCHQUAL + | BRDATA + | BRDATALENGTH + | BREXIT + | BRFACILITY + | BRIDGE + | BROWSE + | BROWSETOKEN + | BTRANS + | BUFFER + | BUILD + | BUNDLE + | BUNDLEDIR + | BUNDLEID + | BUNDLEPART + | BUSAPPMGR + | BUSY + | CACHESIZE + | CADDRLENGTH + | CAPTUREPOINT + | CAPTUREPTYPE + | CAPTURESPEC + | CARD + | CAUSE + | CBIDERR + | CBUFF + | CCSID + | CCSIDERR + | CDSASIZE + | CEDFSTATUS + | CERTIFICATE + | CFDTPOOL + | CHANGE + | CHANGEAGENT + | CHANGEAGREL + | CHANGED + | CHANGETIME + | CHANGEUSRID + | CHANNEL + | CHANNELERR + | CHAR + | CHARACTERSET + | CHECK + | CHILD + | CHUNKEND + | CHUNKING + | CHUNKNO + | CHUNKYES + | CICSDATAKEY + | CICSSTATUS + | CICSSYS + | CICSTSLEVEL + | CIDDOMAIN + | CIPHERS + | CLEAR + | CLICONVERT + | CLIENT + | CLIENTADDR + | CLIENTADDRNU + | CLIENTCONV + | CLIENTIPADDR + | CLIENTLOC + | CLIENTNAME + | CLIENTPORT + | CLNTADDR6NU + | CLNTCODEPAGE + | CLNTIPFAMILY + | CLOSESTATUS + | CLOSETIMEOUT + | CLRPARTN + | CMD + | CMDPROTECT + | CMDSEC + | CNAMELENGTH + | CNOTCOMPL + | COBOLTYPE + | CODEPAGE + | CODEPAGEERR + | COLDSTATUS + | COLOR + | COLORST + | COMAUTHID + | COMAUTHTYPE + | COMMAREA + | COMMONNAME + | COMMONNAMLEN + | COMPAREMAX + | COMPAREMIN + | COMPID + | COMPLETE + | COMPOSITE + | COMPRESSST + | COMPSTATUS + | COMTHREADLIM + | COMTHREADS + | CONCURRENCY + | CONCURRENTST + | CONFIGDATA1 + | CONFIGFILE + | CONFIRM + | CONFIRMATION + | CONNECT + | CONNECTERROR + | CONNECTION + | CONNECTIONS + | CONNECTST + | CONNSTATUS + | CONNTYPE + | CONSISTENT + | CONSOLE + | CONSOLES + | CONTAINER + | CONTAINERERR + | CONTEXTTYPE + | CONVDATA + | CONVERSE + | CONVERSEST + | CONVERTER + | CONVERTST + | CONVERTTIME + | CONVID + | COPY + | COPYST + | CORRELID + | COUNTER + | COUNTRY + | COUNTRYLEN + | CP + | CPI + | CQP + | CREATE + | CREATESESS + | CRITICAL + | CRITICALST + | CRLPROFILE + | CSDERR + | CTLCHAR + | CURAUXDS + | CURRENT + | CURRENTDDS + | CURRENTHEAP + | CURRENTPROG + | CURREQS + | CURRPGM + | CURRPGMOP + | CURRTRANID + | CURRTRANIDOP + | CURRUSERID + | CURRUSERIDOP + | CWA + | CWALENG + | DAEOPTION + | DATA1 + | DATA2 + | DATABUFFERS + | DATAFORMAT + | DATALENGTH + | DATALOCATION + | DATAONLY + | DATAPOINTER + | DATASET + | DATASTR + | DATASTREAM + | DATATOXML + | DATATYPE + | DATCONTAINER + | DATEFORM + | DATESEP + | DATESTRING + | DAYCOUNT + | DAYOFMONTH + | DAYOFWEEK + | DAYOFYEAR + | DAYS + | DAYSLEFT + | DB2 + | DB2CONN + | DB2ENTRY + | DB2GROUPID + | DB2ID + | DB2PLAN + | DB2RELEASE + | DC + | DCOUNTER + | DCT + | DD + | DDMMYY + | DDMMYYYY + | DDNAME + | DEBKEY + | DEBREC + | DEBUGTOOL + | DEEDIT + | DEFINE + | DEFINESOURCE + | DEFINETIME + | DEFPAGEHT + | DEFPAGEWD + | DEFRESP + | DEFSCRNHT + | DEFSCRNWD + | DELAY + | DELETE + | DELETEQ + | DEQ + | DESTCOUNT + | DESTID + | DESTIDLENG + | DETAILLENGTH + | DEVICE + | DFHRESP + | DFHVALUE + | DFLTUSER + | DH + | DIGEST + | DIGESTTYPE + | DIRMGR + | DISABLED + | DISABLEDACT + | DISCARD + | DISCONNECT + | DISCREQST + | DISPOSITION + | DM + | DNAME + | DNAMELEN + | DOCDELETE + | DOCSIZE + | DOCSTATUS + | DOCTOKEN + | DOCUMENT + | DOMAINMGR + | DP + | DPLLIMIT + | DROLLBACK + | DS + | DS3270 + | DSALIMIT + | DSANAME + | DSNAME + | DSNAME01 + | DSNAME02 + | DSNAME03 + | DSNAME04 + | DSNAME05 + | DSNAME06 + | DSNAME07 + | DSNAME08 + | DSNAME09 + | DSNAME10 + | DSNAME11 + | DSNAME12 + | DSNAME13 + | DSNAME14 + | DSNAME15 + | DSNAME16 + | DSNAMELIST + | DSNNOTFOUND + | DSPLIST + | DSRTPROGRAM + | DSSCS + | DSSTAT + | DTIMEOUT + | DTRPROGRAM + | DU + | DUALCASEST + | DUMP + | DUMPCODE + | DUMPID + | DUMPING + | DUMPSCOPE + | DUPKEY + | DUPREC + | DUPRES + | DURATION + | DYNAMSTATUS + | EC + | ECADDR + | ECBLIST + | ECDSASIZE + | EDSALIMIT + | EI + | EIB + | EJ + | ELEMENT + | ELEMENT64 + | ELEMENTLIST + | ELEMNAME + | ELEMNAMELEN + | ELEMNS + | ELEMNSLEN + | EM + | EMITMODE + | EMPTYSTATUS + | ENABLEDCOUNT + | ENABLESTATUS + | ENCRYPTKEY + | ENDACTIVITY + | ENDBR + | ENDBROWSE + | ENDDATA + | ENDFILE + | ENDINPT + | ENDOFDAY + | ENDOFDAYHRS + | ENDOFDAYMINS + | ENDOFDAYSECS + | ENDOUTPUT + | ENDPOINT + | ENQ + | ENQBUSY + | ENQFAILS + | ENQNAME + | ENQSCOPE + | ENQUEUE + | ENTJAVA + | ENTRY + | ENTRYNAME + | ENTRYPOINT + | ENVDEFERR + | EOC + | EODS + | EOF_TOKEN + | EP + | EPADAPTER + | EPADAPTERNUM + | EPADAPTERRES + | EPADAPTERSET + | EPCDSASIZE + | EPRFIELD + | EPRFROM + | EPRINTO + | EPRLENGTH + | EPRSET + | EPRTYPE + | EPSTATUS + | EPUDSASIZE + | ERASE + | ERASEAUP + | ERDSASIZE + | ERRORMSG + | ERRORMSGLEN + | ERROROPTION + | ERRTERM + | ESDSASIZE + | ESMREASON + | ESMRESP + | EUDSASIZE + | EVENT + | EVENTBINDING + | EVENTCAPTURE + | EVENTERR + | EVENTMGR + | EVENTNAME + | EVENTPROC + | EVENTTYPE + | EVENTUAL + | EWASUPP + | EXACTMATCH + | EXCEPTCLASS + | EXCLUSIVE + | EXECKEY + | EXECUTABLE + | EXECUTIONSET + | EXIT + | EXITPGM + | EXITTRACING + | EXPECT + | EXPIRED + | EXPIRYINT + | EXPIRYINTMIN + | EXPIRYTIME + | EXTDS + | EXTENDEDDSST + | EXTRACT + | FACILITY + | FACILITYLIKE + | FACILITYTOKN + | FACILITYTYPE + | FACILNAME + | FACILTYPE + | FAULTACTLEN + | FAULTACTOR + | FAULTCODE + | FAULTCODELEN + | FAULTCODESTR + | FAULTSTRING + | FAULTSTRLEN + | FC + | FCI + | FCT + | FIELD + | FIELDLENGTH + | FIELDOFFSET + | FILE + | FILECOUNT + | FILELIMIT + | FILENAME + | FILENOTFOUND + | FILEPATH + | FILTERVALUE + | FIRESTATUS + | FLAGSET + | FLENGTH + | FMH + | FMHPARM + | FMHPARMST + | FMHSTATUS + | FORCE + | FORCEQR + | FORMATEDFST + | FORMATTIME + | FORMFEED + | FORMFEEDST + | FORMFIELD + | FREEKB + | FREEMAIN + | FREEMAIN64 + | FREQUENCY + | FREQUENCYHRS + | FREQUENCYMINS + | FREQUENCYSECS + | FROMACTIVITY + | FROMCCSID + | FROMCHANNEL + | FROMCODEPAGE + | FROMDOC + | FROMFLENGTH + | FROMLENGTH + | FROMPROCESS + | FRSET + | FULLDATE + | FUNCERR + | FWDRECOVLOG + | FWDRECOVLSN + | FWDRECSTATUS + | GAENTRYNAME + | GALENGTH + | GARBAGEINT + | GASET + | GAUSECOUNT + | GC + | GCDSASIZE + | GCHARS + | GCODES + | GCPOLICY + | GDS + | GENERIC + | GENERICTCPS + | GET + | GETMAIN + | GETMAIN64 + | GETNEXT + | GLOBALCATLG + | GMEXITOPT + | GMMI + | GMMLENGTH + | GMMTEXT + | GMMTRANID + | GRNAME + | GROUPID + | GRSTATUS + | GSDSASIZE + | GTEQ + | GTFSTATUS + | GUDSASIZE + | HA + | HANDLE + | HEAD + | HEADER + | HEALTH + | HEALTHABSTIM + | HEALTHCHECK + | HEX + | HFORMST + | HFS + | HFSFILE + | HIGH_VALUE + | HIGH_VALUES + | HILIGHT + | HILIGHTST + | HOLD + | HOLDSTATUS + | HONEOM + | HOST + | HOSTCODEPAGE + | HOSTLENGTH + | HOSTTYPE + | HOURS + | HTTPHEADER + | HTTPMETHOD + | HTTPRNUM + | HTTPVERSION + | HTTPVNUM + | IC + | IDENTIFIER + | IDLE + | IDLEHRS + | IDLEMINS + | IDLESECS + | IDNTYCLASS + | IDPROP + | IE + | IGNORE + | IGREQCD + | IGREQID + | ILLOGIC + | IMMEDIATE + | INBFMH + | INCOMPLETE + | INCREMENT + | INDIRECTNAME + | INDOUBT + | INDOUBTMINS + | INDOUBTST + | INDOUBTWAIT + | INITHEAP + | INITIALDDS + | INITIMG + | INITPARM + | INITPARMLEN + | INITQNAME + | INITSTATUS + | INITUSERID + | INPARTN + | INPUTEVENT + | INPUTMSG + | INPUTMSGLEN + | INQUIRE + | INSTALLAGENT + | INSTALLTIME + | INSTALLUSRID + | INTEGER + | INTERVAL + | INTERVALHRS + | INTERVALMINS + | INTERVALSECS + | INTOCCSID + | INTOCODEPAGE + | INTSTATUS + | INVALIDCOUNT + | INVERRTERM + | INVEXITREQ + | INVITE + | INVLDC + | INVMPSZ + | INVOKE + | INVOKETYPE + | INVOKINGPROG + | INVPARTN + | INVPARTNSET + | INVREQ + | INVTSREQ + | IOERR + | IOTYPE + | IPADDRESS + | IPCONN + | IPECI + | IPFACILITIES + | IPFACILTYPE + | IPFAMILY + | IPFLISTSIZE + | IPRESOLVED + | IS + | ISCINVREQ + | ISOLATEST + | ISSUE + | ISSUER + | ISUSERID + | ITEM + | ITEMERR + | ITEMNAME + | IUTYPE + | JAVAHOME + | JCT + | JIDERR + | JOBLIST + | JOBNAME + | JOURNALNAME + | JOURNALNUM + | JTYPEID + | JUSFIRST + | JUSLAST + | JUSTIFY + | JVMCLASS + | JVMPROFILE + | JVMPROGRAM + | JVMSERVER + | JWT + | KATAKANA + | KATAKANAST + | KC + | KE + | KEEP + | KEEPTIME + | KERBEROS + | KERNEL + | KEYLENGTH + | KEYNUMBER + | KEYPOSITION + | L40 + | L64 + | L80 + | LANGDEDUCED + | LANGINUSE + | LANGUAGE + | LANGUAGECODE + | LASTACTTIME + | LASTCOLDTIME + | LASTEMERTIME + | LASTINITTIME + | LASTMODTIME + | LASTRESET + | LASTRESETABS + | LASTRESETHRS + | LASTRESETMIN + | LASTRESETSEC + | LASTUSEDINT + | LASTUSETIME + | LASTWARMTIME + | LASTWRITTIME + | LATSECDTIME + | LD + | LDC + | LDCMNEM + | LDCNUM + | LEAVEKB + | LENGERR + | LENGTH + | LENGTHLIST + | LERUNOPTS + | LEVEL + | LG + | LIBRARY + | LIBRARYDSN + | LIGHTPEN + | LIGHTPENST + | LINAGE_COUNTER + | LINEADDR + | LINK + | LINKABEND + | LINKAGE + | LINKAUTH + | LINKLEVEL + | LINKSYSNET + | LINKSYSTEM + | LIST + | LISTLENGTH + | LISTSIZE + | LLID + | LM + | LOAD + | LOADER + | LOADING + | LOADPOINT + | LOADTYPE + | LOCALCATLG + | LOCALCCSID + | LOCALITY + | LOCALITYLEN + | LOCATION + | LOCKED + | LOCKMGR + | LOG + | LOGDEFER + | LOGGER + | LOGMESSAGE + | LOGMODE + | LOGONLOGMODE + | LOGONMSG + | LOGREPSTATUS + | LOSTLOCKS + | LOW_VALUE + | LOW_VALUES + | LPASTATUS + | LSRPOOL + | LSRPOOLNUM + | LUNAME + | MAIN + | MAJORVERSION + | MANAGEDPLAT + | MAP + | MAPCOLUMN + | MAPFAIL + | MAPHEIGHT + | MAPLINE + | MAPNAME + | MAPONLY + | MAPPED + | MAPPINGDEV + | MAPPINGLEVEL + | MAPPINGRNUM + | MAPPINGVNUM + | MAPSET + | MAPSETNAME + | MAPWIDTH + | MASSINSERT + | MAXACTIVE + | MAXDATALEN + | MAXFLENGTH + | MAXHEAP + | MAXIMUM + | MAXITEMLEN + | MAXLENGTH + | MAXLIFETIME + | MAXNUMRECS + | MAXOPENTCBS + | MAXPERSIST + | MAXPROCLEN + | MAXQTIME + | MAXREQS + | MAXSOCKETS + | MAXSSLTCBS + | MAXTASKS + | MAXTHRDTCBS + | MAXWINNERS + | MAXXPTCBS + | MCC + | ME + | MEDIATYPE + | MEMBER + | MEMBERNAME + | MEMLIMIT + | MESSAGECASE + | MESSAGEID + | METADATA + | METADATAFILE + | METADATALEN + | METHODLENGTH + | MGMTPART + | MICROVERSION + | MILLISECONDS + | MINIMUM + | MINITEMLEN + | MINORVERSION + | MINRUNLEVEL + | MINRUNRNUM + | MINRUNVNUM + | MINUTES + | MIRRORLIFE + | ML + | MMDDYY + | MMDDYYYY + | MN + | MODE + | MODELIDERR + | MODENAME + | MONDATA + | MONITOR + | MONSTATUS + | MONTH + | MONTHOFYEAR + | MONUSERID + | MP + | MQCONN + | MQNAME + | MQQMGR + | MQRELEASE + | MROBATCH + | MSGFORMAT + | MSGQUEUE1 + | MSGQUEUE2 + | MSGQUEUE3 + | MSR + | MSRCONTROL + | MSRCONTROLST + | MTOMNOXOPST + | MTOMST + | MVSIMAGE + | MVSSMFID + | MVSSYSNAME + | NAME + | NAMELENGTH + | NAMESPACE + | NATLANG + | NATLANGINUSE + | NATURE + | NETID + | NETNAME + | NETNAMEIDERR + | NETUOWID + | NETWORK + | NETWORKID + | NEWPASSWORD + | NEWPHRASE + | NEWPHRASELEN + | NEWSECDCOUNT + | NEXTTIME + | NEXTTIMEHRS + | NEXTTIMEMINS + | NEXTTIMESECS + | NEXTTRANSID + | NLEOM + | NOAUTOPAGE + | NOCC + | NOCHECK + | NOCLICONVERT + | NOCLOSE + | NODATA + | NODE + | NODEHOME + | NODEIDERR + | NODOCDELETE + | NODUMP + | NOEDIT + | NOFLUSH + | NOHANDLE + | NOINCONVERT + | NOJBUFSP + | NOLOG + | NONE + | NONTERMREL + | NONVAL + | NOOUTCONVERT + | NOPASSBKRD + | NOPASSBKWR + | NOQUEUE + | NOQUIESCE + | NORMAL + | NOSPACE + | NOSPOOL + | NOSRVCONVERT + | NOSTART + | NOSTG + | NOSUSPEND + | NOTALLOC + | NOTAUTH + | NOTE + | NOTFINISHED + | NOTFND + | NOTOPEN + | NOTPURGEABLE + | NOTRUNCATE + | NOTSUPERUSER + | NOWAIT + | NQ + | NQNAME + | NSCONTAINER + | NUMCIPHERS + | NUMDATAPRED + | NUMDSNAMES + | NUMELEMENTS + | NUMEVENTS + | NUMEXITS + | NUMINFOSRCE + | NUMITEMS + | NUMOPTPRED + | NUMREC + | NUMROUTES + | NUMSEGMENTS + | NUMTAB + | OBFORMATST + | OBJECT + | OBJECTTRAN + | OBOPERIDST + | OCCUPANCY + | ODADPTRDATA1 + | ODADPTRDATA2 + | ODADPTRDATA3 + | ODADPTRID + | ODAPPLID + | ODCLNTIPADDR + | ODCLNTPORT + | ODFACILNAME + | ODFACILTYPE + | ODIPFAMILY + | ODLUNAME + | ODNETID + | ODNETWORKID + | ODSERVERPORT + | ODSTARTTIME + | ODTASKID + | ODTCPIPS + | ODTRANSID + | ODUSERID + | OIDCARD + | OPCLASS + | OPENERR + | OPENSTATUS + | OPERATION + | OPERATOR + | OPERID + | OPERKEYS + | OPERPURGE + | OPID + | OPREL + | OPSECURITY + | OPSYS + | OPTIONNAME + | OPTIONS + | OPTIONSPGM + | ORGABCODE + | ORGANIZATLEN + | ORGUNIT + | ORGUNITLEN + | OSGIBUNDLE + | OSGIBUNDLEID + | OSGISTATUS + | OSGIVERSION + | OSLEVEL + | OT + | OTSTID + | OTSTIMEOUT + | OUTDESCR + | OUTDESCRERR + | OUTLINE + | OUTLINEST + | OUTPARTN + | OUTTOKEN + | OUTTOKENLEN + | OVERFLOW + | OWNER + | PA + | PA1 + | PA2 + | PA3 + | PAGE_COUNTER + | PAGEHT + | PAGENUM + | PAGESTATUS + | PAGEWD + | PAGING + | PARAMGR + | PARSE + | PARTCLASS + | PARTCOUNT + | PARTITIONSET + | PARTITIONSST + | PARTN + | PARTNER + | PARTNERIDERR + | PARTNFAIL + | PARTNPAGE + | PARTNS + | PARTNSET + | PARTTYPE + | PASS + | PASSBK + | PASSWORDLEN + | PATCH + | PATH + | PATHLENGTH + | PC + | PCDSASIZE + | PCT + | PENDSTATUS + | PERFCLASS + | PF1 + | PF10 + | PF11 + | PF12 + | PF13 + | PF14 + | PF15 + | PF16 + | PF17 + | PF18 + | PF19 + | PF2 + | PF20 + | PF21 + | PF22 + | PF23 + | PF24 + | PF3 + | PF4 + | PF5 + | PF6 + | PF7 + | PF8 + | PF9 + | PFXLENG + | PG + | PGMIDERR + | PGMINTERFACE + | PHAPPLID + | PHCOUNT + | PHNETWORKID + | PHRASE + | PHRASELEN + | PHSTARTTIME + | PHTASKID + | PHTRANSID + | PI + | PID + | PIPELINE + | PIPEMGR + | PIPLENGTH + | PIPLIST + | PLAN + | PLANEXITNAME + | PLATFORM + | PLTPIUSR + | POINT + | POLICY + | POOL + | POOLERR + | POOLNAME + | POP + | PORT + | PORTNUMBER + | PORTNUMNU + | POST + | PPT + | PREDICATE + | PREFIX + | PREPARE + | PRIMPRED + | PRIMPREDOP + | PRIMPREDTYPE + | PRINCONVID + | PRINSYSID + | PRINT + | PRINTADAPTST + | PRINTCONTROL + | PRINTER + | PRIORITY + | PRIVACY + | PROCESS + | PROCESSBUSY + | PROCESSERR + | PROCESSTYPE + | PROCLENGTH + | PROCNAME + | PROFILE + | PROFILEDIR + | PROFILEIDERR + | PROGAUTO + | PROGAUTOCTLG + | PROGAUTOEXIT + | PROGAUTOINST + | PROGMGR + | PROGRAM + | PROGRAMDEF + | PROGSYMBOLST + | PROGTYPE + | PROTECT + | PROTECTNUM + | PROTOCOL + | PRTCOPYST + | PRTYAGING + | PS + | PSB + | PSDINTERVAL + | PSDINTHRS + | PSDINTMINS + | PSDINTSECS + | PSTYPE + | PT + | PTCOUNT + | PTHREADS + | PTSTARTTIME + | PTTASKID + | PTTRANSID + | PUDSASIZE + | PUNCH + | PURGEABILITY + | PURGEABLE + | PURGEABLEST + | PURGEACTION + | PURGECYCLEM + | PURGECYCLES + | PURGETHRESH + | PUSH + | PUT + | QBUSY + | QIDERR + | QNAME + | QUALIFIER + | QUALLEN + | QUERY + | QUERYPARM + | QUERYST + | QUERYSTRING + | QUERYSTRLEN + | QUEUE + | QUEUED + | QUEUELIMIT + | QUIESCESTATE + | QZERO + | RA + | RANKING + | RBA + | RBATYPE + | RBN + | RDATT + | RDSASIZE + | READ + | READINTEG + | READNEXT + | READPREV + | READQ + | REALM + | REALMLEN + | REASON + | REATTACH + | RECEIVECOUNT + | RECEIVER + | RECFM + | RECORDBUSY + | RECORDFORMAT + | RECORDING + | RECORDLEN + | RECORDLENGTH + | RECORDSIZE + | RECOVERY + | RECOVSTATUS + | REDIRECTTYPE + | REDUCE + | REENTPROTECT + | REFPARMS + | REFPARMSLEN + | REGIONSTAT + | REGIONUSERID + | RELATESINDEX + | RELATESTYPE + | RELATESURI + | RELATION + | RELEASE + | RELREQST + | RELTYPE + | REMOTENAME + | REMOTEPREFIX + | REMOTESYSNET + | REMOTESYSTEM + | REMOTETABLE + | REMOVE + | REPEATABLE + | REPETABLE + | REPLICATION + | REPLY + | REPLYLENGTH + | REQID + | REQTYPE + | REQUESTSTRM + | REQUESTTYPE + | RES + | RESCLASS + | RESCOUNT + | RESETBR + | RESID + | RESIDENCY + | RESIDERR + | RESIDLEN + | RESIDLENGTH + | RESLEN + | RESLIFEMGR + | RESNAME + | RESOURCE + | RESOURCENAME + | RESOURCETYPE + | RESP + | RESP2 + | RESPWAIT + | RESRCECLASS + | RESSEC + | RESTART + | RESTYPE + | RESULT + | RESUME + | RESUNAVAIL + | RESYNCMEMBER + | RESYNCNUMBER + | RESYNCSTATUS + | RETAIN + | RETCODE + | RETCORD + | RETLOCKS + | RETPAGE + | RETRIECE + | RETRIEVE + | RETURNPROG + | REUSELIMIT + | REWIND + | RI + | RIDFLD + | RL + | RLSACCESS + | RLSSTATUS + | RM + | RMI + | RMIADAPTERS + | RMIQFY + | RMIST + | ROLE + | ROLELENGTH + | ROLLBACK + | ROLLEDBACK + | ROUTE + | ROUTECODES + | ROUTESTATUS + | ROUTING + | RPROCESS + | RRESOURCE + | RRN + | RRS + | RS + | RTEFAIL + | RTERMID + | RTESOME + | RTIMEOUT + | RTRANSID + | RULEGROUP + | RULEITEM + | RULETYPE + | RUNAWAY + | RUNAWAYTYPE + | RUNSTATUS + | RUNTIME + | RX + | RZ + | SADDRLENGTH + | SC + | SCANDELAY + | SCHEDULER + | SCHEMALEVEL + | SCHEME + | SCHEMENAME + | SCOPE + | SCOPELEN + | SCRNHT + | SCRNSIZE + | SCRNWD + | SDSASIZE + | SDTMEMLIMIT + | SDTRAN + | SEARCHPOS + | SECDCOUNT + | SECONDS + | SECPORT + | SECURITY + | SECURITYMGR + | SECURITYNAME + | SECURITYST + | SEGIDERR + | SEGMENTLIST + | SELNERR + | SENDCOUNT + | SENDER + | SENDMTOMST + | SERIALNUM + | SERIALNUMLEN + | SERVER + | SERVERADDR + | SERVERADDRNU + | SERVERCONV + | SERVERIPADDR + | SERVERNAME + | SERVERPORT + | SERVSTATUS + | SESSBUSY + | SESSION + | SESSIONERR + | SESSIONS + | SESSIONTYPE + | SESSTOKEN + | SET + | SETTRANSID + | SH + | SHARED + | SHARELOCKS + | SHARESTATUS + | SHELF + | SHUTDOWN + | SHUTDOWNST + | SHUTOPTION + | SHUTSTATUS + | SIGDATA + | SIGNAL + | SIGNID + | SIGNOFF + | SIGNON + | SIGNONSTATUS + | SINGLESTATUS + | SIT + | SJ + | SJVM + | SM + | SNAMELENGTH + | SO + | SOAPFAULT + | SOAPLEVEL + | SOAPRNUM + | SOAPVNUM + | SOCKETCLOSE + | SOCKETS + | SOCKPOOLSIZE + | SOSABOVEBAR + | SOSABOVELINE + | SOSBELOWLINE + | SOSI + | SOSIST + | SOSSTATUS + | SPECIFTCPS + | SPIST + | SPOLBUSY + | SPOLERR + | SPOOLCLOSE + | SPOOLOPEN + | SPOOLREAD + | SPOOLWRITE + | SRRSTATUS + | SRRTASKS + | SRVCNAME + | SRVCONVERT + | SRVCSTATUS + | SRVRADDR6NU + | SRVRIPFAMILY + | SSLCACHE + | SSLTYPE + | ST + | STANDBYMODE + | STARTBR + | STARTBROWSE + | STARTCODE + | STARTSCRIPT + | STARTSTATUS + | STARTTIME + | STARTUP + | STARTUPDATE + | STATE + | STATELEN + | STATIONID + | STATS + | STATSQUEUE + | STATUS + | STATUSCODE + | STATUSLEN + | STATUSTEXT + | STDERR + | STDOUT + | STORAGE + | STORAGECLEAR + | STOREPROTECT + | STREAMNAME + | STRELERR + | STRFIELD + | STRINGFORMAT + | STRINGS + | STRINGZONE + | STRUCTNAME + | SUBADDR + | SUBCODELEN + | SUBCODESTR + | SUBEVENT + | SUBEVENT1 + | SUBEVENT2 + | SUBEVENT3 + | SUBEVENT4 + | SUBEVENT5 + | SUBEVENT6 + | SUBEVENT7 + | SUBEVENT8 + | SUBRESID + | SUBRESIDLEN + | SUBRESTYPE + | SUBTASKS + | SUBTASKS + | SUPPRESSED + | SUSPEND + | SUSPENDTIME + | SUSPENDTYPE + | SUSPENDVALUE + | SUSPSTATUS + | SWITCHSTATUS + | SYMBOL + | SYMBOLERR + | SYMBOLLIST + | SYNCHRONOUS + | SYNCLEVEL + | SYNCONRETURN + | SYNCPOINT + | SYNCPOINTST + | SYSBUSY + | SYSDUMPING + | SYSID + | SYSIDERR + | SYSOUTCLASS + | SYSTEMLOG + | SYSTEMSTATUS + | SZ + | TABLE + | TABLENAME + | TABLES + | TABLESIZE + | TALENGTH + | TARGETCOUNT + | TASK + | TASKDATAKEY + | TASKDATALOC + | TASKID + | TASKIDERR + | TASKPRIORITY + | TASKS + | TASKSTARTST + | TASKSUBPOOL + | TC + | TCAMCONTROL + | TCB + | TCBLIMIT + | TCBS + | TCEXITSTATUS + | TCIDERR + | TCLASS + | TCPIP + | TCPIPJOB + | TCPIPSERVICE + | TCPIPZONE + | TCT + | TCTUA + | TCTUALENG + | TD + | TDQUEUE + | TELLERID + | TEMPLATE + | TEMPLATENAME + | TEMPLATERR + | TEMPLATETYPE + | TERMCODE + | TERMERR + | TERMID + | TERMIDERR + | TERMINAL + | TERMMODEL + | TERMPRIORITY + | TERMSTATUS + | TEXTKYBD + | TEXTKYBDST + | TEXTLENGTH + | TEXTPRINT + | TEXTPRINTST + | THREADCOUNT + | THREADERROR + | THREADLIMIT + | THREADS + | THREADWAIT + | THRESHOLD + | TI + | TIME + | TIMEDOUT + | TIMEOUT + | TIMEOUTINT + | TIMER + | TIMERERR + | TIMESEP + | TNADDR + | TNIPFAMILY + | TNPORT + | TOACTIVITY + | TOCHANNEL + | TOCONTAINER + | TOFLENGTH + | TOKEN + | TOKENERR + | TOKENLEN + | TOKENTYPE + | TOLENGTH + | TOPROCESS + | TPNAME + | TPNAMELEN + | TR + | TRACE + | TRACENUM + | TRACING + | TRAILER + | TRAN + | TRANCLASS + | TRANDUMPING + | TRANISOLATE + | TRANMGR + | TRANPRIORITY + | TRANSACTION + | TRANSCLASS + | TRANSFORM + | TRANSID + | TRANSIDERR + | TRANSMODE + | TRIGGER + | TRIGGERLEVEL + | TRIGMONTASKS + | TRNGRPID + | TRPROF + | TRT + | TS + | TSIOERR + | TSMAININUSE + | TSMAINLIMIT + | TSMODEL + | TSQUEUE + | TSQUEUELIMIT + | TST + | TTISTATUS + | TWA + | TWALENG + | TWASIZE + | TYPE + | TYPENAME + | TYPENAMELEN + | TYPENS + | TYPENSLEN + | TYPETERM + | UCTRANST + | UDSASIZE + | UE + | UNATTEND + | UNCOMMITTED + | UNESCAPED + | UNEXPIN + | UNLOCK + | UOW + | UOWLNOTFOUND + | UOWNOTFOUND + | UOWSTATE + | UPDATE + | UPDATEMODEL + | URI + | URID + | URIMAP + | URIMAPLIMIT + | URL + | URLLENGTH + | URM + | US + | USAGE + | USECOUNT + | USER + | USERAREA + | USERAREALEN + | USERAUTH + | USERCORRDATA + | USERDATAKEY + | USERID + | USERIDERR + | USERNAME + | USERNAMELEN + | USERPRIORITY + | USERSTATUS + | USERTAG + | UTIL + | VALIDATION + | VALIDATIONST + | VALIDITY + | VALUE + | VALUELENGTH + | VARIABLENAME + | VERIFY + | VERSIONLEN + | VFORMST + | VOLIDERR + | VOLUME + | VOLUMELENG + | W2 + | WAIT + | WAITCAUSE + | WAITCICS + | WAITSTATE + | WB + | WEB + | WEB2 + | WEBRESTMGR + | WEBSERVICE + | WEBSERVLIMIT + | WHEN_COMPILED + | WLMOPENST + | WORKDIR + | WPMEDIA1 + | WPMEDIA2 + | WPMEDIA3 + | WPMEDIA4 + | WRAP + | WRBRK + | WRITEQ + | WSACONTEXT + | WSAEPR + | WSBIND + | WSDIR + | WSDLFILE + | WU + | XCFGROUP + | XCTL + | XID + | XLNSTATUS + | XM + | XMLCONTAINER + | XMLSCHEMA + | XMLTODATA + | XMLTRANSFORM + | XOPDIRECTST + | XOPSUPPORTST + | XRBA + | XRFSTATUS + | XS | XSDBIND + | YEAR + | YYDDD + | YYDDMM + | YYMMDD + | YYYYDDD + | YYYYDDMM + | YYYYMMDD + | ZCPTRACING + ; name: variableNameUsage+; data_value: variableNameUsage+; diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecLexer.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecLexer.g4 index ae319e4eee..ef6880c7ea 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecLexer.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecLexer.g4 @@ -53,7 +53,6 @@ AS : A S; ASC : A S C; ASCII : A S C I I; ASENSITIVE : A S E N S I T I V E; -ASSEMBLE : A S S E M B L E; ASSOCIATE : A S S O C I A T E; ASUTIME : A S U T I M E; AT : A T; @@ -72,7 +71,6 @@ BEGIN : B E G I N; BETWEEN : B E T W E E N; BIGINT : B I G I N T; BINARY : B I N A R Y; -BINARY_STRING_CONSTANT : BXNUMBER; BIND : B I N D; BINDADD : B I N D A D D; BINDAGENT : B I N D A G E N T; @@ -120,7 +118,6 @@ CLONE : C L O N E; CLOSE : C L O S E; CLUSTER : C L U S T E R; COALESCE : C O A L E S C E; -COBOL : C O B O L; COLLECTION : C O L L E C T I O N; COLLID : C O L L I D; COLUMN : C O L U M N; @@ -339,7 +336,7 @@ FREEPAGE : F R E E P A G E; FROM : F R O M; FULL : F U L L; FUNCTION : F U N C T I O N; -FUNCTION_LEVEL_10: V '1' ZERO_DIGIT R '1'; +FUNCTION_LEVEL_10: V '1' '0' R '1'; FUNCTION_LEVEL_11: V '1' '1' R '1'; FUNCTION_LEVEL_12: V DIGIT DIGIT R DIGIT M DIGIT DIGIT DIGIT; GBPCACHE : G B P C A C H E; @@ -356,7 +353,6 @@ GRANT : G R A N T; GRAPHIC : G R A P H I C; GROUP : G R O U P; GROUPING : G R O U P I N G; -G_CHAR: G; HANDLER : H A N D L E R; HASH : H A S H; HAVING : H A V I N G; @@ -404,19 +400,16 @@ ISO : I S O; ISOLATION : I S O L A T I O N; ITERATE : I T E R A T E; JAR : J A R; -JAVA : J A V A; JIS : J I S; JOBNAME: J O B N A M E; JOIN : J O I N; KEEP : K E E P; KEY : K E Y; KEYS : K E Y S; -K_CHAR: K; LABEL : L A B E L; LABELS : L A B E L S; LAG: L A G; LANGUAGE : L A N G U A G E; -LANGUAGE_C : C; LARGE : L A R G E; LAST : L A S T; LAST_VALUE: L A S T UNDERSCORECHAR V A L U E; @@ -475,7 +468,6 @@ MONTHS : M O N T H S; MORECHAR : M O R E; MOVE : M O V E; MULTIPLIER : M U L T I P L I E R; -M_CHAR: M; NAME : N A M E; NAMES : N A M E S; NAMESPACE : N A M E S P A C E; @@ -553,7 +545,6 @@ PERIOD : P E R I O D; PERMISSION : P E R M I S S I O N; PIECESIZE : P I E C E S I Z E; PLAN : P L A N; -PLI : P L I; PORTION : P O R T I O N; POSITION : P O S I T I O N; POSITIONING : P O S I T I O N I N G; @@ -675,7 +666,6 @@ SOURCE : S O U R C E; SPACE : S P A C E; SPECIAL : S P E C I A L; SPECIFIC : S P E C I F I C; -SQL : S Q L; SQLIMS: S Q L I M S; SQLADM : S Q L A D M; SQLCA : S Q L C A; @@ -839,7 +829,6 @@ SEMICOLONSEPARATORSQL : '; ' ; COMMASEPARATORDB2 : ', ' ; // Constructors symbols -GRAPHIC_CONSTANT : GRAPHICUNICODE | GRAHICCHAR; DOUBLESLASHCHAR : '//'; LSQUAREBRACKET : '['; RSQUAREBRACKET : ']'; @@ -847,9 +836,6 @@ PIPECHAR : '||'; PIPECHAR2 : '!!'; QUESTIONMARK : '?'; PERCENT : '%'; -SELECT_ALL : '.*'; -SINGLEDIGIT_1: '1'; -DOUBLEDIGIT_1: '01'; TIMESTAMPLITERAL: DIGIT DIGIT '.' DIGIT DIGIT '.' DIGIT DIGIT | // hh.mm.ss; DIGIT DIGIT '.' DIGIT DIGIT (A M | P M) | //hh:mm AM /PM DIGIT DIGIT '.' DIGIT DIGIT ':' DIGIT DIGIT |// hh.mm:ss @@ -859,10 +845,8 @@ DATELITERAL: '\'' (DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT | //y DIGIT DIGIT '.' DIGIT DIGIT '.' DIGIT DIGIT DIGIT DIGIT |//dd.mm.yyyy DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT DIGIT DIGIT) TIMESTAMPLITERAL? '\'';//yyyy-mm-dd -SINGLEDIGITLITERAL : DIGIT; INTEGERLITERAL : DIGIT+; IDENTIFIER : [\p{Alnum}\p{General_Category=Other_Letter}] [-_\p{Alnum}\p{General_Category=Other_Letter}]*; - NUMERICLITERAL : (PLUSCHAR | MINUSCHAR)? ( (DOT_FS | COMMACHAR { commaCharAllowed }?) DIGIT+ (('e' | 'E') (PLUSCHAR | MINUSCHAR)? DIGIT+)? @@ -880,14 +864,11 @@ NUMERICLITERAL : (PLUSCHAR | MINUSCHAR)? ) ); -NONNUMERICLITERAL : UNTRMSTRINGLITERAL | STRINGLITERAL | DBCSLITERAL | HEXNUMBER | NULLTERMINATED; - -CHAR_STRING_CONSTANT : HEXNUMBER | STRINGLITERAL; - -FILENAME : IDENTIFIER+ '.' IDENTIFIER+; +CHAR_STRING_LITERAL: STRINGLITERAL; +HEXSTRING: HEXNUMBER; +BXSTRING: BXNUMBER; +GRAPHIC_CONSTANT : GRAPHICUNICODE | GRAHICCHAR; -OCTDIGITS : OCT_DIGIT; -HEX_NUMBERS : HEXNUMBER; // whitespace, line breaks, comments, ... NEWLINE : '\r'? '\n' -> channel(HIDDEN); WS : [ \t\f]+ -> channel(HIDDEN); @@ -900,51 +881,32 @@ SQLLINECOMMENT // treat all the non-processed tokens as errors ERRORCHAR : . ; -ZERO_DIGIT: '0'; - fragment HEXNUMBER : X '"' [0-9A-Fa-f]+ '"' | X '\'' [0-9A-Fa-f]+ '\'' ; -fragment NULLTERMINATED : - Z '"' (~["\n\r] | '""' | '\'')* '"' - | Z '\'' (~['\n\r] | '\'\'' | '"')* '\'' -; - -fragment STRINGLITERAL : - '"' (~["\n\r] | '""' | '\'')* '"' - | '\'' (~['\n\r] | '\'\'' | '"')* '\'' -; - -fragment UNTRMSTRINGLITERAL : - '"' (~["\n\r] | '""' | '\'')* - | '\'' (~['\n\r] | '\'\'' | '"')* -; - -fragment DBCSLITERAL : - [GN] '"' (~["\n\r] | '""' | '\'')* '"' - | [GN] '\'' (~['\n\r] | '\'\'' | '"')* '\'' -; - fragment BXNUMBER : - B X '"' [0-9A-F]+ '"' - | B X '\'' [0-9A-F]+ '\'' + B X '"' [0-9A-Fa-f]+ '"' + | B X '\'' [0-9A-Fa-f]+ '\'' ; fragment GRAPHICUNICODE : - U X '"' [0-9A-F]+ '"' - | U X '\'' [0-9A-F]+ '\'' + U X '"' [0-9A-Fa-f]+ '"' + | U X '\'' [0-9A-Fa-f]+ '\'' ; fragment GRAHICCHAR : - G X '"' [0-9A-F]+ '"' - | G X '\'' [0-9A-F]+ '\'' + G X '"' [0-9A-Fa-f]+ '"' + | G X '\'' [0-9A-Fa-f]+ '\'' +; + +fragment STRINGLITERAL : + '"' (~["\n\r] | '""' | '\'')* '"' + | '\'' (~['\n\r] | '\'\'' | '"')* '\'' ; -fragment - OCT_DIGIT : [0-8] ; - fragment DIGIT: OCT_DIGIT | [9]; + fragment DIGIT: [0-9]; // case insensitive chars fragment A:('a'|'A'); fragment B:('b'|'B'); diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecParser.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecParser.g4 index 2f0595b86f..95ab00ee7d 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecParser.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecParser.g4 @@ -38,7 +38,7 @@ procedureDivisionRule: dbs_allocate | dbs_explain | dbs_fetch | dbs_free - | dbs_get + | dbs_get_diagnostics_statement | dbs_grant | dbs_hold | dbs_insert @@ -86,14 +86,14 @@ dbs_declare_variable: DECLARE dbs_host_variable (dbs_comma_separator dbs_host_va dbs_declare_variable_for: FOR (SBCS|MIXED|BIT) DATA; /*ALLOCATE CURSOR */ -dbs_allocate: ALLOCATE dbs_cursor_name CURSOR FOR RESULT SET dbs_rs_locator_variable; +dbs_allocate: ALLOCATE dbs_cursor_name CURSOR FOR RESULT SET dbs_host_variable; /*ALTER (all) */ dbs_alter: ALTER (dbs_alter_database | dbs_alter_function | dbs_alter_index | dbs_alter_mask | dbs_alter_permission | dbs_alter_procedure | dbs_alter_sequence | dbs_alter_stogroup | dbs_alter_table | dbs_alter_tablespace | dbs_alter_trigger | dbs_alter_trusted | dbs_alter_view); /*ALTER DATABASE */ -dbs_alter_database: DATABASE dbs_database_name (BUFFERPOOL dbs_bp_name | INDEXBP dbs_bp_name | STOGROUP dbs_stogroup_name | CCSID dbs_ccsid_value)+; +dbs_alter_database: DATABASE dbs_database_name (BUFFERPOOL dbs_bp_name | INDEXBP dbs_bp_name | STOGROUP dbs_stogroup_name | CCSID INTEGERLITERAL)+; /*ALTER FUNCTION */ dbs_alter_function: (dbs_alter_function_external | dbs_alter_function_compiled | dbs_alter_function_inline | dbs_alter_function_sqlTable); @@ -102,11 +102,11 @@ dbs_alter_function_sqlTable : SPECIFIC FUNCTION dbs_specific_name | FUNCTION dbs RESTRICT dbs_alter_function_inlineopts; dbs_alter_function_external: (SPECIFIC FUNCTION dbs_specific_name | FUNCTION dbs_function_name (LPARENCHAR ((common_built_in_type_source | dbs_distinct_type_name) (AS LOCATOR)? (dbs_comma_separator (common_built_in_type_source | dbs_distinct_type_name) (AS LOCATOR)?)*)? RPARENCHAR)?) dbs_alter_function_extopts; -dbs_alter_function_extopts: (EXTERNAL NAME (dbs_external_program_name | dbs_identifier) | LANGUAGE (ASSEMBLE| LANGUAGE_C |COBOL|JAVA|PLI) | PARAMETER STYLE (SQL|JAVA) | NOT? DETERMINISTIC | - (RETURNS NULL|CALLED) ON NULL INPUT | ((MODIFIES|READS) SQL DATA | (CONTAINS|NO) SQL) | NO? EXTERNAL ACTION | (PACKAGE PATH dbs_package_path | NO PACKAGE PATH) | - (NO SCRATCHPAD | SCRATCHPAD dbs_length) | NO? FINAL CALL | (ALLOW|DISALLOW) PARALLEL | NO? DBINFO | CARDINALITY dbs_integer | (NO COLLID | COLLID dbs_collection_id) | WLM ENVIRONMENT | - (dbs_name | LPARENCHAR dbs_name dbs_comma_separator ASTERISKCHAR RPARENCHAR) | ASUTIME (NO LIMIT | LIMIT dbs_integer) | STAY RESIDENT (YES|NO) | PROGRAM TYPE (SUB|MAIN) | - SECURITY (DB2|USER|DEFINER) | (STOP AFTER (SYSTEM DEFAULT|dbs_integer) FAILURES | CONTINUE AFTER FAILURE) | RUN OPTIONS dbs_run_time_options | (INHERIT|DEFAULT) SPECIAL REGISTERS | +dbs_alter_function_extopts: (EXTERNAL NAME dbs_external_program_name | LANGUAGE dbs_function_language | PARAMETER STYLE dbs_function_parameter_style | NOT? DETERMINISTIC | + (RETURNS NULL|CALLED) ON NULL INPUT | ((MODIFIES|READS) dbs_exact_match_identifier_sql DATA | (CONTAINS|NO) dbs_exact_match_identifier_sql) | NO? EXTERNAL ACTION | (PACKAGE PATH dbs_package_path | NO PACKAGE PATH) | + (NO SCRATCHPAD | SCRATCHPAD INTEGERLITERAL) | NO? FINAL CALL | (ALLOW|DISALLOW) PARALLEL | NO? DBINFO | CARDINALITY INTEGERLITERAL | (NO COLLID | COLLID dbs_collection_id) | WLM ENVIRONMENT | + (dbs_sql_identifier | LPARENCHAR dbs_sql_identifier dbs_comma_separator ASTERISKCHAR RPARENCHAR) | ASUTIME (NO LIMIT | LIMIT INTEGERLITERAL) | STAY RESIDENT (YES|NO) | PROGRAM TYPE (SUB|MAIN) | + SECURITY (DB2|USER|DEFINER) | (STOP AFTER (SYSTEM DEFAULT|INTEGERLITERAL) FAILURES | CONTINUE AFTER FAILURE) | RUN OPTIONS dbs_string_constant | (INHERIT|DEFAULT) SPECIAL REGISTERS | STATIC DISPATCH | NOT? SECURED)+; /*random ordering req */ dbs_alter_function_compiled: (SPECIFIC FUNCTION dbs_specific_name | FUNCTION dbs_function_name (LPARENCHAR (dbs_generic_name (common_built_in_type_source | XML | data_type_arr_or_distinct) (dbs_comma_separator dbs_generic_name (common_built_in_type_source | XML | data_type_arr_or_distinct))*)? RPARENCHAR)?) (dbs_alter_function_alter | dbs_alter_function_replace | dbs_alter_function_add | dbs_alter_function_activate | dbs_alter_function_regen | dbs_alter_function_drop); @@ -118,28 +118,28 @@ dbs_alter_function_regen: REGENERATE (ACTIVE VERSION | VERSION dbs_routine_versi dbs_alter_function_drop: DROP VERSION dbs_routine_version_id; dbs_alter_function_routine: LPARENCHAR (dbs_parameter_name (common_built_in_type_source | data_type_arr_or_distinct) (dbs_comma_separator (common_built_in_type_source | data_type_arr_or_distinct))*)? RPARENCHAR RETURNS common_built_in_type_source dbs_alter_function_compopts? dbs_sql_control_statement; -dbs_alter_function_compopts: (NOT? DETERMINISTIC | NO? EXTERNAL ACTION | ((READS|MODIFIES) SQL DATA | CONTAINS SQL) | (CALLED|RETURNS NULL) ON NULL INPUT | STATIC DISPATCH | (ALLOW|DISALLOW) PARALLEL | - (DISALLOW|ALLOW|DISABLE) DEBUG MODE | QUALIFIER dbs_schema_name | PACKAGE OWNER dbs_authorization_name | ASUTIME (NO LIMIT | LIMIT dbs_integer) | (INHERIT|DEFAULT) SPECIAL REGISTERS | - WLM ENVIRONMENT FOR DEBUG MODE dbs_name | CURRENT DATA (YES|NO) | option_degree | CONCURRENT ACCESS RESOLUTION (USE CURRENTLY COMMITTED | WAIT FOR OUTCOME) | +dbs_alter_function_compopts: (NOT? DETERMINISTIC | NO? EXTERNAL ACTION | ((READS|MODIFIES) dbs_exact_match_identifier_sql DATA | CONTAINS dbs_exact_match_identifier_sql) | (CALLED|RETURNS NULL) ON NULL INPUT | STATIC DISPATCH | (ALLOW|DISALLOW) PARALLEL | + (DISALLOW|ALLOW|DISABLE) DEBUG MODE | QUALIFIER dbs_schema_name | PACKAGE OWNER dbs_authorization_name | ASUTIME (NO LIMIT | LIMIT INTEGERLITERAL) | (INHERIT|DEFAULT) SPECIAL REGISTERS | + WLM ENVIRONMENT FOR DEBUG MODE dbs_sql_identifier | CURRENT DATA (YES|NO) | option_degree | CONCURRENT ACCESS RESOLUTION (USE CURRENTLY COMMITTED | WAIT FOR OUTCOME) | DYNAMICRULES (RUN|BIND|DEFINEBIND|DEFINERUN|INVOKEBIND|INVOKERUN) | APPLICATION ENCODING SCHEME (ASCII|EBCDIC|UNICODE) | (WITH|WITHOUT) EXPLAIN | (WITH|WITHOUT) IMMEDIATE WRITE | - ISOLATION LEVEL (CS|RS|RR|UR) | OPTHINT (DOUBLEQUOTE|dbs_string_constant) | SQL PATH (dbs_schema_name | SESSION? USER | SYSTEM PATH) (dbs_comma_separator (dbs_schema_name | SESSION? USER | SYSTEM PATH))* | + ISOLATION LEVEL (CS|RS|RR|UR) | OPTHINT (DOUBLEQUOTE|dbs_string_constant) | dbs_exact_match_identifier_sql PATH (dbs_schema_name | SESSION? USER | SYSTEM PATH) (dbs_comma_separator (dbs_schema_name | SESSION? USER | SYSTEM PATH))* | QUERY ACCELERATION (NONE|ELIGIBLE|ALL|ENABLE (WITH FAILBACK)?) | GET_ACCEL_ARCHIVE (YES|NO) | ACCELERATION WAITFORDATA dbs_nnnn_m | ACCELERATOR dbs_accelerator_name | REOPT (NONE|ALWAYS|ONCE) | VALIDATE (RUN|BIND) | ROUNDING (DEC_ROUND_CEILING|DEC_ROUND_DOWN|DEC_ROUND_FLOOR|DEC_ROUND_HALF_DOWN|DEC_ROUND_HALF_EVEN|DEC_ROUND_HALF_UP|DEC_ROUND_UP) | DATE FORMAT (ISO|EUR|USA|JIS|LOCAL) | NOT? SECURED | BUSINESS_TIME SENSITIVE (YES|NO) | SYSTEM_TIME SENSITIVE (YES|NO) | ARCHIVE SENSITIVE (YES|NO) | APPLCOMPAT dbs_applcompat_value | (OFF | CONCENTRATE STATEMENTS (WITH LITERALS)?))+; /*random ordering req*/ dbs_alter_function_inline: (SPECIFIC FUNCTION dbs_specific_name | FUNCTION dbs_function_name (LPARENCHAR ((common_built_in_type_source | XML | dbs_distinct_type_name) (dbs_comma_separator (common_built_in_type_source | XML | dbs_distinct_type_name))*)? RPARENCHAR)?) dbs_alter_function_inlineopts; /*this is for both "inlined SQL scalar" and "SQL table" as they are basically identical - only two extra options in "table" */ -dbs_alter_function_inlineopts: (NOT? DETERMINISTIC | NO? EXTERNAL ACTION | (CONTAINS SQL|READS SQL DATA) | STATIC DISPATCH | CALLED ON NULL INPUT | NOT? SECURED | INHERIT SPECIAL REGISTERS | CARDINALITY dbs_integer)+; /*random ordering req */ +dbs_alter_function_inlineopts: (NOT? DETERMINISTIC | NO? EXTERNAL ACTION | (CONTAINS dbs_exact_match_identifier_sql|READS dbs_exact_match_identifier_sql DATA) | STATIC DISPATCH | CALLED ON NULL INPUT | NOT? SECURED | INHERIT SPECIAL REGISTERS | CARDINALITY INTEGERLITERAL)+; /*random ordering req */ /*ALTER INDEX */ dbs_alter_index: INDEX dbs_index_name (REGENERATE (USING APPLICATION COMPATIBILITY dbs_applcompat_value)? /*included as a separate piped option due to nb 2 in IBM doc*/ | - (BUFFERPOOL dbs_bp_name | CLOSE (YES|NO) | COPY (YES|NO) | DSSIZE dbs_integer G_CHAR | PIECESIZE dbs_pieceSize | dbs_alter_index_using | dbs_alter_index_free | + (BUFFERPOOL dbs_bp_name | CLOSE (YES|NO) | COPY (YES|NO) | DSSIZE dbs_dsize_parameter | PIECESIZE dbs_pieceSize | dbs_alter_index_using | dbs_alter_index_free | dbs_alter_index_gbpcache | NOT? CLUSTER | NOT? PADDED | COMPRESS (YES|NO) | dbs_alter_index_add)+ dbs_alter_index_alter?); -dbs_alter_index_using: (USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name) | (PRIQTY | SECQTY) dbs_integer | ERASE (YES|NO))+; -dbs_alter_index_free: (FREEPAGE dbs_integer (PCTFREE dbs_integer)? | PCTFREE dbs_integer (FREEPAGE dbs_integer)?); +dbs_alter_index_using: (USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name) | (PRIQTY | SECQTY) INTEGERLITERAL | ERASE (YES|NO))+; +dbs_alter_index_free: (FREEPAGE INTEGERLITERAL (PCTFREE INTEGERLITERAL)? | PCTFREE INTEGERLITERAL (FREEPAGE INTEGERLITERAL)?); dbs_alter_index_gbpcache: GBPCACHE (CHANGED | ALL | NONE); dbs_alter_index_add: ADD (COLUMN LPARENCHAR dbs_column_name (ASC | DESC | RANDOM)? RPARENCHAR | INCLUDE COLUMN LPARENCHAR dbs_column_name RPARENCHAR); dbs_alter_index_alter: dbs_alter_index_loop (dbs_comma_separator dbs_alter_index_loop)*; -dbs_alter_index_loop: ALTER PARTITION dbs_integer dbs_alter_index_ending? (dbs_alter_index_using | dbs_alter_index_free | dbs_alter_index_gbpcache | DSSIZE dbs_integer G_CHAR)*; +dbs_alter_index_loop: ALTER PARTITION INTEGERLITERAL dbs_alter_index_ending? (dbs_alter_index_using | dbs_alter_index_free | dbs_alter_index_gbpcache | DSSIZE dbs_dsize_parameter)*; dbs_alter_index_ending: ENDING AT? LPARENCHAR (dbs_constant | MAXVALUE | MINVALUE) (dbs_comma_separator (dbs_constant | MAXVALUE | MINVALUE))* RPARENCHAR INCLUSIVE?; /*ALTER MASK */ @@ -150,39 +150,39 @@ dbs_alter_permission: PERMISSION dbs_permission_name (ENABLE | DISABLE | REGENER /*ALTER PROCEDURE */ dbs_alter_procedure: PROCEDURE dbs_procedure_name (dbs_alter_procedure_external | dbs_alter_procedure_alter | dbs_alter_procedure_replace | dbs_alter_procedure_add | dbs_alter_procedure_activate | dbs_alter_procedure_regen | dbs_alter_procedure_drop); -dbs_alter_procedure_external: (DYNAMIC RESULT SETS dbs_integer | EXTERNAL NAME (dbs_external_program_name | dbs_identifier) | LANGUAGE (ASSEMBLE | LANGUAGE_C | COBOL | JAVA | PLI | REXX) | PARAMETER STYLE (SQL | - GENERAL (WITH NULLS)? | JAVA) | NOT? DETERMINISTIC | (PACKAGE PATH dbs_package_path | NO PACKAGE PATH) | ((MODIFIES|READS) SQL DATA | (CONTAINS|NO) SQL) | NO? DBINFO | (NO COLLID | - COLLID dbs_collection_id) | WLM ENVIRONMENT (dbs_name | LPARENCHAR dbs_name dbs_comma_separator ASTERISKCHAR RPARENCHAR) | ASUTIME (NO LIMIT | LIMIT dbs_integer) | STAY RESIDENT (YES|NO) | - PROGRAM TYPE (SUB|MAIN) | SECURITY (DB2|USER|DEFINER) | RUN OPTIONS dbs_run_time_options | COMMIT ON RETURN (YES|NO) | (INHERIT|DEFAULT) SPECIAL REGISTERS | CALLED ON NULL INPUT | - (STOP AFTER (SYSTEM DEFAULT|dbs_integer) FAILURES | CONTINUE AFTER FAILURE) | (DISALLOW|ALLOW|DISABLE) DEBUG MODE)+; /*random ordering req */ +dbs_alter_procedure_external: (DYNAMIC RESULT SETS INTEGERLITERAL | EXTERNAL NAME (dbs_external_program_name | dbs_sql_identifier) | LANGUAGE dbs_procedure_language | PARAMETER STYLE (dbs_function_parameter_style | + GENERAL (WITH NULLS)?) | NOT? DETERMINISTIC | (PACKAGE PATH dbs_package_path | NO PACKAGE PATH) | ((MODIFIES|READS) dbs_exact_match_identifier_sql DATA | (CONTAINS|NO) dbs_exact_match_identifier_sql) | NO? DBINFO | (NO COLLID | + COLLID dbs_collection_id) | WLM ENVIRONMENT (dbs_sql_identifier | LPARENCHAR dbs_sql_identifier dbs_comma_separator ASTERISKCHAR RPARENCHAR) | ASUTIME (NO LIMIT | LIMIT INTEGERLITERAL) | STAY RESIDENT (YES|NO) | + PROGRAM TYPE (SUB|MAIN) | SECURITY (DB2|USER|DEFINER) | RUN OPTIONS dbs_string_constant | COMMIT ON RETURN (YES|NO) | (INHERIT|DEFAULT) SPECIAL REGISTERS | CALLED ON NULL INPUT | + (STOP AFTER (SYSTEM DEFAULT|INTEGERLITERAL) FAILURES | CONTINUE AFTER FAILURE) | (DISALLOW|ALLOW|DISABLE) DEBUG MODE)+; /*random ordering req */ dbs_alter_procedure_alter: ALTER? (ACTIVE VERSION | ALL VERSIONS | VERSION dbs_routine_version_id)? dbs_alter_procedure_options; -dbs_alter_procedure_options: (NOT? DETERMINISTIC | ((MODIFIES|READS) SQL DATA | CONTAINS SQL) | CALLED ON NULL INPUT | DYNAMIC RESULT SETS dbs_integer | (DISALLOW|ALLOW|DISABLE) DEBUG MODE | - PARAMETER CCSID (ASCII|EBCDIC|UNICODE) | QUALIFIER dbs_schema_name | PACKAGE OWNER dbs_authorization_name | ASUTIME (NO LIMIT | LIMIT dbs_integer) | ((COMMIT ON RETURN (YES|NO)) | - AUTONOMOUS) | (INHERIT|DEFAULT) SPECIAL REGISTERS | WLM ENVIRONMENT FOR DEBUG MODE dbs_name | (DEFER|NODEFER) PREPARE | CURRENT DATA (YES|NO) | option_degree | +dbs_alter_procedure_options: (NOT? DETERMINISTIC | ((MODIFIES|READS) dbs_exact_match_identifier_sql DATA | CONTAINS dbs_exact_match_identifier_sql) | CALLED ON NULL INPUT | DYNAMIC RESULT SETS INTEGERLITERAL | (DISALLOW|ALLOW|DISABLE) DEBUG MODE | + PARAMETER CCSID (ASCII|EBCDIC|UNICODE) | QUALIFIER dbs_schema_name | PACKAGE OWNER dbs_authorization_name | ASUTIME (NO LIMIT | LIMIT INTEGERLITERAL) | ((COMMIT ON RETURN (YES|NO)) | + AUTONOMOUS) | (INHERIT|DEFAULT) SPECIAL REGISTERS | WLM ENVIRONMENT FOR DEBUG MODE dbs_sql_identifier | (DEFER|NODEFER) PREPARE | CURRENT DATA (YES|NO) | option_degree | CONCURRENT ACCESS RESOLUTION (USE CURRENTLY COMMITTED | WAIT FOR OUTCOME) | DYNAMICRULES (RUN|BIND|DEFINERUN|DEFINEBIND|INVOKERUN|INVOKEBIND) | APPLICATION ENCODING SCHEME (ASCII|EBCDIC|UNICODE) | - (WITH|WITHOUT) EXPLAIN | (WITH|WITHOUT) IMMEDIATE WRITE | ISOLATION LEVEL (CS|RS|RR|UR) | (WITH|WITHOUT) KEEP DYNAMIC | OPTHINT (DOUBLEQUOTE|dbs_string_constant) | SQL PATH (dbs_schema_name | SYSTEM PATH | + (WITH|WITHOUT) EXPLAIN | (WITH|WITHOUT) IMMEDIATE WRITE | ISOLATION LEVEL (CS|RS|RR|UR) | (WITH|WITHOUT) KEEP DYNAMIC | OPTHINT (DOUBLEQUOTE|dbs_string_constant) | dbs_exact_match_identifier_sql PATH (dbs_schema_name | SYSTEM PATH | SESSION? USER) (dbs_comma_separator (dbs_schema_name | SYSTEM PATH | SESSION? USER))* | RELEASE AT (COMMIT | DEALLOCATE) | QUERY ACCELERATION (NONE|ELIGIBLE|ALL|ENABLE (WITH FAILBACK)?) | GET_ACCEL_ARCHIVE (YES|NO) | ACCELERATION WAITFORDATA dbs_nnnn_m | ACCELERATOR dbs_accelerator_name | REOPT (NONE|ALWAYS|ONCE) | VALIDATE (RUN|BIND) | ROUNDING (DEC_ROUND_CEILING|DEC_ROUND_DOWN|DEC_ROUND_FLOOR|DEC_ROUND_HALF_DOWN|DEC_ROUND_HALF_EVEN|DEC_ROUND_HALF_UP|DEC_ROUND_UP) | DATE FORMAT (ISO|EUR|USA|JIS|LOCAL) | - DECIMAL LPARENCHAR (dbs_integer15 | dbs_integer31) (dbs_comma_separator dbs_s)? | FOR UPDATE CLAUSE (REQUIRED|OPTIONAL) | TIME FORMAT (ISO|EUR|USA|JIS|LOCAL) | BUSINESS_TIME SENSITIVE (YES|NO) | SYSTEM_TIME SENSITIVE (YES|NO) | + option_decimal | FOR UPDATE CLAUSE (REQUIRED|OPTIONAL) | TIME FORMAT (ISO|EUR|USA|JIS|LOCAL) | BUSINESS_TIME SENSITIVE (YES|NO) | SYSTEM_TIME SENSITIVE (YES|NO) | ARCHIVE SENSITIVE (YES|NO) | APPLCOMPAT dbs_applcompat_value | CONCENTRATE STATEMENTS (OFF|WITH LITERALS))*; /*random ordering req */ dbs_alter_procedure_replace: REPLACE (ACTIVE VERSION | VERSION dbs_routine_version_id)? (LPARENCHAR dbs_alter_procedure_paramdec (dbs_comma_separator dbs_alter_procedure_paramdec)* RPARENCHAR)? dbs_alter_procedure_options dbs_sql_procedure_statement; dbs_alter_procedure_paramdec: (IN|OUT|INOUT)? dbs_parameter_name (dbs_alter_procedure_bit | data_type_arr_or_distinct); dbs_alter_procedure_bit: (dbs_alter_procedure_bit_int | dbs_alter_procedure_bit_decimal | dbs_alter_procedure_bit_float | dbs_alter_procedure_bit_decfloat | dbs_alter_procedure_bit_char | dbs_alter_procedure_bit_clob | dbs_alter_procedure_bit_varchar | dbs_alter_procedure_bit_graphic | dbs_alter_procedure_bit_binary | DATE | TIME | dbs_alter_procedure_bit_timestamp | XML); dbs_alter_procedure_bit_int: (SMALLINT | INT | INTEGER | BIGINT); -dbs_alter_procedure_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR dbs_integer (dbs_comma_separator dbs_integer)? RPARENCHAR)?; -dbs_alter_procedure_bit_float: (FLOAT (LPARENCHAR dbs_integer RPARENCHAR)? | REAL | DOUBLE PRECISION?); -dbs_alter_procedure_bit_decfloat: DECFLOAT (LPARENCHAR (dbs_integer34 | dbs_integer16) RPARENCHAR)?; -dbs_alter_procedure_bit_char: (CHARACTER | CHAR) (VARYING dbs_alter_procedure_bit_varchara | LARGE OBJECT dbs_alter_procedure_bit_cloba | LPARENCHAR dbs_integer RPARENCHAR dbs_alter_procedure_bit_charopts); +dbs_alter_procedure_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR INTEGERLITERAL (dbs_comma_separator INTEGERLITERAL)? RPARENCHAR)?; +dbs_alter_procedure_bit_float: (FLOAT (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | REAL | DOUBLE PRECISION?); +dbs_alter_procedure_bit_decfloat: DECFLOAT (LPARENCHAR dbs_decfloat_integer RPARENCHAR)?; +dbs_alter_procedure_bit_char: (CHARACTER | CHAR) (VARYING dbs_alter_procedure_bit_varchara | LARGE OBJECT dbs_alter_procedure_bit_cloba | LPARENCHAR INTEGERLITERAL RPARENCHAR dbs_alter_procedure_bit_charopts); dbs_alter_procedure_bit_charopts: (FOR (SBCS | MIXED | BIT) DATA)? (CCSID oneof_encoding)?; dbs_alter_procedure_bit_varchar: VARCHAR dbs_alter_procedure_bit_varchara; -dbs_alter_procedure_bit_varchara: LPARENCHAR dbs_integer RPARENCHAR dbs_alter_procedure_bit_charopts; +dbs_alter_procedure_bit_varchara: LPARENCHAR INTEGERLITERAL RPARENCHAR dbs_alter_procedure_bit_charopts; dbs_alter_procedure_bit_clob: CLOB dbs_alter_procedure_bit_cloba; -dbs_alter_procedure_bit_cloba: (LPARENCHAR lobSize RPARENCHAR)? (FOR (SBCS | MIXED ) DATA)? (CCSID oneof_encoding)?; -dbs_alter_procedure_bit_graphic: (GRAPHIC (LPARENCHAR dbs_integer RPARENCHAR)? | VARGRAPHIC LPARENCHAR dbs_integer RPARENCHAR | DBCLOB (LPARENCHAR lobSize RPARENCHAR)?) (CCSID oneof_encoding)?; -dbs_alter_procedure_bit_binary: (BINARY (LPARENCHAR dbs_integer RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR dbs_integer RPARENCHAR | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR lobSize RPARENCHAR)?); -dbs_alter_procedure_bit_timestamp: TIMESTAMP (LPARENCHAR dbs_integer RPARENCHAR)? option_timezone?; +dbs_alter_procedure_bit_cloba: (LPARENCHAR kmg_blob_parameter RPARENCHAR)? (FOR (SBCS | MIXED ) DATA)? (CCSID oneof_encoding)?; +dbs_alter_procedure_bit_graphic: (GRAPHIC (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | VARGRAPHIC LPARENCHAR INTEGERLITERAL RPARENCHAR | DBCLOB (LPARENCHAR kmg_blob_parameter RPARENCHAR)?) (CCSID oneof_encoding)?; +dbs_alter_procedure_bit_binary: (BINARY (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR INTEGERLITERAL RPARENCHAR | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR kmg_blob_parameter RPARENCHAR)?); +dbs_alter_procedure_bit_timestamp: TIMESTAMP (LPARENCHAR INTEGERLITERAL RPARENCHAR)? option_timezone?; dbs_alter_procedure_add: ADD VERSION dbs_routine_version_id (LPARENCHAR dbs_alter_procedure_paramdec (dbs_comma_separator dbs_alter_procedure_paramdec)* RPARENCHAR)? dbs_alter_procedure_options dbs_sql_procedure_statement; dbs_alter_procedure_activate: ACTIVATE VERSION dbs_routine_version_id; dbs_alter_procedure_regen: REGENERATE (ACTIVE VERSION | VERSION dbs_routine_version_id)? (USING APPLICATION COMPATIBILITY dbs_applcompat_value)?; @@ -190,34 +190,34 @@ dbs_alter_procedure_drop: DROP VERSION dbs_routine_version_id; /*ALTER SEQUENCE */ dbs_alter_sequence: SEQUENCE dbs_sequence_name dbs_alter_sequence_loop (dbs_comma_separator? dbs_alter_sequence_loop)*; -dbs_alter_sequence_loop: (RESTART (WITH dbs_numeric_constant)? | (INCREMENT BY|MINVALUE|MAXVALUE) dbs_numeric_constant | NO (MINVALUE|MAXVALUE) | NO? (CYCLE|ORDER) | NO CACHE | CACHE dbs_integer_constant); +dbs_alter_sequence_loop: (RESTART (WITH INTEGERLITERAL)? | (INCREMENT BY|MINVALUE|MAXVALUE) INTEGERLITERAL | NO (MINVALUE|MAXVALUE) | NO? (CYCLE|ORDER) | NO CACHE | CACHE dbs_integer_constant); /*ALTER STOGROUP */ -dbs_alter_stogroup: STOGROUP dbs_stogroup_name (NO KEY LABEL | KEY LABEL dbs_key_label_name | (ADD|REMOVE) VOLUMES LPARENCHAR (dbs_volume_id (dbs_comma_separator dbs_volume_id)* | - SINGLEQUOTE ASTERISKCHAR SINGLEQUOTE (dbs_comma_separator SINGLEQUOTE ASTERISKCHAR SINGLEQUOTE)*) RPARENCHAR)+ (DATACLAS dbs_dc_name)? (MGMTCLAS dbs_mc_name)? (STORCLAS dbs_sc_name)?;//*ALTER TABLE */ +dbs_alter_stogroup: STOGROUP dbs_stogroup_name (NO KEY LABEL | KEY LABEL dbs_sql_identifier | (ADD|REMOVE) VOLUMES LPARENCHAR (dbs_sql_identifier (dbs_comma_separator dbs_sql_identifier)* | + SINGLEQUOTE ASTERISKCHAR SINGLEQUOTE (dbs_comma_separator SINGLEQUOTE ASTERISKCHAR SINGLEQUOTE)*) RPARENCHAR)+ (DATACLAS dbs_host_variable)? (MGMTCLAS dbs_sql_identifier)? (STORCLAS dbs_sql_identifier)?;//*ALTER TABLE */ dbs_alter_table: TABLE dbs_table_name (dbs_alter_table_add | dbs_alter_table_alter | dbs_alter_table_rename | dbs_alter_table_drop | dbs_alter_table_rotate | DATA CAPTURE (NONE|CHANGES) | NOT? VOLATILE CARDINALITY? | - (ACTIVATE|DEACTIVATE) (ROW|COLUMN) ACCESS CONTROL | APPEND (NO|YES) | AUDIT (NONE|CHANGES|ALL) | VALIDPROC (dbs_program_name | NULL) | ENABLE ARCHIVE USE dbs_table_name | DISABLE ARCHIVE | NO KEY LABEL | KEY LABEL dbs_key_label_name)+; + (ACTIVATE|DEACTIVATE) (ROW|COLUMN) ACCESS CONTROL | APPEND (NO|YES) | AUDIT (NONE|CHANGES|ALL) | VALIDPROC (dbs_program_name | NULL) | ENABLE ARCHIVE USE dbs_table_name | DISABLE ARCHIVE | NO KEY LABEL | KEY LABEL dbs_sql_identifier)+; dbs_alter_table_add: ADD (COLUMN? dbs_alter_table_coldef | dbs_alter_table_unique | dbs_alter_table_check | PARTITION (BY dbs_alter_table_partitioning | dbs_alter_table_partition)? | - SYSTEM? VERSIONING USE HISTORY TABLE dbs_history_table_name (ON DELETE ADD EXTRA ROW)? | (MATERIALIZED? QUERY)? dbs_alter_table_mq | CLONE dbs_clone_table_name | RESTRICT ON DROP) | ADD? dbs_alter_table_referential; + SYSTEM? VERSIONING USE HISTORY TABLE dsb_alias_name (ON DELETE ADD EXTRA ROW)? | (MATERIALIZED? QUERY)? dbs_alter_table_mq | CLONE dbs_clone_table_name | RESTRICT ON DROP) | ADD? dbs_alter_table_referential; dbs_alter_table_coldef: dbs_column_name (dbs_distinct_type_name | dbs_alter_table_bit)? (dbs_alter_table_defclause | NOT NULL | dbs_alter_table_check | common_reference_clause | dbs_alter_table_generated | - IMPLICITLY HIDDENCHAR | AS SECURITY LABEL | FIELDPROC dbs_program_name (LPARENCHAR dbs_constant (dbs_comma_separator dbs_constant)* RPARENCHAR)? | INLINE LENGTH dbs_integer)*; + IMPLICITLY HIDDENCHAR | AS SECURITY LABEL | FIELDPROC dbs_program_name (LPARENCHAR dbs_constant (dbs_comma_separator dbs_constant)* RPARENCHAR)? | INLINE LENGTH INTEGERLITERAL)*; dbs_alter_table_bit: (dbs_alter_table_bit_int | dbs_alter_table_bit_decimal | dbs_alter_table_bit_float | dbs_alter_table_bit_decfloat | dbs_alter_table_bit_char | dbs_alter_table_bit_clob | dbs_alter_table_bit_varchar | dbs_alter_table_bit_graphic | dbs_alter_table_bit_binary | DATE | TIME | dbs_alter_table_bit_timestamp | ROWID | dbs_alter_table_bit_xml); dbs_alter_table_bit_int: (SMALLINT | INT | INTEGER | BIGINT); -dbs_alter_table_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR dbs_integer (dbs_comma_separator dbs_integer)? RPARENCHAR)?; -dbs_alter_table_bit_float: (FLOAT (LPARENCHAR dbs_integer RPARENCHAR)? | REAL | DOUBLE PRECISION?); -dbs_alter_table_bit_decfloat: DECFLOAT (LPARENCHAR (dbs_integer34 | dbs_integer16) RPARENCHAR)?; -dbs_alter_table_bit_char: (CHARACTER | CHAR) (VARYING dbs_alter_table_bit_varchara | LARGE OBJECT dbs_alter_table_bit_cloba | LPARENCHAR dbs_integer RPARENCHAR dbs_alter_table_bit_charopts); +dbs_alter_table_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR INTEGERLITERAL (dbs_comma_separator INTEGERLITERAL)? RPARENCHAR)?; +dbs_alter_table_bit_float: (FLOAT (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | REAL | DOUBLE PRECISION?); +dbs_alter_table_bit_decfloat: DECFLOAT (LPARENCHAR dbs_decfloat_integer RPARENCHAR)?; +dbs_alter_table_bit_char: (CHARACTER | CHAR) (VARYING dbs_alter_table_bit_varchara | LARGE OBJECT dbs_alter_table_bit_cloba | LPARENCHAR INTEGERLITERAL RPARENCHAR dbs_alter_table_bit_charopts); dbs_alter_table_bit_charopts: (FOR (SBCS | MIXED | BIT) DATA | CCSID dbs_integer1208)?; dbs_alter_table_bit_varchar: VARCHAR dbs_alter_table_bit_varchara; -dbs_alter_table_bit_varchara: LPARENCHAR dbs_integer RPARENCHAR dbs_alter_table_bit_charopts; +dbs_alter_table_bit_varchara: LPARENCHAR INTEGERLITERAL RPARENCHAR dbs_alter_table_bit_charopts; dbs_alter_table_bit_clob: CLOB dbs_alter_table_bit_cloba; -dbs_alter_table_bit_cloba: (LPARENCHAR lobSize RPARENCHAR)? dbs_alter_table_bit_charopts; -dbs_alter_table_bit_graphic: (GRAPHIC (LPARENCHAR dbs_integer RPARENCHAR)? | VARGRAPHIC LPARENCHAR dbs_integer RPARENCHAR | DBCLOB (LPARENCHAR lobSize RPARENCHAR)?) (CCSID dbs_integer1200)?; -dbs_alter_table_bit_binary: (BINARY (LPARENCHAR dbs_integer RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR dbs_integer RPARENCHAR | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR lobSize RPARENCHAR)?); -dbs_alter_table_bit_timestamp: TIMESTAMP (LPARENCHAR dbs_integer RPARENCHAR)? option_timezone?; -dbs_alter_table_bit_xml: XML (LPARENCHAR XMLSCHEMA dbs_alter_table_bit_xmlspec (ELEMENT dbs_element_name)? (dbs_comma_separator dbs_alter_table_bit_xmlspec (ELEMENT dbs_element_name)?)* RPARENCHAR)?; -dbs_alter_table_bit_xmlspec: (ID dbs_registered_xml_schema_name | (URL dbs_target_namespace | NO NAMESPACE) (LOCATION dbs_schema_location)?); +dbs_alter_table_bit_cloba: (LPARENCHAR kmg_blob_parameter RPARENCHAR)? dbs_alter_table_bit_charopts; +dbs_alter_table_bit_graphic: (GRAPHIC (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | VARGRAPHIC LPARENCHAR INTEGERLITERAL RPARENCHAR | DBCLOB (LPARENCHAR kmg_blob_parameter RPARENCHAR)?) (CCSID dbs_integer1200)?; +dbs_alter_table_bit_binary: (BINARY (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR INTEGERLITERAL RPARENCHAR | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR kmg_blob_parameter RPARENCHAR)?); +dbs_alter_table_bit_timestamp: TIMESTAMP (LPARENCHAR INTEGERLITERAL RPARENCHAR)? option_timezone?; +dbs_alter_table_bit_xml: XML (LPARENCHAR XMLSCHEMA dbs_alter_table_bit_xmlspec (ELEMENT dbs_sql_identifier)? (dbs_comma_separator dbs_alter_table_bit_xmlspec (ELEMENT dbs_sql_identifier)?)* RPARENCHAR)?; +dbs_alter_table_bit_xmlspec: (ID dbs_registered_xml_schema_name | (URL dbs_host_variable | NO NAMESPACE) (LOCATION dbs_schema_location)?); dbs_alter_table_defclause: WITH? DEFAULT (dbs_constant | SESSION_USER | USER | CURRENT SQLID | NULL | dbs_cast_function_name LPARENCHAR (dbs_constant | SESSION_USER | USER | CURRENT SQLID | NULL) RPARENCHAR)?; dbs_alter_table_check: (CONSTRAINT dbs_constraint_name)? CHECK LPARENCHAR dbs_search_condition RPARENCHAR; common_reference_clause: REFERENCES dbs_table_name (LPARENCHAR dbs_column_name (PERIOD BUSINESS_TIME)? (dbs_comma_separator dbs_column_name (PERIOD BUSINESS_TIME)?)* RPARENCHAR)? (ON DELETE (RESTRICT | NO ACTION | CASCADE | @@ -225,50 +225,50 @@ common_reference_clause: REFERENCES dbs_table_name (LPARENCHAR dbs_column_name ( dbs_alter_table_generated: GENERATED ((ALWAYS | BY DEFAULT)? (common_as_identity_clause | FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP)? | ALWAYS? (AS TRANSACTION START ID | AS ROW (BEGIN|START|END) | AS LPARENCHAR dbs_non_deterministic_expression RPARENCHAR)?); common_as_identity_clause: AS IDENTITY (LPARENCHAR dbs_alter_table_asid_loop (dbs_comma_separator? dbs_alter_table_asid_loop)* RPARENCHAR)?; -dbs_alter_table_asid_loop: (START WITH dbs_numeric_constant | INCREMENT BY dbs_numeric_constant | NO MINVALUE | MINVALUE dbs_numeric_constant | NO? CYCLE | NO CACHE | CACHE dbs_numeric_constant | NO? ORDER); +dbs_alter_table_asid_loop: (START WITH INTEGERLITERAL | INCREMENT BY INTEGERLITERAL | NO MINVALUE | MINVALUE INTEGERLITERAL | NO? CYCLE | NO CACHE | CACHE INTEGERLITERAL | NO? ORDER); dbs_alter_table_unique: (CONSTRAINT dbs_constraint_name)? (PRIMARY KEY | UNIQUE) LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* (dbs_comma_separator BUSINESS_TIME WITHOUT OVERLAPS)? RPARENCHAR; dbs_alter_table_referential: (CONSTRAINT dbs_constraint_name)? FOREIGN KEY LPARENCHAR dbs_column_name (PERIOD BUSINESS_TIME)? (dbs_comma_separator dbs_column_name (PERIOD BUSINESS_TIME)?)* RPARENCHAR common_reference_clause; dbs_alter_table_partitioning: RANGE? LPARENCHAR dbs_column_name (NULLS LAST)? (ASC|DESC)? (dbs_comma_separator dbs_column_name (NULLS LAST)? (ASC|DESC)?)* RPARENCHAR LPARENCHAR dbs_alter_table_partition (dbs_comma_separator dbs_alter_table_partition)* RPARENCHAR; -dbs_alter_table_partition: PARTITION dbs_integer ENDING AT? LPARENCHAR (dbs_constant | MAXVALUE | MINVALUE) (dbs_comma_separator (dbs_constant | MAXVALUE | MINVALUE))* RPARENCHAR INCLUSIVE?; +dbs_alter_table_partition: PARTITION INTEGERLITERAL ENDING AT? LPARENCHAR (dbs_constant | MAXVALUE | MINVALUE) (dbs_comma_separator (dbs_constant | MAXVALUE | MINVALUE))* RPARENCHAR INCLUSIVE?; dbs_alter_table_mq: LPARENCHAR dbs_fullselect RPARENCHAR DATA INITIALLY DEFERRED REFRESH DEFERRED (MAINTAINED BY (SYSTEM|USER) ((ENABLE|DISABLE) QUERY OPTIMIZATION)? | (ENABLE|DISABLE) QUERY OPTIMIZATION (MAINTAINED BY (SYSTEM|USER))?); -dbs_alter_table_alter: ALTER (COLUMN? dbs_alter_table_colalt | PARTITION dbs_integer dbs_alter_table_partition | MATERIALIZED? QUERY dbs_alter_table_mq); -dbs_alter_table_colalt: dbs_column_name (DROP DEFAULT | SET (DATA TYPE dbs_alter_table_bit (INLINE LENGTH dbs_integer)? | dbs_alter_table_defclause | INLINE LENGTH dbs_integer | dbs_alter_table_idalt | +dbs_alter_table_alter: ALTER (COLUMN? dbs_alter_table_colalt | PARTITION INTEGERLITERAL dbs_alter_table_partition | MATERIALIZED? QUERY dbs_alter_table_mq); +dbs_alter_table_colalt: dbs_column_name (DROP DEFAULT | SET (DATA TYPE dbs_alter_table_bit (INLINE LENGTH INTEGERLITERAL)? | dbs_alter_table_defclause | INLINE LENGTH INTEGERLITERAL | dbs_alter_table_idalt | GENERATED ((ALWAYS | BY DEFAULT) dbs_alter_table_idalt? | ALWAYS? (AS TRANSACTION START ID | AS ROW (BEGIN|START|END))))); -dbs_alter_table_idalt: (RESTART (WITH dbs_numeric_constant)? | SET (INCREMENT BY dbs_numeric_constant | NO MINVALUE | MINVALUE dbs_numeric_constant | NO? CYCLE | NO CACHE | CACHE dbs_integer_constant | NO? ORDER))+; +dbs_alter_table_idalt: (RESTART (WITH INTEGERLITERAL)? | SET (INCREMENT BY INTEGERLITERAL | NO MINVALUE | MINVALUE INTEGERLITERAL | NO? CYCLE | NO CACHE | CACHE dbs_integer_constant | NO? ORDER))+; dbs_alter_table_rename: RENAME COLUMN dbs_column_name TO dbs_column_name; dbs_alter_table_drop: DROP (COLUMN? dbs_column_name RESTRICT | PRIMARY KEY | (UNIQUE|FOREIGN KEY|CHECK|CONSTRAINT) dbs_constraint_name | SYSTEM? VERSIONING | MATERIALIZED? QUERY | CLONE | RESTRICT ON DROP); -dbs_alter_table_rotate: ROTATE PARTITION (FIRST | dbs_integer) TO LAST ENDING AT? LPARENCHAR (dbs_constant | MAXVALUE | MINVALUE) (dbs_comma_separator (dbs_constant | MAXVALUE | MINVALUE))* RPARENCHAR INCLUSIVE? RESET; +dbs_alter_table_rotate: ROTATE PARTITION (FIRST | INTEGERLITERAL) TO LAST ENDING AT? LPARENCHAR (dbs_constant | MAXVALUE | MINVALUE) (dbs_comma_separator (dbs_constant | MAXVALUE | MINVALUE))* RPARENCHAR INCLUSIVE? RESET; /*ALTER TABLESPACE */ -dbs_alter_tablespace: TABLESPACE dbs_database_name? dbs_table_space_name (DROP PENDING CHANGES | DSSIZE dbs_integer G_CHAR | SEGSIZE dbs_integer | PAGENUM RELATIVE | +dbs_alter_tablespace: TABLESPACE (dbs_database_name DOT_FS)? dbs_table_space_name (DROP PENDING CHANGES | DSSIZE dbs_dsize_parameter | SEGSIZE INTEGERLITERAL | PAGENUM RELATIVE | dbs_alter_tablespace_move /*these first five are piped separately from the big loop due to note 1 in IBM doc*/ - | (BUFFERPOOL dbs_bp_name | CCSID dbs_ccsid_value | CLOSE (YES|NO) | COMPRESS (YES|NO) | - INSERT ALGORITHM dbs_level | LOCKMAX (SYSTEM | dbs_integer) | LOCKSIZE (ANY | TABLESPACE | TABLE | PAGE | ROW | LOB) - | NOT? LOGGED | MAXROWS dbs_integer | MAXPARTITIONS dbs_integer | + | (BUFFERPOOL dbs_bp_name | CCSID INTEGERLITERAL | CLOSE (YES|NO) | COMPRESS (YES|NO) | + INSERT ALGORITHM dbs_insert_algorithm_level | LOCKMAX (SYSTEM | INTEGERLITERAL) | LOCKSIZE (ANY | TABLESPACE | TABLE | PAGE | ROW | LOB) + | NOT? LOGGED | MAXROWS INTEGERLITERAL | MAXPARTITIONS dbs_maxPartition | MEMBER CLUSTER (YES|NO) | TRACKMOD (YES|NO) | dbs_alter_tablespace_using | dbs_alter_tablespace_free | dbs_alter_tablespace_gbpcache)+) dbs_alter_tablespace_alter?; dbs_alter_tablespace_move: MOVE TABLE dbs_table_name TO TABLESPACE (dbs_database_name DOT_FS)? dbs_table_space_name; -dbs_alter_tablespace_using: (USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name) | (PRIQTY | SECQTY) MINUSCHAR? dbs_integer | ERASE (YES|NO))+; -dbs_alter_tablespace_free: (FREEPAGE dbs_integer | PCTFREE dbs_smallint? (FOR UPDATE dbs_smallint)?)+; +dbs_alter_tablespace_using: (USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name) | (PRIQTY | SECQTY) MINUSCHAR? INTEGERLITERAL | ERASE (YES|NO))+; +dbs_alter_tablespace_free: (FREEPAGE INTEGERLITERAL | PCTFREE dbs_smallint? (FOR UPDATE dbs_smallint)?)+; dbs_alter_tablespace_gbpcache: GBPCACHE (CHANGED | ALL | SYSTEM | NONE); -dbs_alter_tablespace_alter: (ALTER PARTITION dbs_integer dbs_alter_tablespace_loop)+; -dbs_alter_tablespace_loop: (dbs_alter_tablespace_using | dbs_alter_tablespace_free | dbs_alter_tablespace_gbpcache | COMPRESS (YES|NO) | DSSIZE dbs_integer G_CHAR | TRACKMOD (YES|NO))+; +dbs_alter_tablespace_alter: (ALTER PARTITION INTEGERLITERAL dbs_alter_tablespace_loop)+; +dbs_alter_tablespace_loop: (dbs_alter_tablespace_using | dbs_alter_tablespace_free | dbs_alter_tablespace_gbpcache | COMPRESS (YES|NO) | DSSIZE dbs_dsize_parameter | TRACKMOD (YES|NO))+; /*ALTER TRIGGER */ dbs_alter_trigger: TRIGGER dbs_trigger_name (dbs_alter_trigger_alter | dbs_alter_trigger_replace? | dbs_alter_trigger_add | dbs_alter_trigger_activate | dbs_alter_trigger_regen | dbs_alter_trigger_drop?); dbs_alter_trigger_alter: ALTER? (ACTIVE VERSION | VERSION dbs_trigger_version_id)? dbs_alter_trigger_options; -dbs_alter_trigger_options: ((DISALLOW | ALLOW | DISABLE) DEBUG MODE | QUALIFIER dbs_schema_name | ASUTIME (NO LIMIT | LIMIT dbs_integer) | WLM ENVIRONMENT FOR DEBUG MODE dbs_name | CURRENT DATA (YES|NO) | +dbs_alter_trigger_options: ((DISALLOW | ALLOW | DISABLE) DEBUG MODE | QUALIFIER dbs_schema_name | ASUTIME (NO LIMIT | LIMIT INTEGERLITERAL) | WLM ENVIRONMENT FOR DEBUG MODE dbs_sql_identifier | CURRENT DATA (YES|NO) | CONCURRENT ACCESS RESOLUTION (USE CURRENTLY COMMITTED | WAIT FOR OUTCOME) | DYNAMICRULES (RUN|BIND) | APPLICATION ENCODING SCHEME oneof_encoding | (WITH|WITHOUT) EXPLAIN | - (WITH|WITHOUT) IMMEDIATE WRITE | ISOLATION LEVEL (CS|RS|RR|UR) | OPTHINT (DOUBLEQUOTE | dbs_string_constant) | SQL PATH (SYSTEM PATH | SESSION? USER | dbs_schema_name) (dbs_comma_separator (SYSTEM PATH | + (WITH|WITHOUT) IMMEDIATE WRITE | ISOLATION LEVEL (CS|RS|RR|UR) | OPTHINT (DOUBLEQUOTE | dbs_string_constant) | dbs_exact_match_identifier_sql PATH (SYSTEM PATH | SESSION? USER | dbs_schema_name) (dbs_comma_separator (SYSTEM PATH | SESSION? USER | dbs_schema_name))* | RELEASE AT (COMMIT|DEALLOCATE) | ROUNDING (DEC_ROUND_CEILING | DEC_ROUND_DOWN | DEC_ROUND_FLOOR | DEC_ROUND_HALF_DOWN | DEC_ROUND_HALF_EVEN | - DEC_ROUND_HALF_UP | DEC_ROUND_UP) | DATE FORMAT (ISO|EUR|USA|JIS|LOCAL) | DECIMAL LPARENCHAR (dbs_integer15 | dbs_integer31) (dbs_comma_separator dbs_s)? RPARENCHAR | TIME FORMAT (ISO|EUR|USA|JIS|LOCAL) | + DEC_ROUND_HALF_UP | DEC_ROUND_UP) | DATE FORMAT (ISO|EUR|USA|JIS|LOCAL) | DECIMAL LPARENCHAR dbs_decimal_15_31 (dbs_comma_separator INTEGERLITERAL)? RPARENCHAR | TIME FORMAT (ISO|EUR|USA|JIS|LOCAL) | FOR UPDATE CLAUSE (REQUIRED|OPTIONAL) | NOT? SECURED | BUSINESS_TIME SENSITIVE (YES|NO) | SYSTEM_TIME SENSITIVE (YES|NO) | ARCHIVE SENSITIVE (YES|NO) | APPLCOMPAT dbs_applcompat_value | CONCENTRATE STATEMENTS (OFF | WITH LITERALS))*; /*random ordering req */ dbs_alter_trigger_replace: REPLACE (ACTIVE VERSION | VERSION dbs_trigger_version_id)? dbs_alter_trigger_spec; dbs_alter_trigger_spec: ((NO CASCADE)? BEFORE | AFTER | INSTEAD OF) (INSERT | DELETE | UPDATE (OF dbs_column_name (dbs_comma_separator dbs_column_name)*)?) ON (dbs_table_name | dbs_view_name) - (REFERENCING ((OLD|NEW) ROW? AS? dbs_correlation_name | (OLD_TABLE | NEW_TABLE) AS? dbs_table_identifier)+)? (FOR EACH (STATEMENT|ROW))? dbs_alter_trigger_options + (REFERENCING ((OLD|NEW) ROW? AS? dbs_correlation_name | (OLD_TABLE | NEW_TABLE) AS? dbs_table_name)+)? (FOR EACH (STATEMENT|ROW))? dbs_alter_trigger_options (WHEN LPARENCHAR dbs_search_condition RPARENCHAR)? (dbs_sql_control_statement | dbs_triggered_sql_statement); dbs_alter_trigger_add: ADD VERSION dbs_trigger_version_id dbs_alter_trigger_spec; dbs_alter_trigger_activate: ACTIVATE VERSION dbs_trigger_version_id; @@ -279,16 +279,16 @@ dbs_alter_trigger_drop: DROP VERSION dbs_trigger_version_id; dbs_alter_trusted: TRUSTED CONTEXT dbs_context_name (dbs_alter_trusted_alter | dbs_alter_trusted_add | dbs_alter_trusted_drop | dbs_alter_trusted_replace)+; dbs_alter_trusted_alter: (ALTER (SYSTEM AUTHID dbs_authorization_name | NO DEFAULT ROLE | DEFAULT ROLE dbs_role_name (WITHOUT ROLE AS OBJECT OWNER | WITH ROLE AS OBJECT OWNER AND QUALIFIER)? | NO DEFAULT SECURITY LABEL | DEFAULT SECURITY LABEL dbs_seclabel_name | ATTRIBUTES LPARENCHAR (JOBNAME dbs_jobname_value RPARENCHAR | (ADDRESS dbs_address_value | - ENCRYPTION dbs_encryption_value | SERVAUTH dbs_servauth_value) (dbs_comma_separator (ADDRESS dbs_address_value | ENCRYPTION dbs_encryption_value | SERVAUTH dbs_servauth_value))* RPARENCHAR))| ALTER? (ENABLE |DISABLE))+; + ENCRYPTION dbs_encryption_value | SERVAUTH dbs_sql_identifier) (dbs_comma_separator (ADDRESS dbs_address_value | ENCRYPTION dbs_encryption_value | SERVAUTH dbs_sql_identifier))* RPARENCHAR))| ALTER? (ENABLE |DISABLE))+; dbs_alter_trusted_add: ADD (dbs_alter_trusted_add_attributes | dbs_alter_trusted_add_use); dbs_alter_trusted_add_attributes: ATTRIBUTES LPARENCHAR (JOBNAME dbs_jobname_value RPARENCHAR | (ADDRESS dbs_address_value | - SERVAUTH dbs_servauth_value) (dbs_comma_separator (ADDRESS dbs_address_value | SERVAUTH dbs_servauth_value))* RPARENCHAR); + SERVAUTH dbs_sql_identifier) (dbs_comma_separator (ADDRESS dbs_address_value | SERVAUTH dbs_sql_identifier))* RPARENCHAR); dbs_alter_trusted_add_use: USE FOR dbs_alter_trusted_useloop (dbs_comma_separator dbs_alter_trusted_useloop)*; dbs_alter_trusted_useloop: (dbs_authorization_name dbs_alter_trusted_useopts | EXTERNAL SECURITY PROFILE dbs_profile_name dbs_alter_trusted_useopts | PUBLIC (WITH | WITHOUT) AUTHENTICATION); dbs_alter_trusted_useopts: (ROLE dbs_role_name)? (SECURITY LABEL dbs_seclabel_name)? ((WITH|WITHOUT) AUTHENTICATION)?; dbs_alter_trusted_drop: DROP (dbs_alter_trusted_drop_attributes | dbs_alter_trusted_drop_use); -dbs_alter_trusted_drop_attributes: ATTRIBUTES LPARENCHAR (JOBNAME dbs_jobname_value? RPARENCHAR | (ADDRESS dbs_address_value? | SERVAUTH dbs_servauth_value?) (dbs_comma_separator (ADDRESS dbs_address_value? | - SERVAUTH dbs_servauth_value?))* RPARENCHAR); +dbs_alter_trusted_drop_attributes: ATTRIBUTES LPARENCHAR (JOBNAME dbs_jobname_value? RPARENCHAR | (ADDRESS dbs_address_value? | SERVAUTH dbs_sql_identifier?) (dbs_comma_separator (ADDRESS dbs_address_value? | + SERVAUTH dbs_sql_identifier?))* RPARENCHAR); dbs_alter_trusted_drop_use: USE FOR (dbs_authorization_name | EXTERNAL SECURITY PROFILE dbs_profile_name | PUBLIC) (dbs_comma_separator (dbs_authorization_name | EXTERNAL SECURITY PROFILE dbs_profile_name | PUBLIC))*; dbs_alter_trusted_replace: REPLACE dbs_alter_trusted_add_use; @@ -296,7 +296,7 @@ dbs_alter_trusted_replace: REPLACE dbs_alter_trusted_add_use; dbs_alter_view: VIEW dbs_view_name REGENERATE (USING APPLICATION COMPATIBILITY dbs_applcompat_value)?; /*ASSOCIATE LOCATORS */ -dbs_associate: ASSOCIATE (RESULT SET)? (LOCATOR | LOCATORS) LPARENCHAR dbs_rs_locator_variable (dbs_comma_separator dbs_rs_locator_variable)* RPARENCHAR +dbs_associate: ASSOCIATE (RESULT SET)? (LOCATOR | LOCATORS) LPARENCHAR dbs_host_variable (dbs_comma_separator dbs_host_variable)* RPARENCHAR WITH PROCEDURE (dbs_procedure_name | dbs_host_variable); @@ -304,7 +304,7 @@ dbs_associate: ASSOCIATE (RESULT SET)? (LOCATOR | LOCATORS) LPARENCHAR dbs_rs_lo dbs_begin: BEGIN DECLARE SECTION; /*CALL */ -dbs_call: CALL (dbs_procedure_name | dbs_variable) (USING DESCRIPTOR dbs_descriptor_name | LPARENCHAR dbs_call_loop? RPARENCHAR)?; +dbs_call: CALL (dbs_procedure_name | dbs_host_variable) (USING DESCRIPTOR dbs_descriptor_name | LPARENCHAR dbs_call_loop? RPARENCHAR)?; dbs_call_loop: (dbs_expression | NULL | TABLE dbs_transition_table_name) (dbs_comma_separator (dbs_expression | NULL | TABLE dbs_transition_table_name))*; /*CLOSE */ @@ -318,26 +318,26 @@ dbs_comment: COMMENT ON (dbs_comment_multiple_column_list | (dbs_comment_alias_d dbs_comment_multiple_column_list: (dbs_table_name | dbs_view_name) LPARENCHAR dbs_column_name IS dbs_string_constant (dbs_comma_separator dbs_column_name IS dbs_string_constant)* RPARENCHAR; dbs_comment_alias_designator: (dbs_comment_public_alias_designator | dbs_comment_nonpub_alias_designator); -dbs_comment_public_alias_designator: PUBLIC ALIAS dbs_alias_name FOR SEQUENCE; -dbs_comment_nonpub_alias_designator: ALIAS dbs_alias_name (FOR (TABLE | SEQUENCE))?; +dbs_comment_public_alias_designator: PUBLIC ALIAS dsb_alias_name FOR SEQUENCE; +dbs_comment_nonpub_alias_designator: ALIAS dsb_alias_name (FOR (TABLE | SEQUENCE))?; dbs_comment_column: COLUMN (dbs_table_name | dbs_view_name) DOT_FS dbs_column_name; dbs_comment_function: dbs_comment_function_designator (ACTIVE VERSION | VERSION dbs_routine_version_id)?; dbs_comment_function_designator: (FUNCTION dbs_function_name (LPARENCHAR dbs_comment_parameter_type (dbs_comma_separator dbs_comment_parameter_type)* RPARENCHAR)? | SPECIFIC FUNCTION dbs_specific_name); dbs_comment_parameter_type: (common_built_in_type_source | data_type_arr_or_distinct) (AS LOCATOR)?; dbs_comment_index: INDEX dbs_index_name; -dbs_comment_package: dbs_collection_id_package_name (VERSION? dbs_version_id)?; +dbs_comment_package: dbs_package_name (VERSION? dbs_version_id)?; dbs_comment_plan: PLAN dbs_plan_name; dbs_comment_procedure: PROCEDURE dbs_procedure_name (ACTIVE VERSION | VERSION dbs_routine_version_id)?; dbs_comment_role: ROLE dbs_role_name; dbs_comment_sequence: SEQUENCE dbs_sequence_name; dbs_comment_table: TABLE (dbs_table_name | dbs_view_name); dbs_comment_trigger: TRIGGER dbs_trigger_name (ACTIVE VERSION | VERSION dbs_routine_version_id)?; -dbs_comment_trusted: TRUSTED CONTEXT dbs_context NONNUMERICLITERAL; -dbs_comment_type: TYPE dbs_type_name; +dbs_comment_trusted: TRUSTED CONTEXT dbs_context_name dbs_sql_identifier; +dbs_comment_type: TYPE dbs_object_name; dbs_comment_mask: MASK dbs_mask_name; dbs_comment_permission: PERMISSION dbs_permission_name; -dbs_comment_variable: VARIABLE dbs_variable_name; +dbs_comment_variable: VARIABLE dbs_object_name; /*COMMIT */ @@ -356,14 +356,14 @@ dbs_create: CREATE (dbs_create_alias | dbs_create_aux_table | dbs_create_db | db //CREATE ALIAS dbs_create_alias: PUBLIC? ALIAS (table_alias | sequence_alias); -table_alias: dbs_alias_name FOR TABLE? (dbs_table_name | dbs_view_name | dbs_alias_name); -sequence_alias: dbs_alias_name FOR SEQUENCE dbs_sequence_name; +table_alias: dsb_alias_name FOR TABLE? (dbs_table_name | dbs_view_name | dsb_alias_name); +sequence_alias: dsb_alias_name FOR SEQUENCE dbs_sequence_name; //CREATE AUX TABLE -dbs_create_aux_table: (AUXILIARY | AUX) TABLE dbs_table_name IN dbs_database_name? dbs_table_space_name - STORES dbs_table_name (APPEND (YES|NO))? COLUMN dbs_column_name (PART dbs_integer)?; +dbs_create_aux_table: (AUXILIARY | AUX) TABLE dbs_table_name IN (dbs_database_name DOT_FS)? dbs_table_space_name + STORES dbs_table_name (APPEND (YES|NO))? COLUMN dbs_column_name (PART INTEGERLITERAL)?; //CREATE DB -dbs_create_db: DATABASE dbs_database_name (BUFFERPOOL dbs_bp_name | INDEXBP dbs_bp_name | AS WORKFILE (FOR dbs_member_name)? | STOGROUP (SYSDEFLT | dbs_stogroup_name) | CCSID oneof_encoding)*;//1 same clause must not be specified more than one time +dbs_create_db: DATABASE dbs_database_name (BUFFERPOOL dbs_bp_name | INDEXBP dbs_bp_name | AS WORKFILE (FOR dbs_sql_identifier)? | STOGROUP (SYSDEFLT | dbs_stogroup_name) | CCSID oneof_encoding)*;//1 same clause must not be specified more than one time //CREATE FUNCTION (ALL) dbs_create_function: FUNCTION dbs_function_name LPARENCHAR (dbs_create_function_compiled_scalar | dbs_create_function_ext_scalar | dbs_create_function_ext_table | @@ -391,7 +391,7 @@ dbs_create_function_ext_table_body: dbs_column_name common_built_in_type (AS LOC //CREATE INLINE SQL SCALAR FUNCTION dbs_create_function_inline_scalar: (function_param_decl (dbs_comma_separator function_param_decl)*)? RPARENCHAR (dbs_create_function_func_inl_def | WRAPPED dbs_obfuscated_statement_text); -dbs_create_function_func_inl_def: RETURNS common_built_in_type (LANGUAGE SQL)? dbs_option_list_inl_def dbs_create_function_func_inl_sql_routine; +dbs_create_function_func_inl_def: RETURNS common_built_in_type (LANGUAGE dbs_exact_match_identifier_sql)? dbs_option_list_inl_def dbs_create_function_func_inl_sql_routine; dbs_create_function_func_inl_sql_routine: RETURN dbs_control_statement; //CREATE SOURCED FUNCTION @@ -421,28 +421,28 @@ dbs_create_index_table_def_body: (dbs_column_name | dbs_expression) (ASC | DESC dbs_create_index_table_other_opt: xml_index_specification? (INCLUDE dbs_column_name LPARENCHAR (dbs_comma_separator dbs_column_name)* RPARENCHAR)? other_opt_part1 other_opt_part2 other_opt_part3; xml_index_specification: GENERATE (KEY | KEYS) USING XMLPATTERN xml_pattern_clause AS sql_data_type; xml_pattern_clause: prolog pattern_expression; -prolog: (DECLARE NAMESPACE NCNAME EQUALCHAR dbs_namespace_name dbs_semicolon_end | DECLARE DEFAULT ELEMENT NAMESPACE dbs_namespace_name dbs_semicolon_end)*; +prolog: (DECLARE NAMESPACE NCNAME EQUALCHAR VARCHAR dbs_semicolon_end | DECLARE DEFAULT ELEMENT NAMESPACE VARCHAR dbs_semicolon_end)*; pattern_expression: ( (SLASHCHAR | DOUBLESLASHCHAR) )*; other_opt_part1: (NOT? CLUSTER | PARTITIONED | NOT? PADDED | using_specification | free_specification | gbpcache_specification | DEFINE yes_or_no | COMPRESS yes_or_no | (INCLUDE | EXCLUDE) NULL KEYS)*; other_opt_part2: (PARTITION BY (RANGE)? LPARENCHAR (partition_using_specification (dbs_comma_separator partition_using_specification)*)? RPARENCHAR)?; -other_opt_part3: (BUFFERPOOL dbs_bp_name | CLOSE yes_or_no | DEFER no_or_yes | DSSIZE dbs_integer G_CHAR - | PIECESIZE IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");} +other_opt_part3: (BUFFERPOOL dbs_bp_name | CLOSE yes_or_no | DEFER no_or_yes | DSSIZE dbs_dsize_parameter + | PIECESIZE T=dbs_sql_identifier {validateTokenWithRegex($T.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");} | COPY no_or_yes)*; -partition_using_specification: partition_element (using_specification | free_specification | gbpcache_specification | DSSIZE dbs_integer G_CHAR)*; -using_specification: USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name (PRIQTY dbs_integer? | SECQTY dbs_integer | ERASE yes_or_no?)*); -free_specification: (FREEPAGE dbs_integer (PCTFREE dbs_integer)? | PCTFREE dbs_integer (FREEPAGE dbs_integer)?); +partition_using_specification: partition_element (using_specification | free_specification | gbpcache_specification | DSSIZE dbs_dsize_parameter)*; +using_specification: USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name (PRIQTY INTEGERLITERAL? | SECQTY INTEGERLITERAL | ERASE yes_or_no?)*); +free_specification: (FREEPAGE INTEGERLITERAL (PCTFREE INTEGERLITERAL)? | PCTFREE INTEGERLITERAL (FREEPAGE INTEGERLITERAL)?); gbpcache_specification: GBPCACHE (CHANGED | ALL) | NONE; -partition_element: PARTITION dbs_integer (ENDING AT? partition_element_loop INCLUSIVE?)?; +partition_element: PARTITION INTEGERLITERAL (ENDING AT? partition_element_loop INCLUSIVE?)?; partition_element_loop: LPARENCHAR const_options (dbs_comma_separator const_options)* RPARENCHAR; -const_options: dbs_string_constant | MAXVALUE | MINVALUE | dbs_integer; +const_options: dbs_string_constant | MAXVALUE | MINVALUE | INTEGERLITERAL; //CREATE LOB TABLESPACE dbs_create_lob_tablespace: LOB TABLESPACE dbs_table_space_name dbs_create_lob_tablespace_def; -dbs_create_lob_tablespace_def: (IN dbs_database_name | BUFFERPOOL dbs_bp_name | CLOSE yes_or_no | COMPRESS yes_or_no | DEFINE yes_or_no | DSSIZE dbs_integer G_CHAR | gbpcache_block | - LOCKMAX (SYSTEM | dbs_integer) | locksize_block | NOT? LOGGED | using_block)*; /*java fix */ +dbs_create_lob_tablespace_def: (IN dbs_database_name | BUFFERPOOL dbs_bp_name | CLOSE yes_or_no | COMPRESS yes_or_no | DEFINE yes_or_no | DSSIZE dbs_dsize_parameter | gbpcache_block | + LOCKMAX (SYSTEM | INTEGERLITERAL) | locksize_block | NOT? LOGGED | using_block)*; /*java fix */ gbpcache_block: GBPCACHE (CHANGED | ALL | SYSTEM | NONE); locksize_block: LOCKSIZE (ANY | LOB); -using_block: USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name (PRIQTY dbs_integer | SECQTY dbs_integer | ERASE yes_or_no?)*); +using_block: USING (VCAT dbs_catalog_name | STOGROUP dbs_stogroup_name (PRIQTY INTEGERLITERAL | SECQTY INTEGERLITERAL | ERASE yes_or_no?)*); //CREATE MASK dbs_create_mask: MASK dbs_mask_name ON dbs_table_name (AS? dbs_correlation_name)? FOR COLUMN dbs_column_name RETURN dbs_case_expression (DISABLE | ENABLE)?; @@ -467,12 +467,12 @@ dbs_create_role: ROLE dbs_role_name; //CREATE SEQUENCE dbs_create_sequence: SEQUENCE dbs_sequence_name dbs_create_sequence_body*; -dbs_create_sequence_body: AS (INTEGER | dbs_distinct_type_name | common_bit_int | common_bit_decimal) | START WITH dbs_numeric_constant | INCREMENT BY dbs_numeric_constant | - (NO MINVALUE | MINVALUE dbs_numeric_constant) | (NO MAXVALUE | MAXVALUE dbs_numeric_constant) | NO? CYCLE | (CACHE dbs_integer_constant | NO CACHE) | NO? ORDER; +dbs_create_sequence_body: AS (INTEGER | dbs_distinct_type_name | common_bit_int | common_bit_decimal) | START WITH INTEGERLITERAL | INCREMENT BY INTEGERLITERAL | + (NO MINVALUE | MINVALUE INTEGERLITERAL) | (NO MAXVALUE | MAXVALUE INTEGERLITERAL) | NO? CYCLE | (CACHE dbs_integer_constant | NO CACHE) | NO? ORDER; //CREATE STOGROUP dbs_create_stogroup: STOGROUP dbs_stogroup_name (VOLUMES LPARENCHAR dbs_volume_loop RPARENCHAR)? VCAT dbs_volume_cat; -dbs_volume_loop: dbs_volume_id (dbs_comma_separator dbs_volume_id)* | ASTERISKCHAR (dbs_comma_separator ASTERISKCHAR)*; -dbs_volume_cat: dbs_catalog_name (DATACLAS dbs_dc_name)? (MGMTCLAS dbs_mc_name)? (STORCLAS dbs_sc_name)? (NO KEY LABEL | KEY LABEL dbs_key_label_name)?; +dbs_volume_loop: dbs_sql_identifier (dbs_comma_separator dbs_sql_identifier)* | ASTERISKCHAR (dbs_comma_separator ASTERISKCHAR)*; +dbs_volume_cat: dbs_catalog_name (DATACLAS dbs_host_variable)? (MGMTCLAS dbs_sql_identifier)? (STORCLAS dbs_sql_identifier)? (NO KEY LABEL | KEY LABEL dbs_sql_identifier)?; //CREATE SYNONYM deprecated, use CREATE ALIAS @@ -482,11 +482,11 @@ dbs_create_table: TABLE dbs_table_name ( LPARENCHAR dbs_create_table_elements_de dbs_create_table_elements_def: columnn_def | period_def | unique_constraint | referential_constraint | check_constraint; columnn_def: dbs_column_name (common_built_in_type_core3 | dbs_distinct_type_name )? // Data type is optional if as-row-change-timestamp-clause is specified (NOT NULL | generated_clause | column_constraint | column_def_clause | FIELDPROC dbs_program_name - (LPARENCHAR dbs_constant (dbs_comma_separator dbs_constant)* RPARENCHAR)? | AS SECURITY LABEL | IMPLICITLY HIDDENCHAR | INLINE LENGTH dbs_integer)*;//built-in-type change + (LPARENCHAR dbs_constant (dbs_comma_separator dbs_constant)* RPARENCHAR)? | AS SECURITY LABEL | IMPLICITLY HIDDENCHAR | INLINE LENGTH INTEGERLITERAL)*;//built-in-type change column_def_clause : WITH? DEFAULT default_options?; xml_type_modifier: XMLSCHEMA xml_type_modifier_body (dbs_comma_separator xml_type_modifier_body)*; -xml_type_modifier_body: xml_schema_spec (ELEMENT dbs_element_name)?; -xml_schema_spec: ID dbs_registered_xml_schema_name | (URL dbs_target_namespace | NO NAMESPACE) (LOCATION dbs_schema_location)?; +xml_type_modifier_body: xml_schema_spec (ELEMENT dbs_sql_identifier)?; +xml_schema_spec: ID dbs_registered_xml_schema_name | (URL dbs_host_variable | NO NAMESPACE) (LOCATION dbs_schema_location)?; generated_clause: GENERATED (ALWAYS | BY DEFAULT)? (common_as_identity_clause | as_row_change_timestamp_clause)? | GENERATED ALWAYS? (as_row_transaction_start_id_clause | as_row_transaction_timestamp_clause | as_generated_expression_clause); as_row_change_timestamp_clause: FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP; @@ -499,8 +499,8 @@ session_variable: SYSIBM DOT_FS (PACKAGE_NAME | PACKAGE_SCHEMA | PACKAGE_VERSION default_options: default_options_vals | dbs_cast_function_name LPARENCHAR default_options_vals RPARENCHAR; default_options_vals: dbs_constant | (SESSION_USER | USER) | CURRENT | CURRENT SQLID | NULL; column_constraint: CONSTRAINT dbs_constraint_name (PRIMARY KEY | UNIQUE | common_reference_clause | CHECK LPARENCHAR dbs_search_condition RPARENCHAR)?; -period_def: PERIOD FOR? ( SYSTEM_TIME LPARENCHAR dbs_begin_column_name dbs_comma_separator dbs_end_column_name RPARENCHAR | - BUSINESS_TIME LPARENCHAR dbs_begin_column_name dbs_comma_separator dbs_end_column_name (EXCLUSIVE | INCLUSIVE)? RPARENCHAR ); +period_def: PERIOD FOR? ( SYSTEM_TIME LPARENCHAR dbs_column_name dbs_comma_separator dbs_column_name RPARENCHAR | + BUSINESS_TIME LPARENCHAR dbs_column_name dbs_comma_separator dbs_column_name (EXCLUSIVE | INCLUSIVE)? RPARENCHAR ); unique_constraint: (CONSTRAINT dbs_constraint_name)? (PRIMARY KEY | UNIQUE) LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* (dbs_comma_separator BUSINESS_TIME WITHOUT OVERLAPS )? RPARENCHAR; referential_constraint: (CONSTRAINT dbs_constraint_name)? FOREIGN KEY LPARENCHAR referential_constraint_body RPARENCHAR common_reference_clause; referential_constraint_body: dbs_column_name (dbs_comma_separator PERIOD BUSINESS_TIME)? (dbs_comma_separator dbs_column_name (dbs_comma_separator PERIOD BUSINESS_TIME)?)* ; @@ -513,36 +513,36 @@ column_loop: LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* R materialized_query_def: common_loop_and_fullselect refreshable_table_options; refreshable_table_options: DATA INITIALLY DEFERRED REFRESH DEFERRED ( MAINTAINED (BY SYSTEM | BY USER) | (ENABLE | DISABLE) QUERY OPTIMIZATION)*; dbs_create_table_data_def: in_clause_def | partitioning_clause | organization_clause | EDITPROC dbs_program_name (WITH | WITHOUT) ROW ATTRIBUTES | VALIDPROC dbs_program_name | AUDIT (NONE | CHANGES | ALL) - | OBID dbs_integer | DATA CAPTURE (NONE | CHANGES)? | WITH RESTRICT ON DROP | CCSID oneof_encoding | NOT? VOLATILE CARDINALITY? | - NOT? LOGGED | COMPRESS no_or_yes | APPEND no_or_yes | DSSIZE dbs_integer G_CHAR | BUFFERPOOL dbs_bp_name | MEMBER CLUSTER | - TRACKMOD (yes_or_no | dbs_imptkmod_param) | PAGENUM (dbs_pageset_pagenum_param | RELATIVE | ABSOLUTE) | (NO KEY LABEL | KEY LABEL dbs_key_label_name) ; -in_clause_def: (IN dbs_table_name? dbs_table_space_name | IN DATABASE dbs_database_name | IN ACCELERATOR dbs_accelerator_name); + | OBID INTEGERLITERAL | DATA CAPTURE (NONE | CHANGES)? | WITH RESTRICT ON DROP | CCSID oneof_encoding | NOT? VOLATILE CARDINALITY? | + NOT? LOGGED | COMPRESS no_or_yes | APPEND no_or_yes | DSSIZE dbs_dsize_parameter | BUFFERPOOL dbs_bp_name | MEMBER CLUSTER | + TRACKMOD (yes_or_no | dbs_imptkmod_param) | PAGENUM (dbs_pageset_pagenum_param | RELATIVE | ABSOLUTE) | (NO KEY LABEL | KEY LABEL dbs_sql_identifier) ; +in_clause_def: (IN (dbs_database_name DOT_FS)? dbs_table_space_name | IN DATABASE dbs_database_name | IN ACCELERATOR dbs_accelerator_name); partitioning_clause: PARTITION BY (RANGE? LPARENCHAR partition_expression (dbs_comma_separator partition_expression)* RPARENCHAR LPARENCHAR partitioning_element (dbs_comma_separator partitioning_element)* RPARENCHAR - | SIZE (EVERY IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "\\d+[Gg]", "db2SqlParser.size");})?); + | SIZE (EVERY T=dbs_sql_identifier {validateTokenWithRegex($T.text, "\\d+[Gg]", "db2SqlParser.size");})?); partition_expression: dbs_column_name (NULLS LAST)? (ASC | DESC)?; -partitioning_element: PARTITION dbs_integer ENDING AT? partition_element_loop partition_hash_space? INCLUSIVE?; -partition_hash_space: HASH SPACE dbs_integer k_m_g; +partitioning_element: PARTITION INTEGERLITERAL ENDING AT? partition_element_loop partition_hash_space? INCLUSIVE?; +partition_hash_space: HASH SPACE kmg_blob_parameter; organization_clause: ORGANIZE BY HASH UNIQUE column_loop partition_hash_space?; //CREATE TABLESPACE dbs_create_tablespace: TABLESPACE dbs_table_space_name dbs_create_tablespace_opts*; -dbs_create_tablespace_opts : IN (DSNDB04 | dbs_database_name) | BUFFERPOOL dbs_bp_name | partition_by_growth_spec | partition_by_range_spec | dbs_dpsegsz_param | - SEGSIZE dbs_integer | DSSIZE dbs_integer G_CHAR | CCSID oneof_encoding | CLOSE yes_or_no | COMPRESS no_or_yes | DEFINE no_or_yes | free_block | gbpcache_block - | INSERT ALGORITHM (ZERO_DIGIT | dbs_integer1 | dbs_integer2) | LOCKMAX (SYSTEM | dbs_integer) | locksize_block_tbl | TRACKMOD (yes_or_no | dbs_imptkmod_param) | using_block; -partition_by_growth_spec: MAXPARTITIONS (dbs_integer256 | dbs_integer (NUMPARTS dbs_integer)?); -partition_by_range_spec: NUMPARTS dbs_integer partition_by_range_spec_body*; +dbs_create_tablespace_opts : IN (DSNDB04 | dbs_database_name) | BUFFERPOOL dbs_bp_name | partition_by_growth_spec | partition_by_range_spec | + SEGSIZE INTEGERLITERAL | DSSIZE dbs_dsize_parameter | CCSID oneof_encoding | CLOSE yes_or_no | COMPRESS no_or_yes | DEFINE no_or_yes | free_block | gbpcache_block + | INSERT ALGORITHM dbs_create_algorithm_level | LOCKMAX (SYSTEM | INTEGERLITERAL) | locksize_block_tbl | TRACKMOD (yes_or_no | dbs_imptkmod_param) | using_block; +partition_by_growth_spec: MAXPARTITIONS dbs_maxPartition (NUMPARTS INTEGERLITERAL)?; +partition_by_range_spec: NUMPARTS INTEGERLITERAL partition_by_range_spec_body*; partition_by_range_spec_body: LPARENCHAR partitions_opts (dbs_comma_separator partitions_opts)* RPARENCHAR | PAGENUM (dbs_pageset_pagenum_param | ABSOLUTE | RELATIVE); -partitions_opts: PARTITION dbs_integer (using_block | free_block | gbpcache_block | COMPRESS yes_or_no | ERASE yes_or_no? | dbs_imptkmod_param | TRACKMOD yes_or_no - | DSSIZE (dbs_integer G_CHAR | IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "\\d+[Gg]", "db2SqlParser.size");}))+; -free_block: (FREEPAGE dbs_integer | PCTFREE (dbs_smallint (FOR UPDATE dbs_smallint)?)?)+; +partitions_opts: PARTITION INTEGERLITERAL (using_block | free_block | gbpcache_block | COMPRESS yes_or_no | ERASE yes_or_no? | dbs_imptkmod_param | TRACKMOD yes_or_no + | DSSIZE dbs_dsize_parameter)+; +free_block: (FREEPAGE INTEGERLITERAL | PCTFREE (dbs_smallint (FOR UPDATE dbs_smallint)?)?)+; locksize_block_tbl: LOCKSIZE (ANY | TABLESPACE | PAGE | ROW); //CREATE TRIGGER ADVANCED dbs_create_trigger_advanced: (OR REPLACE)? TRIGGER dbs_trigger_name (trigger_definition | WRAPPED dbs_obfuscated_statement_text); trigger_definition: (VERSION (V1 | dbs_trigger_version_id))? trigger_activation_time trigger_event ON (dbs_table_name | dbs_view_name) referencing_opts? trigger_granularity dbs_option_list_trigger? triggered_action; -referencing_opts: REFERENCING (OLD ROW? AS? dbs_correlation_name | NEW ROW? AS? dbs_correlation_name | OLD_TABLE AS? dbs_table_identifier | NEW_TABLE AS? dbs_identifier)+; +referencing_opts: REFERENCING (OLD ROW? AS? dbs_correlation_name | NEW ROW? AS? dbs_correlation_name | OLD_TABLE AS? dbs_table_name | NEW_TABLE AS? dbs_sql_identifier)+; trigger_activation_time: (NO CASCADE)? BEFORE | AFTER | INSTEAD OF; trigger_event: INSERT | DELETE | UPDATE (OF dbs_column_name (dbs_comma_separator dbs_column_name)*)?; trigger_granularity: (FOR EACH (STATEMENT | ROW))?; @@ -567,13 +567,13 @@ with_user_loop_body: dbs_authorization_name user_options | EXTERNAL SECURITY PRO user_options: ((ROLE dbs_role_name)? ( dbs_seclabel_name)? (without_or_with AUTHENTICATION)?); //CREATE TYPE ARRAY -dbs_create_type_array: TYPE dbs_array_type_name AS common_built_in_type_core ARRAY LSQUAREBRACKET (dbs_integer_constant | common_built_in_type2 | dbs_integer_max)? RSQUAREBRACKET ; +dbs_create_type_array: TYPE dbs_array_type_name AS common_built_in_type_core ARRAY LSQUAREBRACKET (dbs_integer_constant | common_built_in_type2)? RSQUAREBRACKET ; //TODO: Add validation for max value of 2147483647 //CREATE TYPE DISTINCT -dbs_create_type_distinct: TYPE dbs_distinct_type_name AS common_built_in_type_source (INLINE LENGTH dbs_integer)?; +dbs_create_type_distinct: TYPE dbs_distinct_type_name AS common_built_in_type_source (INLINE LENGTH INTEGERLITERAL)?; //CREATE VARIABLE -dbs_create_variable: VARIABLE dbs_variable_name (common_built_in_type_core | dbs_array_type_name) (DEFAULT NULL | DEFAULT (dbs_constant | dbs_special_register) )?; +dbs_create_variable: VARIABLE dbs_object_name (common_built_in_type_core | dbs_array_type_name) (DEFAULT NULL | DEFAULT (dbs_constant | dbs_special_register) )?; //CREATE VIEW dbs_create_view: VIEW dbs_view_name column_loop? AS tbl_expr_loop? dbs_fullselect (WITH (CASCADED | LOCAL)? CHECK OPTION)?; @@ -584,7 +584,7 @@ dbs_declare: DECLARE dbs_declare_global; dbs_declare_cursor: DECLARE dbs_cursor_name ((NO|ASENSITIVE|INSENSITIVE|SENSITIVE (DYNAMIC|STATIC)?) SCROLL)? CURSOR ((WITH|WITHOUT) HOLD | (WITHOUT RETURN|WITH RETURN TO (CALLER|CLIENT)) | (WITH|WITHOUT) ROWSET POSITIONING)* /*random ordering req*/ - FOR (dbs_select | dbs_statement_name); + FOR (dbs_select | dbs_sql_identifier); dbs_declare_global: GLOBAL TEMPORARY TABLE dbs_table_name (LPARENCHAR dbs_declare_global_coldef (dbs_comma_separator dbs_declare_global_coldef)* RPARENCHAR | (LIKE (dbs_table_name | dbs_view_name) | AS LPARENCHAR dbs_fullselect RPARENCHAR WITH NO DATA) dbs_declare_global_copyopts) (CCSID (ASCII|EBCDIC|UNICODE) | @@ -594,22 +594,22 @@ dbs_declare_global_coldef: dbs_column_name (dbs_distinct_type_name | dbs_declare dbs_declare_global_bit: (dbs_declare_global_bit_int | dbs_declare_global_bit_decimal | dbs_declare_global_bit_float | dbs_declare_global_bit_decfloat | dbs_declare_global_bit_char | dbs_declare_global_bit_varchar | dbs_declare_global_bit_graphic | dbs_declare_global_bit_binary | DATE | TIME | dbs_declare_global_bit_timestamp ); dbs_declare_global_bit_int: (SMALLINT | INT | INTEGER | BIGINT); -dbs_declare_global_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR (dbs_integer (dbs_comma_separator dbs_integer)? | NUMERICLITERAL) RPARENCHAR)?; -dbs_declare_global_bit_float: (FLOAT (LPARENCHAR dbs_integer RPARENCHAR)? | REAL | DOUBLE PRECISION?); -dbs_declare_global_bit_decfloat: DECFLOAT (LPARENCHAR (dbs_integer34 | dbs_integer16) RPARENCHAR)?; -dbs_declare_global_bit_char: (CHARACTER | CHAR) (VARYING dbs_declare_global_bit_varchara | LPARENCHAR dbs_integer RPARENCHAR) dbs_declare_global_bit_charopts?; +dbs_declare_global_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR (INTEGERLITERAL (dbs_comma_separator INTEGERLITERAL)? | NUMERICLITERAL) RPARENCHAR)?; +dbs_declare_global_bit_float: (FLOAT (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | REAL | DOUBLE PRECISION?); +dbs_declare_global_bit_decfloat: DECFLOAT (LPARENCHAR dbs_decfloat_integer RPARENCHAR)?; +dbs_declare_global_bit_char: (CHARACTER | CHAR) (VARYING dbs_declare_global_bit_varchara | LPARENCHAR INTEGERLITERAL RPARENCHAR) dbs_declare_global_bit_charopts?; dbs_declare_global_bit_charopts: (FOR (SBCS | MIXED | BIT) DATA | CCSID dbs_integer1208); dbs_declare_global_bit_varchar: VARCHAR dbs_declare_global_bit_varchara; -dbs_declare_global_bit_varchara: LPARENCHAR dbs_integer RPARENCHAR dbs_declare_global_bit_charopts?; -dbs_declare_global_bit_graphic: (GRAPHIC (LPARENCHAR dbs_integer RPARENCHAR)? | VARGRAPHIC LPARENCHAR dbs_integer RPARENCHAR) (CCSID dbs_integer1200)?; -dbs_declare_global_bit_binary: (BINARY VARYING? | VARBINARY) (LPARENCHAR dbs_integer RPARENCHAR)?; -dbs_declare_global_bit_timestamp: TIMESTAMP (LPARENCHAR dbs_integer RPARENCHAR)? option_timezone?; -dbs_declare_global_idopts: (START WITH dbs_numeric_constant | INCREMENT BY dbs_numeric_constant | NO (MAXVALUE|MINVALUE|CACHE) | (MAXVALUE|MINVALUE) dbs_numeric_constant | NO? CYCLE | CACHE dbs_integer_constant); +dbs_declare_global_bit_varchara: LPARENCHAR INTEGERLITERAL RPARENCHAR dbs_declare_global_bit_charopts?; +dbs_declare_global_bit_graphic: (GRAPHIC (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | VARGRAPHIC LPARENCHAR INTEGERLITERAL RPARENCHAR) (CCSID dbs_integer1200)?; +dbs_declare_global_bit_binary: (BINARY VARYING? | VARBINARY) (LPARENCHAR INTEGERLITERAL RPARENCHAR)?; +dbs_declare_global_bit_timestamp: TIMESTAMP (LPARENCHAR INTEGERLITERAL RPARENCHAR)? option_timezone?; +dbs_declare_global_idopts: (START WITH INTEGERLITERAL | INCREMENT BY INTEGERLITERAL | NO (MAXVALUE|MINVALUE|CACHE) | (MAXVALUE|MINVALUE) INTEGERLITERAL | NO? CYCLE | CACHE dbs_integer_constant); dbs_declare_global_copyopts: (dbs_declare_global_identity dbs_declare_global_defaults? | dbs_declare_global_defaults dbs_declare_global_identity?)?; dbs_declare_global_defaults: (USING TYPE DEFAULTS | (INCLUDING|EXCLUDING) COLUMN? DEFAULTS); dbs_declare_global_identity: (EXCLUDING|INCLUDING) IDENTITY (COLUMN ATTRIBUTES)?; -dbs_declare_statement: dbs_statement_name (dbs_comma_separator dbs_statement_name)* STATEMENT; +dbs_declare_statement: dbs_sql_identifier (dbs_comma_separator dbs_sql_identifier)* STATEMENT; // WHAT DOES THIS REPRESENT???? dbs_declare_table: DECLARE (dbs_table_name | dbs_view_name) TABLE LPARENCHAR dbs_declare_table_loop (dbs_comma_separator dbs_declare_table_loop)* RPARENCHAR; dbs_declare_table_loop: dbs_column_name (dbs_distinct_type_name | dbs_declare_table_bit) (NOT NULL (WITH DEFAULT)?)?; @@ -617,41 +617,41 @@ dbs_declare_table_bit: (dbs_declare_table_bit_int | dbs_declare_table_bit_decima dbs_declare_table_bit_clob | dbs_declare_table_bit_varchar | dbs_declare_table_bit_graphic | dbs_declare_table_bit_binary | DATE | TIME | dbs_declare_table_bit_timestamp | ROWID | XML); dbs_declare_table_bit_int: (SMALLINT | INT | INTEGER | BIGINT); -dbs_declare_table_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR (dbs_integer (dbs_comma_separator dbs_integer)? | NUMERICLITERAL) RPARENCHAR)?; -dbs_declare_table_bit_float: (FLOAT (LPARENCHAR dbs_integer RPARENCHAR)? | REAL | DOUBLE PRECISION?); -dbs_declare_table_bit_decfloat: DECFLOAT (LPARENCHAR (dbs_integer34 | dbs_integer16) RPARENCHAR)?; -dbs_declare_table_bit_char: (CHARACTER | CHAR) (VARYING dbs_declare_table_bit_varchara | LARGE OBJECT dbs_declare_table_bit_cloba | LPARENCHAR dbs_integer RPARENCHAR); +dbs_declare_table_bit_decimal: (DECIMAL | DEC | NUMERIC) (LPARENCHAR (INTEGERLITERAL (dbs_comma_separator INTEGERLITERAL)? | NUMERICLITERAL) RPARENCHAR)?; +dbs_declare_table_bit_float: (FLOAT (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | REAL | DOUBLE PRECISION?); +dbs_declare_table_bit_decfloat: DECFLOAT (LPARENCHAR dbs_decfloat_integer RPARENCHAR)?; +dbs_declare_table_bit_char: (CHARACTER | CHAR) (VARYING dbs_declare_table_bit_varchara | LARGE OBJECT dbs_declare_table_bit_cloba | LPARENCHAR INTEGERLITERAL RPARENCHAR); dbs_declare_table_bit_varchar: VARCHAR dbs_declare_table_bit_varchara; -dbs_declare_table_bit_varchara: LPARENCHAR dbs_integer RPARENCHAR; +dbs_declare_table_bit_varchara: LPARENCHAR INTEGERLITERAL RPARENCHAR; dbs_declare_table_bit_clob: CLOB dbs_declare_table_bit_cloba; -dbs_declare_table_bit_cloba: (LPARENCHAR lobSize RPARENCHAR)?; -dbs_declare_table_bit_graphic: (GRAPHIC (LPARENCHAR dbs_integer RPARENCHAR)? | VARGRAPHIC LPARENCHAR dbs_integer RPARENCHAR | DBCLOB (LPARENCHAR lobSize RPARENCHAR)?); -dbs_declare_table_bit_binary: (BINARY (LPARENCHAR dbs_integer RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR dbs_integer RPARENCHAR | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR lobSize RPARENCHAR)?); -dbs_declare_table_bit_timestamp: TIMESTAMP (LPARENCHAR dbs_integer RPARENCHAR)? ((WITH|WITHOUT) (TIME ZONE|TIMEZONE))?; +dbs_declare_table_bit_cloba: (LPARENCHAR kmg_blob_parameter RPARENCHAR)?; +dbs_declare_table_bit_graphic: (GRAPHIC (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | VARGRAPHIC LPARENCHAR INTEGERLITERAL RPARENCHAR | DBCLOB (LPARENCHAR kmg_blob_parameter RPARENCHAR)?); +dbs_declare_table_bit_binary: (BINARY (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR INTEGERLITERAL RPARENCHAR | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR kmg_blob_parameter RPARENCHAR)?); +dbs_declare_table_bit_timestamp: TIMESTAMP (LPARENCHAR INTEGERLITERAL RPARENCHAR)? ((WITH|WITHOUT) (TIME ZONE|TIMEZONE))?; /*DELETE */ dbs_delete: DELETE FROM (dbs_table_name | dbs_view_name) (dbs_delete_period | dbs_delete_noperiod | dbs_delete_positioned); dbs_delete_period: dbs_delete_period_clause dbs_correlation_name? dbs_delete_include_column? (SET dbs_delete_assignment_clause)? - (WHERE dbs_search_condition)? (dbs_delete_isolation_clause | SKIPCHAR LOCKED DATA)* (QUERYNO dbs_integer)?; -dbs_delete_period_clause: FOR PORTION OF BUSINESS_TIME (FROM dbs_value TO dbs_value | BETWEEN dbs_value AND dbs_value)?; + (WHERE dbs_search_condition)? (dbs_delete_isolation_clause | SKIPCHAR LOCKED DATA)* (QUERYNO INTEGERLITERAL)?; +dbs_delete_period_clause: FOR PORTION OF BUSINESS_TIME (FROM dbs_expressions TO dbs_expressions | BETWEEN dbs_expressions AND dbs_expressions)?; dbs_delete_include_column: INCLUDE LPARENCHAR dbs_column_name dbs_delete_data_type (dbs_comma_separator dbs_column_name dbs_delete_data_type)* RPARENCHAR; dbs_delete_data_type: (common_short_built_in_type | dbs_distinct_type); dbs_delete_assignment_clause: (dbs_delete_assignment_clause_whole | dbs_delete_assignment_clause_part); dbs_delete_assignment_clause_whole: dbs_column_name EQUALCHAR (dbs_expression | NULL) (dbs_comma_separator dbs_column_name EQUALCHAR (dbs_expression | NULL))*; -dbs_delete_assignment_clause_part: LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* RPARENCHAR EQUALCHAR LPARENCHAR (dbs_select_row_fullselect | (dbs_expression | +dbs_delete_assignment_clause_part: LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* RPARENCHAR EQUALCHAR LPARENCHAR (dbs_fullselect | (dbs_expression | NULL) (dbs_comma_separator (dbs_expression | NULL)*)) RPARENCHAR; dbs_delete_isolation_clause: WITH (RR | RS | CS); dbs_delete_noperiod: dbs_correlation_name? dbs_delete_include_column? (SET dbs_delete_assignment_clause)? (WHERE dbs_search_condition)? - dbs_fetch_clause? (dbs_delete_isolation_clause | SKIPCHAR LOCKED DATA)* (QUERYNO dbs_integer)?; + dbs_fetch_clause? (dbs_delete_isolation_clause | SKIPCHAR LOCKED DATA)* (QUERYNO INTEGERLITERAL)?; dbs_delete_positioned: dbs_correlation_name? WHERE CURRENT OF dbs_cursor_name (FOR ROW (dbs_host_variable | dbs_integer_constant) OF ROWSET)?; /*DESCRIBE (all) */ dbs_describe: DESCRIBE (dbs_describe_cursor | dbs_describe_input | dbs_describe_output | dbs_describe_procedure | dbs_describe_table); dbs_describe_cursor: CURSOR (dbs_cursor_name | dbs_host_variable) INTO dbs_descriptor_name; -dbs_describe_input: INPUT dbs_statement_name INTO dbs_descriptor_name; -dbs_describe_output: OUTPUT? dbs_statement_name INTO dbs_descriptor_name (USING (NAMES | LABELS | ANY | BOTH))?; +dbs_describe_input: INPUT dbs_sql_identifier INTO dbs_descriptor_name; +dbs_describe_output: OUTPUT? dbs_sql_identifier INTO dbs_descriptor_name (USING (NAMES | LABELS | ANY | BOTH))?; dbs_describe_procedure: PROCEDURE (dbs_procedure_name | dbs_host_variable) INTO dbs_descriptor_name; -dbs_describe_table: TABLE dbs_host_names_var INTO dbs_descriptor_name (USING (NAMES | LABELS | ANY | BOTH))?; +dbs_describe_table: TABLE dbs_sql_variable_reference INTO dbs_descriptor_name (USING (NAMES | LABELS | ANY | BOTH))?; /*DROP */ @@ -660,28 +660,28 @@ dbs_drop: DROP (dbs_drop_alias_designator | dbs_drop_database | dbs_drop_functio dbs_drop_sequence | dbs_drop_stogroup | dbs_drop_synonym | dbs_drop_table | dbs_drop_tablespace | dbs_drop_trigger | dbs_drop_trusted | dbs_drop_type | dbs_drop_variable | dbs_drop_view); dbs_drop_alias_designator: (dbs_drop_public_alias_designator | dbs_drop_nonpub_alias_designator); -dbs_drop_public_alias_designator: PUBLIC ALIAS dbs_alias_name FOR SEQUENCE; -dbs_drop_nonpub_alias_designator: ALIAS dbs_alias_name (FOR (TABLE | SEQUENCE))?; +dbs_drop_public_alias_designator: PUBLIC ALIAS dsb_alias_name FOR SEQUENCE; +dbs_drop_nonpub_alias_designator: ALIAS dsb_alias_name (FOR (TABLE | SEQUENCE))?; dbs_drop_database: DATABASE dbs_database_name; dbs_drop_function: FUNCTION dbs_function_name (LPARENCHAR (dbs_drop_parameter_type (dbs_comma_separator dbs_drop_parameter_type)*)? RPARENCHAR)? RESTRICT?; dbs_drop_parameter_type: (common_built_in_type | dbs_distinct_type_name | dbs_array_type_name) (AS LOCATOR)?; dbs_drop_specific: SPECIFIC FUNCTION dbs_specific_name RESTRICT?; dbs_drop_index: INDEX dbs_index_name; dbs_drop_mask: MASK dbs_mask_name; -dbs_drop_package: PACKAGE dbs_collection_id_package_name (VERSION? dbs_version_id)?; +dbs_drop_package: PACKAGE dbs_package_name (VERSION? dbs_version_id)?; dbs_drop_permission: PERMISSION dbs_permission_name; dbs_drop_procedure: PROCEDURE dbs_procedure_name RESTRICT?; dbs_drop_role: ROLE dbs_role_name RESTRICT?; dbs_drop_sequence: SEQUENCE dbs_sequence_name RESTRICT?; dbs_drop_stogroup: STOGROUP dbs_stogroup_name; dbs_drop_synonym: SYNONYM dbs_synonym; -dbs_drop_table: TABLE (dbs_table_name | dbs_alias_name); -dbs_drop_tablespace: TABLESPACE dbs_database_name? dbs_table_space_name; +dbs_drop_table: TABLE (dbs_table_name | dsb_alias_name); +dbs_drop_tablespace: TABLESPACE (dbs_database_name DOT_FS)? dbs_table_space_name; dbs_drop_trigger: TRIGGER dbs_trigger_name; -dbs_drop_trusted: TRUSTED CONTEXT dbs_context; -dbs_drop_type: TYPE dbs_type_name RESTRICT?; -dbs_drop_variable: VARIABLE dbs_variable_name RESTRICT?; -dbs_drop_view: VIEW (dbs_view_name | dbs_alias_name); +dbs_drop_trusted: TRUSTED CONTEXT dbs_context_name; +dbs_drop_type: TYPE dbs_object_name RESTRICT?; +dbs_drop_variable: VARIABLE dbs_object_name RESTRICT?; +dbs_drop_view: VIEW (dbs_view_name | dsb_alias_name); /*END DECLARE SECTION */ @@ -692,21 +692,23 @@ dbs_exchange: EXCHANGE DATA BETWEEN TABLE dbs_table_name AND dbs_table_name; /*EXECUTE / EXECUTE IMMEDIATE - note LSQUAREBRACKET and RSQUAREBRACKET are new additions to the lexer!*/ dbs_execute: EXECUTE (dbs_execute_statement | dbs_execute_immediate); -dbs_execute_statement: dbs_statement_name (USING (dbs_execute_varloop | dbs_execute_hostloop | dbs_execute_descriptor))?; -dbs_execute_varloop: (dbs_variable | dbs_array_variable LSQUAREBRACKET dbs_array_index RSQUAREBRACKET) (dbs_comma_separator (dbs_variable | - dbs_array_variable LSQUAREBRACKET dbs_array_index RSQUAREBRACKET))*; -dbs_execute_hostloop: (dbs_host_variable_array | dbs_host_variable) (dbs_comma_separator (dbs_host_variable_array | +dbs_execute_statement: dbs_sql_identifier (USING (dbs_execute_varloop | dbs_execute_hostloop | dbs_execute_descriptor))?; +dbs_execute_varloop: (dbs_host_variable | dbs_array_variable LSQUAREBRACKET INTEGERLITERAL RSQUAREBRACKET) (dbs_comma_separator (dbs_host_variable | + dbs_array_variable LSQUAREBRACKET INTEGERLITERAL RSQUAREBRACKET))*; +dbs_execute_hostloop: (dbs_array_type_name | dbs_host_variable) (dbs_comma_separator (dbs_array_type_name | dbs_host_variable))* (FOR (dbs_host_variable | dbs_integer_constant) ROWS)?; dbs_execute_descriptor: DESCRIPTOR dbs_descriptor_name (FOR (dbs_host_variable | dbs_integer_constant) ROWS)?; -dbs_execute_immediate: IMMEDIATE (dbs_variable | dbs_string_expression) (dbs_expression_operator (dbs_variable | dbs_string_expression))*; +dbs_execute_immediate: IMMEDIATE (dbs_sql_variable_reference | dbs_string_expression) ; +//(dbs_expression_operator (dbs_host_variable | dbs_string_expression))*; <--- cant find in docs https://www.ibm.com/docs/en/db2-for-zos/13?topic=statements-execute-immediate /*EXPLAIN */ dbs_explain: EXPLAIN (dbs_explain_plan | dbs_explain_stmtcache | dbs_explain_package | dbs_explain_stabilized); -dbs_explain_plan: (PLAN | ALL) (SET QUERYNO EQUALCHAR dbs_integer)? FOR dbs_explainable_sql_statement; -dbs_explain_stmtcache: STMTCACHE (ALL | STMTID (dbs_id_host_variable | dbs_integer_constant) | STMTTOKEN (dbs_token_host_variable | dbs_string_constant)); +dbs_explain_plan: (PLAN | ALL) (SET QUERYNO EQUALCHAR INTEGERLITERAL)? FOR dbs_explainable_sql_statement; +dbs_explain_stmtcache: STMTCACHE (ALL | STMTID (NUMERICLITERAL | dbs_integer_constant) | STMTTOKEN (dbs_token_host_variable | dbs_string_constant)); +dbs_token_host_variable: dbs_sql_variable_reference | INTEGERLITERAL; dbs_explain_package: PACKAGE COLLECTION dbs_collection_name PACKAGE dbs_package_name (VERSION dbs_version_name)? (COPY dbs_copy_id)?; -dbs_explain_stabilized: STABILIZED DYNAMIC QUERY STMTID (dbs_id_host_variable | dbs_integer_constant) (COPY SINGLEQUOTE (CURRENT | INVALID) SINGLEQUOTE)?; +dbs_explain_stabilized: STABILIZED DYNAMIC QUERY STMTID (NUMERICLITERAL | dbs_integer_constant) (COPY SINGLEQUOTE (CURRENT | INVALID) SINGLEQUOTE)?; /*FETCH */ @@ -715,29 +717,27 @@ dbs_fetch_beforeafter: (BEFORE | AFTER) FROM? dbs_cursor_name; dbs_fetch_singlemulti: (INSENSITIVE | SENSITIVE)? (dbs_fetch_single | dbs_fetch_multi); dbs_fetch_single: (WITH CONTINUE)? dbs_fetch_rowpos? FROM? dbs_cursor_name dbs_fetch_singlerow?; dbs_fetch_rowpos: (NEXT | PRIOR | FIRST | LAST | CURRENT CONTINUE? | (ABSOLUTE | RELATIVE) (dbs_host_variable | dbs_integer_constant)); -dbs_fetch_singlerow: INTO (DESCRIPTOR dbs_descriptor_name | dbs_array_variable LSQUAREBRACKET dbs_array_index RSQUAREBRACKET | - dbs_fetch_target_variable (dbs_comma_separator dbs_fetch_target_variable)*); -dbs_fetch_target_variable: (dbs_global_variable_name | dbs_host_variable | dbs_sql_parameter_name | - dbs_sql_variable_name | dbs_transition_variable_name); +dbs_fetch_singlerow: INTO (DESCRIPTOR dbs_descriptor_name | dbs_array_variable LSQUAREBRACKET INTEGERLITERAL RSQUAREBRACKET | + dbs_sql_variable_reference (dbs_comma_separator dbs_sql_variable_reference)*); dbs_fetch_multi: dbs_fetch_rowsetpos? FROM? dbs_cursor_name dbs_fetch_multirow; dbs_fetch_rowsetpos: (ROWSET STARTING AT (ABSOLUTE | RELATIVE) (dbs_host_variable | dbs_integer_constant) | (NEXT | PRIOR | FIRST | LAST | CURRENT) ROWSET); dbs_fetch_multirow: (FOR (dbs_host_variable | dbs_integer_constant) ROWS)? ((INTO | USING) (DESCRIPTOR dbs_descriptor_name | - dbs_fetch_target_variable (dbs_comma_separator dbs_fetch_target_variable)*))?; + dbs_sql_variable_reference (dbs_comma_separator dbs_sql_variable_reference)*))?; /*FREE LOCATOR */ dbs_free: FREE LOCATOR dbs_host_variable (dbs_comma_separator dbs_host_variable)*; /*GET DIAGNOSTICS */ -dbs_get: GET (CURRENT | STACKED)? DIAGNOSTICS (dbs_get_statement | dbs_get_condition | dbs_get_combi); -dbs_get_statement: dbs_variable EQUALCHAR (dbs_get_statement_loop (dbs_comma_separator dbs_variable EQUALCHAR dbs_get_statement_loop)* | DB2_GET_DIAGNOSTICS_DIAGNOSTICS | DB2_SQL_NESTING_LEVEL); +dbs_get_diagnostics_statement: GET (CURRENT | STACKED)? DIAGNOSTICS (dbs_get_statement | dbs_get_condition | dbs_get_combi); +dbs_get_statement: dbs_host_variable EQUALCHAR (dbs_get_statement_loop (dbs_comma_separator dbs_host_variable EQUALCHAR dbs_get_statement_loop)* | DB2_GET_DIAGNOSTICS_DIAGNOSTICS | DB2_SQL_NESTING_LEVEL); dbs_get_statement_loop: dbs_get_statement_item (dbs_comma_separator dbs_get_statement_item)*; dbs_get_statement_item: (DB2_LAST_ROW | DB2_NUMBER_PARAMETER_MARKERS | DB2_NUMBER_RESULT_SETS | DB2_NUMBER_ROWS | DB2_RETURN_STATUS | DB2_SQL_ATTR_CURSOR_HOLD | DB2_SQL_ATTR_CURSOR_ROWSET | DB2_SQL_ATTR_CURSOR_SCROLLABLE | DB2_SQL_ATTR_CURSOR_SENSITIVITY | DB2_SQL_ATTR_CURSOR_TYPE | MORECHAR | NUMBER | ROW_COUNT); -dbs_get_condition: CONDITION (dbs_variable | dbs_integer) dbs_variable EQUALCHAR (dbs_get_condition_item | dbs_get_connection_item) (dbs_comma_separator - dbs_variable EQUALCHAR (dbs_get_condition_item | dbs_get_connection_item))*; +dbs_get_condition: CONDITION (dbs_host_variable | INTEGERLITERAL) dbs_host_variable EQUALCHAR (dbs_get_condition_item | dbs_get_connection_item) (dbs_comma_separator + dbs_host_variable EQUALCHAR (dbs_get_condition_item | dbs_get_connection_item))*; dbs_get_condition_item: (CATALOG_NAME | CONDITION_NUMBER | CURSOR_NAME | DB2_ERROR_CODE1 | DB2_ERROR_CODE2 | DB2_ERROR_CODE3 | DB2_ERROR_CODE4 | DB2_INTERNAL_ERROR_POINTER | DB2_LINE_NUMBER | DB2_MESSAGE_ID | DB2_MODULE_DETECTING_ERROR | DB2_ORDINAL_TOKEN1 | DB2_ORDINAL_TOKEN2 |DB2_ORDINAL_TOKEN3 |DB2_ORDINAL_TOKEN4 | DB2_REASON_CODE | @@ -745,24 +745,23 @@ dbs_get_condition_item: (CATALOG_NAME | CONDITION_NUMBER | CURSOR_NAME | DB2_ERR DB2_SQLERRD4 | DB2_SQLERRD5 | DB2_SQLERRD6 | DB2_TOKEN_COUNT | MESSAGE_TEXT | RETURNED_SQLSTATE | SERVER_NAME); dbs_get_connection_item: (DB2_AUTHENTICATION_TYPE | DB2_AUTHORIZATION_ID | DB2_CONNECTION_STATE | DB2_CONNECTION_STATUS | DB2_ENCRYPTION_TYPE | DB2_SERVER_CLASS_NAME | DB2_PRODUCT_ID); -dbs_get_combi: dbs_variable EQUALCHAR ALL dbs_get_combi_loop (dbs_comma_separator dbs_get_combi_loop)*; -dbs_get_combi_loop: (STATEMENT | (CONDITION | CONNECTION) (dbs_variable | dbs_integer)?); +dbs_get_combi: dbs_host_variable EQUALCHAR ALL dbs_get_combi_loop (dbs_comma_separator dbs_get_combi_loop)*; +dbs_get_combi_loop: (STATEMENT | (CONDITION | CONNECTION) (dbs_host_variable | INTEGERLITERAL)?); /*the limitations of ANTLR don't allow for codifying the following rules: 1. STATEMENT can only be specified once, 2. CONDITION and CONNECTION can only be specified once if variable or integer is also not specified. */ /*GRANT (all) */ -dbs_grant: GRANT (dbs_grant_null | dbs_grant_collection | dbs_grant_database | dbs_grant_function | dbs_grant_package | dbs_grant_plan | dbs_grant_schema | dbs_grant_sequence | +dbs_grant: GRANT (dbs_grant_collection | dbs_grant_database | dbs_grant_function | dbs_grant_package | dbs_grant_plan | dbs_grant_schema | dbs_grant_sequence | dbs_grant_system | dbs_grant_table | dbs_grant_type | dbs_grant_variable | dbs_grant_use); dbs_grant_authloop: (dbs_authorization_name | ROLE dbs_role_name | PUBLIC); -dbs_grant_null: dbs_authorization_specification TO dbs_grant_authloop (dbs_comma_separator (dbs_authorization_name | ROLE dbs_role_name | PUBLIC))* (WITH GRANT OPTION)?; dbs_grant_collection: (CREATE|PACKADM) (ON|IN) COLLECTION (ASTERISKCHAR | dbs_collection_id (dbs_comma_separator dbs_collection_id)*) TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; dbs_grant_database: db2sql_db_privileges (dbs_comma_separator db2sql_db_privileges)* ON DATABASE dbs_database_name (dbs_comma_separator dbs_database_name)* TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; dbs_grant_function: EXECUTE ON (PROCEDURE (ASTERISKCHAR | dbs_procedure_name (dbs_comma_separator dbs_procedure_name)*) | SPECIFIC FUNCTION dbs_specific_name (dbs_comma_separator dbs_specific_name)* | FUNCTION dbs_grant_function_loop (dbs_comma_separator dbs_grant_function_loop)*) TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; dbs_grant_function_loop: dbs_function_name (LPARENCHAR (data_type (AS LOCATOR)? (dbs_comma_separator data_type (AS LOCATOR)?)*)? RPARENCHAR)?; -dbs_grant_package: (ALL | (BIND|COPY|EXECUTE|RUN) (dbs_comma_separator (BIND|COPY|EXECUTE|RUN))*) ON PACKAGE (FILENAME | dbs_collection_id SELECT_ALL) - (dbs_comma_separator (FILENAME | dbs_collection_id SELECT_ALL))* TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; +dbs_grant_package: (ALL | (BIND|COPY|EXECUTE|RUN) (dbs_comma_separator (BIND|COPY|EXECUTE|RUN))*) ON PACKAGE (dbs_collection_id DOT_FS (dbs_package_name | ASTERISKCHAR)) + (dbs_comma_separator (dbs_collection_id DOT_FS (dbs_package_name | ASTERISKCHAR)))* TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; dbs_grant_plan: (BIND|EXECUTE) (dbs_comma_separator (BIND|EXECUTE))* ON PLAN dbs_plan_name (dbs_comma_separator dbs_plan_name)* TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; dbs_grant_schema: (ALTERIN|CREATEIN|DROPIN) (dbs_comma_separator (ALTERIN|CREATEIN|DROPIN))* ON SCHEMA (ASTERISKCHAR|dbs_schema_name (dbs_comma_separator dbs_schema_name)*) TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; @@ -770,8 +769,8 @@ dbs_grant_sequence: (ALTER|USAGE|SELECT) (dbs_comma_separator (ALTER|USAGE|SELEC dbs_grant_system: db2sql_system_privileges (dbs_comma_separator db2sql_system_privileges)* (ON SYSTEM)? TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; dbs_grant_table: (ALL PRIVILEGES? | db2sql_table_view_privileges (dbs_comma_separator db2sql_table_view_privileges)*) ON TABLE? (dbs_table_name | dbs_view_name) (dbs_comma_separator (dbs_table_name | dbs_view_name))* TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; -dbs_grant_type: USAGE ON (TYPE dbs_type_name (dbs_comma_separator dbs_type_name)* | JAR dbs_jar_name (dbs_comma_separator dbs_jar_name)*) TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; -dbs_grant_variable: (ALL PRIVILEGES? | (READ|WRITE) (dbs_comma_separator (READ|WRITE))*) ON VARIABLE dbs_variable_name TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; +dbs_grant_type: USAGE ON (TYPE dbs_object_name (dbs_comma_separator dbs_object_name)* | JAR dbs_host_identifier (dbs_comma_separator dbs_host_identifier)*) TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; +dbs_grant_variable: (ALL PRIVILEGES? | (READ|WRITE) (dbs_comma_separator (READ|WRITE))*) ON VARIABLE dbs_object_name TO dbs_grant_authloop (dbs_comma_separator dbs_grant_authloop)* (WITH GRANT OPTION)?; dbs_grant_use: USE OF (BUFFERPOOL dbs_bp_name (dbs_comma_separator dbs_bp_name)* | ALL BUFFERPOOLS | STOGROUP dbs_stogroup_name (dbs_comma_separator dbs_stogroup_name)* | TABLESPACE (dbs_database_name DOT_FS)? dbs_table_space_name (dbs_comma_separator (dbs_database_name DOT_FS)? dbs_table_space_name)*) TO (dbs_authorization_name | ROLE dbs_role_name | PUBLIC) (dbs_comma_separator (dbs_authorization_name | ROLE dbs_role_name | PUBLIC))* @@ -782,7 +781,7 @@ dbs_grant_use: USE OF (BUFFERPOOL dbs_bp_name (dbs_comma_separator dbs_bp_name) dbs_hold: HOLD LOCATOR dbs_host_variable (dbs_comma_separator dbs_host_variable)*; /*INCLUDE */ -dbs_include: INCLUDE dbs_member_name; +dbs_include: INCLUDE dbs_sql_identifier; dbs_include_sqlca: INCLUDE SQLCA; dbs_include_sqlda: INCLUDE SQLDA; @@ -796,70 +795,74 @@ dbs_insert_data_type: (common_short_built_in_type | dbs_distinct_type); dbs_insert_values: (VALUES (dbs_insert_values_single | dbs_insert_values_multi)) | dbs_insert_fullselect; dbs_insert_values_single: (dbs_expression | DEFAULT | NULL) | LPARENCHAR dbs_insert_values_sgloop RPARENCHAR; dbs_insert_values_sgloop: (dbs_expressions | DEFAULT | NULL) (dbs_comma_separator (dbs_expressions | DEFAULT | NULL) | NUMERICLITERAL)*; -dbs_insert_values_multi: (dbs_expression | dbs_host_variable_array | DEFAULT | NULL | LPARENCHAR dbs_insert_values_mloop RPARENCHAR) +dbs_insert_values_multi: (dbs_expression | dbs_array_type_name | DEFAULT | NULL | LPARENCHAR dbs_insert_values_mloop RPARENCHAR) (FOR (dbs_host_variable | T=dbs_integer_constant {validateDb2MaxInt($T.text);}) ROWS)? (ATOMIC | NOT ATOMIC CONTINUE ON SQLEXCEPTION)?; -dbs_insert_values_mloop: (dbs_expression | dbs_host_variable_array | DEFAULT | NULL) (dbs_comma_separator (dbs_expression | - dbs_host_variable_array | DEFAULT | NULL))*; -dbs_insert_fullselect: (WITH dbs_select_statement_common_table_expression (dbs_comma_separator dbs_select_statement_common_table_expression)*)? dbs_fullselect (WITH (RR|RS|CS))? (QUERYNO dbs_integer)?; +dbs_insert_values_mloop: (dbs_expression | dbs_array_type_name | DEFAULT | NULL) (dbs_comma_separator (dbs_expression | + dbs_array_type_name | DEFAULT | NULL))*; +dbs_insert_fullselect: (WITH dbs_select_statement_common_table_expression (dbs_comma_separator dbs_select_statement_common_table_expression)*)? dbs_fullselect (WITH (RR|RS|CS))? (QUERYNO INTEGERLITERAL)?; /*LABEL */ dbs_label: LABEL ON (dbs_label_sing | dbs_label_loop); dbs_label_sing: (dbs_label_table | dbs_label_alias | dbs_label_column) IS dbs_string_constant; dbs_label_table: TABLE (dbs_table_name | dbs_view_name); -dbs_label_alias: ALIAS dbs_alias_name; +dbs_label_alias: ALIAS dsb_alias_name; dbs_label_column: COLUMN (dbs_table_name | dbs_view_name) DOT_FS dbs_column_name; dbs_label_loop: (dbs_table_name | dbs_view_name) LPARENCHAR dbs_column_name IS dbs_string_constant (dbs_comma_separator dbs_column_name IS dbs_string_constant)* RPARENCHAR; /*LOCK TABLE */ -dbs_lock: LOCK TABLE dbs_table_name (PARTITION dbs_integer)? IN (SHARE | EXCLUSIVE) MODE; +dbs_lock: LOCK TABLE dbs_table_name (PARTITION INTEGERLITERAL)? IN (SHARE | EXCLUSIVE) MODE; /*MERGE */ -dbs_merge: MERGE INTO (dbs_table_name | dbs_view_name) dbs_merge_correlation? dbs_merge_include? USING (dbs_table_reference | +dbs_merge: MERGE INTO dsb_alias_name dbs_merge_correlation? dbs_merge_include? USING (dbs_table_reference | dbs_merge_values) ON dbs_search_condition (WHEN NOT? MATCHED (AND dbs_search_condition)? THEN (dbs_signal | - dbs_merge_update | DELETE | dbs_merge_insert))+ (ELSE IGNORE)? (NOT ATOMIC CONTINUE ON SQLEXCEPTION)? (QUERYNO dbs_integer)?; + dbs_merge_update | DELETE | dbs_merge_insert))+ (ELSE IGNORE)? (NOT ATOMIC CONTINUE ON SQLEXCEPTION)? (QUERYNO INTEGERLITERAL)?; dbs_merge_correlation: AS? dbs_correlation_name (LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* RPARENCHAR)?; dbs_merge_include: INCLUDE LPARENCHAR dbs_column_name (common_short_built_in_type | dbs_distinct_type) (dbs_comma_separator dbs_column_name (common_short_built_in_type | dbs_distinct_type))* RPARENCHAR; dbs_merge_values: LPARENCHAR VALUES (dbs_merge_values_sing | dbs_merge_values_multi) RPARENCHAR AS? dbs_correlation_name LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* RPARENCHAR; dbs_merge_values_sing: (dbs_expression | NULL | LPARENCHAR (dbs_expression | NULL) (dbs_comma_separator (dbs_expression | NULL))* RPARENCHAR); -dbs_merge_values_multi: (dbs_expression | dbs_host_variable_array | NULL | LPARENCHAR (dbs_expression | dbs_host_variable_array | - NULL) (dbs_comma_separator (dbs_expression | dbs_host_variable_array | NULL))* RPARENCHAR) FOR (dbs_host_variable | dbs_integer_constant) ROWS; +dbs_merge_values_multi: (dbs_expression | dbs_array_type_name | NULL | LPARENCHAR (dbs_expression | dbs_array_type_name | + NULL) (dbs_comma_separator (dbs_expression | dbs_array_type_name | NULL))* RPARENCHAR) FOR (dbs_host_variable | dbs_integer_constant) ROWS; dbs_merge_update: UPDATE SET dbs_merge_assignment (dbs_comma_separator dbs_merge_assignment)*; dbs_merge_assignment: (dbs_column_name EQUALCHAR (dbs_expressions | DEFAULT | NULL) | LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* - RPARENCHAR EQUALCHAR LPARENCHAR (dbs_select_row_fullselect | (dbs_expression | DEFAULT | NULL) (dbs_comma_separator (dbs_expression | DEFAULT | NULL))*) RPARENCHAR); + RPARENCHAR EQUALCHAR LPARENCHAR (dbs_fullselect | (dbs_expression | DEFAULT | NULL) (dbs_comma_separator (dbs_expression | DEFAULT | NULL))*) RPARENCHAR); dbs_merge_insert: INSERT (LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* RPARENCHAR)? VALUES (dbs_expression | DEFAULT | NULL | LPARENCHAR (dbs_expression | DEFAULT | NULL) (dbs_comma_separator (dbs_expression | DEFAULT | NULL))* RPARENCHAR); /*OPEN */ -dbs_open: OPEN dbs_cursor_name (USING (DESCRIPTOR dbs_descriptor_name) | (dbs_variable | dbs_array_variable - LSQUAREBRACKET dbs_array_index RSQUAREBRACKET) (dbs_comma_separator (dbs_variable | dbs_array_variable LSQUAREBRACKET dbs_array_index RSQUAREBRACKET))*)?; +dbs_open: OPEN dbs_cursor_name (USING (DESCRIPTOR dbs_descriptor_name) | (dbs_host_variable | dbs_array_variable + LSQUAREBRACKET INTEGERLITERAL RSQUAREBRACKET) (dbs_comma_separator (dbs_host_variable | dbs_array_variable LSQUAREBRACKET INTEGERLITERAL RSQUAREBRACKET))*)?; /*PREPARE */ -dbs_prepare: PREPARE dbs_statement_name (INTO dbs_descriptor_name (USING (NAMES | LABELS | ANY | BOTH))?)? (FROM dbs_string_expression | (ATTRIBUTES dbs_attr_host_variable)? FROM dbs_variable); +// removing dbs_string_expression as per doc https://www.ibm.com/docs/en/db2-for-zos/13?topic=statements-prepare +// string-expression is only supported for PLI. +dbs_prepare: PREPARE dbs_statement_name (INTO dbs_descriptor_name (USING (NAMES | LABELS | ANY | BOTH))?)? +// (FROM dbs_string_expression +// | (ATTRIBUTES dbs_attr_host_variable)? FROM dbs_host_variable) + (ATTRIBUTES dbs_attr_host_variable)? FROM dbs_host_variable; /*REFRESH TABLE */ -dbs_refresh: REFRESH TABLE dbs_table_name (QUERYNO dbs_integer)?; +dbs_refresh: REFRESH TABLE dbs_table_name (QUERYNO INTEGERLITERAL)?; /* RELEASE (both) */ -dbs_release: RELEASE (dbs_location_name | CURRENT | ALL SQL? | TO? SAVEPOINT dbs_savepoint_name | dbs_host_variable); +dbs_release: RELEASE (dbs_location_name | CURRENT | ALL dbs_exact_match_identifier_sql? | TO? SAVEPOINT dbs_savepoint_name | dbs_host_variable); dbs_savepoint_name: T=dbs_savepoint_name_rule {validateLength($T.text, "Savepoint name", 128);}; -dbs_savepoint_name_rule: (NONNUMERICLITERAL | NUMERICLITERAL)+ | IDENTIFIER; +dbs_savepoint_name_rule: NUMERICLITERAL+ | dbs_sql_identifier; /*RENAME */ -dbs_rename: RENAME (TABLE? dbs_table_name TO dbs_table_identifier | INDEX dbs_index_name TO dbs_index_identifier); +dbs_rename: RENAME (TABLE? dbs_table_name TO dbs_table_name | INDEX dbs_index_name TO dbs_sql_identifier); /*REVOKE (all) */ -dbs_revoke: REVOKE (dbs_revoke_authorized_spec | dbs_revoke_coll_prvg | dbs_revoke_db_prvg | dbs_revoke_func_or_proc_prvg | dbs_revoke_pack_prvg | dbs_revoke_plan_prvg | +dbs_revoke: REVOKE (dbs_revoke_coll_prvg | dbs_revoke_db_prvg | dbs_revoke_func_or_proc_prvg | dbs_revoke_pack_prvg | dbs_revoke_plan_prvg | dbs_revoke_schema_prvg | dbs_revoke_seq_prvg | dbs_revoke_system_prvg | dbs_revoke_table_or_view_prvg | dbs_revoke_type_or_jar_prvg | dbs_revoke_var_prvg | dbs_revoke_use_prvg); //REVOKE -dbs_revoke_authorized_spec: dbs_authorization_specification FROM auth_name_loop_pub auth_name_loop_all? dependent_privileges? RESTRICT?; auth_name_loop_pub: (auth_name_or_role | PUBLIC) (dbs_comma_separator auth_name_loop_pub | PUBLIC)*; auth_name_loop_all: BY (ALL | auth_name_or_role (dbs_comma_separator auth_name_or_role)*); auth_name_or_role: dbs_authorization_name | ROLE dbs_role_name; @@ -886,8 +889,7 @@ db_procedure_name_loop: dbs_procedure_name (dbs_comma_separator dbs_procedure_na dbs_revoke_pack_prvg: (ALL | revoke_opt_loop) ON PACKAGE package_name_loop FROM auth_name_loop_pub auth_name_loop_all? dependent_privileges?; revoke_opt_loop: revoke_opt (dbs_comma_separator revoke_opt)*; revoke_opt: BIND | COPY | EXECUTE | RUN; -package_name_loop: package_name (dbs_comma_separator package_name)*; -package_name: dbs_collection_id SELECT_ALL? | FILENAME; +package_name_loop: dbs_collection_id DOT_FS (dbs_package_name | ASTERISKCHAR) (dbs_comma_separator dbs_collection_id DOT_FS (dbs_package_name | ASTERISKCHAR))*; //REVOKE PLAN PRIVILEGES dbs_revoke_plan_prvg: (BIND | EXECUTE) (dbs_comma_separator (BIND | EXECUTE))* ON PLAN plan_name_loop FROM auth_name_loop_pub auth_name_loop_all? dependent_privileges?; @@ -914,8 +916,8 @@ table_or_view_name_loop: (dbs_table_name | dbs_view_name) (dbs_comma_separator ( //REVOKE TYPE OR JAR PRIVILEGES dbs_revoke_type_or_jar_prvg: USAGE ON (TYPE type_name_loop | JAR jar_name_loop) FROM auth_name_loop_pub auth_name_loop_all? dependent_privileges? RESTRICT?; -type_name_loop: dbs_type_name (dbs_comma_separator dbs_type_name)*; -jar_name_loop: dbs_jar_name (dbs_comma_separator dbs_jar_name)*; +type_name_loop: dbs_object_name (dbs_comma_separator dbs_object_name)*; +jar_name_loop: dbs_host_identifier (dbs_comma_separator dbs_host_identifier)*; //REVOKE VARIABLE PRIVILEGES dbs_revoke_var_prvg: (ALL PRIVILEGES? | read_write_loop) ON VARIABLE FROM auth_name_loop_pub auth_name_loop_all? dependent_privileges?; @@ -942,19 +944,18 @@ dbs_select: dbs_select_unpack_function_invocation | (WITH common_table_expressio | dbs_select_readOnly | dbs_select_optimize | dbs_select_statement_isolation_clause - | QUERYNO dbs_integer + | QUERYNO INTEGERLITERAL | SKIPCHAR LOCKED DATA)*; dbs_select_update: FOR UPDATE (OF dbs_column_name (dbs_comma_separator dbs_column_name)*)? ; dbs_select_readOnly: FOR (READ | FETCH) ONLY; -dbs_select_optimize:OPTIMIZE FOR dbs_integer (ROWS | ROW); +dbs_select_optimize:OPTIMIZE FOR INTEGERLITERAL (ROWS | ROW); /*Queries Subselects (all)*/ -dbs_select_unpack_function_invocation: UNPACK LPARENCHAR dbs_expression RPARENCHAR DOT_FS ASTERISKCHAR AS LPARENCHAR dbs_field_name db2sql_data_types (dbs_comma_separator dbs_field_name db2sql_data_types)* RPARENCHAR; -dbs_select_row_fullselect: (NONNUMERICLITERAL | NUMERICLITERAL)+ ; +dbs_select_unpack_function_invocation: UNPACK LPARENCHAR dbs_expression RPARENCHAR DOT_FS ASTERISKCHAR AS LPARENCHAR dbs_sql_identifier db2sql_data_types (dbs_comma_separator dbs_sql_identifier db2sql_data_types)* RPARENCHAR; dbs_subselect: dbs_select_clause dbs_from_clause dbs_where_clause? dbs_groupby_clause? dbs_having_clause? dbs_orderby_clause? dbs_offset_clause? dbs_fetch_clause?; dbs_select_clause: SELECT (ALL | DISTINCT)? ( ASTERISKCHAR | dbs_select_item (dbs_comma_separator dbs_select_item)*); -dbs_select_item: (dbs_expressions AS? dbs_sql_identifier? | dbs_unpacked_row | dbs_generic_name SELECT_ALL); -dbs_unpacked_row: dbs_select_unpack_function_invocation SELECT_ALL AS LPARENCHAR (dbs_generic_name db2sql_data_types) +dbs_select_item: (dbs_expressions AS? dbs_sql_identifier? | dbs_unpacked_row | dbs_generic_name DOT_FS ASTERISKCHAR); +dbs_unpacked_row: dbs_select_unpack_function_invocation DOT_FS ASTERISKCHAR AS LPARENCHAR (dbs_generic_name db2sql_data_types) (dbs_comma_separator dbs_generic_name db2sql_data_types)* RPARENCHAR; dbs_from_clause: FROM dbs_table_reference (dbs_comma_separator dbs_table_reference)*; dbs_where_clause: WHERE (dbs_search_condition | LPARENCHAR dbs_search_condition RPARENCHAR); @@ -969,8 +970,8 @@ dbs_grouping_expression_list: dbs_grouping_expression_alternative (dbs_comma_sep dbs_grouping_expression: dbs_expression; dbs_having_clause: HAVING dbs_search_condition; dbs_orderby_clause: ORDER BY (INPUT SEQUENCE | ORDER OF dbs_table_designator | dbs_sort_key (ASC | DESC)? (dbs_comma_separator dbs_sort_key (ASC | DESC)?)*); -dbs_sort_key: dbs_integer | dbs_sort_key_expression; -dbs_offset_clause: OFFSET dbs_integer (ROW | ROWS); +dbs_sort_key: INTEGERLITERAL | dbs_sort_key_expression; +dbs_offset_clause: OFFSET INTEGERLITERAL (ROW | ROWS); dbs_fullselect: (dbs_select_into | LPARENCHAR dbs_fullselect RPARENCHAR | dbs_value_clause | dbs_subselect) ((UNION|EXCEPT|INTERSECT) (DISTINCT|ALL)? (dbs_subselect | LPARENCHAR dbs_fullselect RPARENCHAR))* @@ -988,12 +989,12 @@ dbs_set: SET (dbs_set_connection | dbs_set_current_accel | dbs_set_current_app_ dbs_set_connection: CONNECTION (dbs_location_name | dbs_host_variable); //SET ASSIGNMENT STATEMENT -dbs_set_assign: (target_variable EQUALCHAR CURRENT (PACKAGESET | PACKAGE PATH | SERVER) | dbs_array_variable_name - LSQUAREBRACKET dbs_array_variable_name RSQUAREBRACKET EQUALCHAR (dbs_expression | NULL) | target_variable_loop); -target_variable: (dbs_global_variable_name | dbs_host_variable | dbs_sql_parameter_name | dbs_sql_variable_name | dbs_transition_variable_name); +dbs_set_assign: (dbs_sql_variable_reference EQUALCHAR CURRENT (PACKAGESET | PACKAGE PATH | SERVER) | dbs_array_type_name + LSQUAREBRACKET dbs_array_type_name RSQUAREBRACKET EQUALCHAR (dbs_expression | NULL) | target_variable_loop); // TODO [array-index] adjust array-index , could be a query-expr arith-expr, sub-query etc +//target_variable: (dbs_global_variable_name | dbs_host_variable | dbs_sql_parameter_name | dbs_sql_variable_reference | dbs_object_name); target_variable_eq_opt: (dbs_expressions | NULL | DEFAULT); target_variable_eq_opt_loop: target_variable_eq_opt (dbs_comma_separator target_variable_eq_opt)*; -target_variable_val_loop: LPARENCHAR target_variable (dbs_comma_separator target_variable)* RPARENCHAR; +target_variable_val_loop: LPARENCHAR dbs_sql_variable_reference (dbs_comma_separator dbs_sql_variable_reference)* RPARENCHAR; target_variable_vals_loop: LPARENCHAR ( target_variable_eq_opt_loop @@ -1003,14 +1004,14 @@ target_variable_vals_loop: target_variable_eq_opt | LPARENCHAR target_variable_eq_opt_loop RPARENCHAR ) ) RPARENCHAR;//1 2 3 -target_variable_opts: (target_variable EQUALCHAR target_variable_eq_opt | target_variable_val_loop EQUALCHAR target_variable_vals_loop); +target_variable_opts: (dbs_sql_variable_reference EQUALCHAR target_variable_eq_opt | target_variable_val_loop EQUALCHAR target_variable_vals_loop); target_variable_loop: target_variable_opts (dbs_comma_separator target_variable_opts)*; //SET CURRENT ACCELERATOR dbs_set_current_accel: CURRENT ACCELERATOR EQUALCHAR (dbs_accelerator_name | dbs_host_variable); //SET CURRENT APPLICATION COMPATIBILITY -dbs_set_current_app_compatibility: CURRENT APPLICATION COMPATIBILITY EQUALCHAR? (dbs_string_constant | dbs_variable); +dbs_set_current_app_compatibility: CURRENT APPLICATION COMPATIBILITY EQUALCHAR? (dbs_string_constant | dbs_host_variable); //SET CURRENT APPLICATION ENCODING SCHEMA dbs_set_current_app_enc_schema: CURRENT APPLICATION? ENCODING SCHEME EQUALCHAR? (dbs_string_constant | dbs_host_variable); @@ -1058,10 +1059,10 @@ dbs_set_current_query_accel: CURRENT QUERY ACCELERATION EQUALCHAR? (NONE | ENABL //SET CURRENT QUERY ACCELARATION WAITFORDATA dbs_set_current_query_accel_wfdata: CURRENT QUERY ACCELERATION WAITFORDATA EQUALCHAR? (NUMERICLITERAL {validateTokenWithRegex($NUMERICLITERAL.text, "\\d{1,4}.\\d\\b", "db2SqlParser.currentQueryAcceleration");} - | dbs_variable); + | dbs_host_variable); //SET CURRENT REFRESH AGE -dbs_set_current_refresh_age: CURRENT REFRESH AGE EQUALCHAR? (dbs_numeric_constant | ANY | dbs_host_variable); +dbs_set_current_refresh_age: CURRENT REFRESH AGE EQUALCHAR? (INTEGERLITERAL | ANY | dbs_host_variable); //SET CURRENT ROUTINE VERSION dbs_set_current_routine_version: CURRENT ROUTINE VERSION EQUALCHAR? (dbs_routine_version_id | dbs_host_variable | dbs_string_constant); @@ -1079,7 +1080,7 @@ dbs_set_current_temp_business_time: CURRENT TEMPORAL BUSINESS_TIME EQUALCHAR? (N dbs_set_current_temp_system_time: CURRENT TEMPORAL SYSTEM_TIME EQUALCHAR? (NULL | dbs_expression); //SET CURRENT ENCRIPTION PASSWORD -dbs_set_current_enc_pwd: ENCRYPTION PASSWORD EQUALCHAR? (dbs_password_variable | dbs_password_string_constant) (WITH HINT EQUALCHAR? (dbs_hint_variable | dbs_hint_string_constant))?; +dbs_set_current_enc_pwd: ENCRYPTION PASSWORD EQUALCHAR? (dbs_sql_variable_reference | dbs_constant) (WITH HINT EQUALCHAR? (dbs_host_variable | dbs_sql_identifier))?; //SET PATH dbs_set_path: (CURRENT)? PATH EQUALCHAR? set_path_opts_loop; @@ -1090,16 +1091,16 @@ set_path_opts_loop: set_path_opts (dbs_comma_separator set_path_opts)*; dbs_set_schema: (CURRENT? SCHEMA | CURRENT_SCHEMA) EQUALCHAR? (dbs_schema_name | (SESSION_USER | USER) | dbs_host_variable | dbs_string_constant | DEFAULT); //SET SESSION TIME ZONE -dbs_set_session_tz : SESSION? TIME ZONE EQUALCHAR? (dbs_string_constant | dbs_variable); +dbs_set_session_tz : SESSION? TIME ZONE EQUALCHAR? (dbs_string_constant | dbs_host_variable); /*SIGNAL - this is a statement and is referenced in other rules*/ dbs_signal: dbs_label? SIGNAL ( - dbs_sql_condition_name + dbs_constraint_name | SQLSTATE VALUE? ( - dbs_sqlstate_string_constant - | dbs_sql_variable_name - | dbs_sql_parameter_name + dbs_string_constant + | dbs_sql_variable_reference + | dbs_parameter ) ) (SET MESSAGE_TEXT EQUALCHAR)? dbs_diagnostic_string_expression; @@ -1116,12 +1117,12 @@ dbs_truncate: TRUNCATE TABLE? dbs_table_name ((DROP | REUSE) STORAGE)? ((IGNORE /*UPDATE */ dbs_update: UPDATE (dbs_table_name | dbs_view_name) (dbs_update_searched | dbs_update_positioned); dbs_update_searched: dbs_update_period? dbs_correlation_name? dbs_update_include? SET dbs_update_assignment (dbs_comma_separator - dbs_update_assignment)* (WHERE dbs_search_condition)? (WITH (RR|RS|CS) | SKIPCHAR LOCKED DATA)* (QUERYNO dbs_integer)?; -dbs_update_period: FOR PORTION OF BUSINESS_TIME (FROM dbs_value TO dbs_value | BETWEEN dbs_value AND dbs_value); + dbs_update_assignment)* (WHERE dbs_search_condition)? (WITH (RR|RS|CS) | SKIPCHAR LOCKED DATA)* (QUERYNO INTEGERLITERAL)?; +dbs_update_period: FOR PORTION OF BUSINESS_TIME (FROM dbs_expressions TO dbs_expressions | BETWEEN dbs_expressions AND dbs_expressions); dbs_update_include: INCLUDE LPARENCHAR dbs_column_name (common_short_built_in_type | dbs_distinct_type) (dbs_comma_separator dbs_column_name (common_short_built_in_type | dbs_distinct_type))* RPARENCHAR; dbs_update_assignment: (dbs_column_name EQUALCHAR (dbs_expressions | DEFAULT | NULL) | LPARENCHAR dbs_column_name - (dbs_comma_separator dbs_column_name)* RPARENCHAR EQUALCHAR LPARENCHAR (dbs_select_row_fullselect | dbs_select_unpack_function_invocation | + (dbs_comma_separator dbs_column_name)* RPARENCHAR EQUALCHAR LPARENCHAR (dbs_fullselect | dbs_select_unpack_function_invocation | (dbs_expressions | DEFAULT | NULL) (dbs_comma_separator (dbs_expressions | DEFAULT | NULL))*) RPARENCHAR); dbs_update_positioned: dbs_correlation_name? SET dbs_update_assignment (dbs_comma_separator dbs_update_assignment)* WHERE CURRENT OF dbs_cursor_name (FOR ROW (dbs_host_variable | dbs_integer_constant) OF ROWSET)?; @@ -1130,11 +1131,10 @@ dbs_update_positioned: dbs_correlation_name? SET dbs_update_assignment (dbs_comm dbs_values: VALUES (dbs_values_null | dbs_values_into); dbs_values_null: (dbs_expression | LPARENCHAR dbs_expression (dbs_comma_separator dbs_expression)* RPARENCHAR); dbs_values_into: (dbs_expression | NULL | LPARENCHAR (dbs_expression | NULL) (dbs_comma_separator (dbs_expression | NULL))* RPARENCHAR) INTO - (dbs_values_target (dbs_comma_separator dbs_values_target)* | dbs_array_variable); -dbs_values_target: (dbs_global_variable_name | dbs_host_variable | dbs_sql_parameter_name | dbs_sql_variable_name | dbs_transition_variable_name); + (dbs_sql_variable_reference (dbs_comma_separator dbs_sql_variable_reference)* | dbs_array_variable); /*WHENEVER */ -dbs_whenever: WHENEVER (NOT FOUND | SQLERROR | SQLWARNING) (CONTINUE | (GOTO | GO TO) COLONCHAR? dbs_host_name_container); +dbs_whenever: WHENEVER (NOT FOUND | SQLERROR | SQLWARNING) (CONTINUE | (GOTO | GO TO) COLONCHAR? dbs_host_label); /*data types*/ data_type: (common_built_in_type | data_type_arr_or_distinct); @@ -1145,7 +1145,7 @@ common_built_in_type_core: (common_bit_int | common_bit_decimal | common_bit_flo common_bit_binary | common_bit_date_time); common_built_in_type: common_built_in_type_core; common_built_in_type_source: common_built_in_type_core | ROWID; -common_built_in_type2: common_bit_integer | (VARCHAR | (CHARACTER | CHAR) VARYING) LPARENCHAR dbs_integer RPARENCHAR (CCSID oneof_encoding)? common_bit_fordata?; +common_built_in_type2: common_bit_integer | (VARCHAR | (CHARACTER | CHAR) VARYING) LPARENCHAR INTEGERLITERAL RPARENCHAR (CCSID oneof_encoding)? common_bit_fordata?; common_built_in_type_core3: common_built_in_type_core | common_bit_date_time | ROWID | XML (LPARENCHAR xml_type_modifier RPARENCHAR)?; common_built_in_type4: (common_bit_int | common_bit_decimal | common_bit_float | common_bit_decfloat | common_bit_char2 | common_bit_graphic2 | common_bit_binary_core | common_bit_date_time); @@ -1153,47 +1153,45 @@ common_built_in_type4: (common_bit_int | common_bit_decimal | common_bit_float | common_bit_integer: INTEGER | INT; common_bit_int: (SMALLINT | INT | INTEGER | BIGINT); common_bit_decimal_opt: (DECIMAL | DEC | NUMERIC); -common_bit_decimal: common_bit_decimal_opt (LPARENCHAR (dbs_integer (dbs_comma_separator dbs_integer)? | NUMERICLITERAL) RPARENCHAR)?; -common_bit_float: (FLOAT (LPARENCHAR dbs_integer RPARENCHAR)? | REAL | DOUBLE PRECISION?); -common_bit_decfloat: DECFLOAT (LPARENCHAR (dbs_integer34 - | T=dbs_integer {validate34or16($T.text);} - | dbs_integer16) RPARENCHAR)?; -common_bit_char: (CHARACTER | CHAR) (VARYING common_bit_varandchar | LARGE OBJECT common_bit_clobandobj | LPARENCHAR dbs_integer RPARENCHAR common_bit_charopts); -common_bit_char2: ((CHARACTER | CHAR) (LPARENCHAR dbs_integer RPARENCHAR)? | (VARCHAR | (CHARACTER | CHAR) VARYING) (LPARENCHAR dbs_integer RPARENCHAR)) (common_bit_fordata | CCSID dbs_integer1208)?; +common_bit_decimal: common_bit_decimal_opt (LPARENCHAR (INTEGERLITERAL (dbs_comma_separator INTEGERLITERAL)? | NUMERICLITERAL) RPARENCHAR)?; +common_bit_float: (FLOAT (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | REAL | DOUBLE PRECISION?); +common_bit_decfloat: DECFLOAT (LPARENCHAR dbs_decfloat_integer RPARENCHAR)?; +common_bit_char: (CHARACTER | CHAR) (VARYING common_bit_varandchar | LARGE OBJECT common_bit_clobandobj | LPARENCHAR INTEGERLITERAL RPARENCHAR common_bit_charopts); +common_bit_char2: ((CHARACTER | CHAR) (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | (VARCHAR | (CHARACTER | CHAR) VARYING) (LPARENCHAR INTEGERLITERAL RPARENCHAR)) (common_bit_fordata | CCSID dbs_integer1208)?; common_bit_fordata: (FOR (SBCS | MIXED | BIT) DATA); common_bit_charopts: (CCSID oneof_encoding)? common_bit_fordata?; common_bit_varchar: VARCHAR common_bit_varandchar; -common_bit_varandchar: LPARENCHAR dbs_integer RPARENCHAR common_bit_charopts; +common_bit_varandchar: LPARENCHAR INTEGERLITERAL RPARENCHAR common_bit_charopts; common_bit_clob: CLOB common_bit_clobandobj; -common_bit_clobandobj: (LPARENCHAR (IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");})? RPARENCHAR)? +common_bit_clobandobj: (LPARENCHAR (T=dbs_sql_identifier {validateTokenWithRegex($T.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");})? RPARENCHAR)? (CCSID oneof_encoding)? (FOR (SBCS | MIXED ) DATA)?; -common_bit_graphic_core: GRAPHIC (LPARENCHAR dbs_integer RPARENCHAR)? | VARGRAPHIC LPARENCHAR dbs_integer RPARENCHAR; -common_bit_graphic: (common_bit_graphic_core | DBCLOB (LPARENCHAR lobSize RPARENCHAR)?) (CCSID oneof_encoding)?; -common_bit_graphic2: common_bit_graphic_core CCSID dbs_integer256; -common_bit_binary_core: BINARY (LPARENCHAR dbs_integer RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR dbs_integer RPARENCHAR; -common_bit_binary: (common_bit_binary_core | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR (IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");})? RPARENCHAR)?); -common_bit_timestamp: TIMESTAMP (LPARENCHAR dbs_integer RPARENCHAR)? (without_or_with TIME ZONE)?; +common_bit_graphic_core: GRAPHIC (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | VARGRAPHIC LPARENCHAR INTEGERLITERAL RPARENCHAR; +common_bit_graphic: (common_bit_graphic_core | DBCLOB (LPARENCHAR kmg_blob_parameter RPARENCHAR)?) (CCSID oneof_encoding)?; +common_bit_graphic2: common_bit_graphic_core CCSID dbs_integer1200; +common_bit_binary_core: BINARY (LPARENCHAR INTEGERLITERAL RPARENCHAR)? | (BINARY VARYING | VARBINARY) LPARENCHAR INTEGERLITERAL RPARENCHAR; +common_bit_binary: (common_bit_binary_core | (BINARY LARGE OBJECT | BLOB) (LPARENCHAR (T=dbs_sql_identifier {validateTokenWithRegex($T.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");})? RPARENCHAR)?); +common_bit_timestamp: TIMESTAMP (LPARENCHAR INTEGERLITERAL RPARENCHAR)? (without_or_with TIME ZONE)?; common_bit_date_time: (DATE | TIME | common_bit_timestamp); /*built in type with no LOBs used in DELETE, INSERT, MERGE, UPDATE */ common_short_built_in_type: (common_bit_int | common_bit_decimal | common_bit_float | common_bit_decfloat | common_short_bit_char | common_short_bit_varchar | common_short_bit_graphic | common_short_bit_binary | DATE | TIME | common_bit_timestamp ); -common_short_bit_char: (CHARACTER | CHAR) (VARYING common_short_bit_varchara | LPARENCHAR dbs_integer RPARENCHAR) (FOR BIT DATA)?; +common_short_bit_char: (CHARACTER | CHAR) (VARYING common_short_bit_varchara | LPARENCHAR INTEGERLITERAL RPARENCHAR) (FOR BIT DATA)?; common_short_bit_varchar: VARCHAR common_short_bit_varchara; -common_short_bit_varchara: LPARENCHAR dbs_integer RPARENCHAR (FOR BIT DATA)?; -common_short_bit_graphic: (GRAPHIC | VARGRAPHIC) (LPARENCHAR dbs_integer RPARENCHAR)?; -common_short_bit_binary: (BINARY VARYING? | VARBINARY) (LPARENCHAR dbs_integer RPARENCHAR)?; +common_short_bit_varchara: LPARENCHAR INTEGERLITERAL RPARENCHAR (FOR BIT DATA)?; +common_short_bit_graphic: (GRAPHIC | VARGRAPHIC) (LPARENCHAR INTEGERLITERAL RPARENCHAR)?; +common_short_bit_binary: (BINARY VARYING? | VARBINARY) (LPARENCHAR INTEGERLITERAL RPARENCHAR)?; -sql_data_type: SQL (VARCHAR (LPARENCHAR dbs_integer RPARENCHAR) | DECFLOAT (LPARENCHAR (dbs_integer34) RPARENCHAR)? | DATE | TIMESTAMP (LPARENCHAR (dbs_integer12) RPARENCHAR)? ); +sql_data_type: dbs_exact_match_identifier_sql (VARCHAR (LPARENCHAR INTEGERLITERAL RPARENCHAR) | DECFLOAT (LPARENCHAR dbs_decfloat_integer RPARENCHAR)? | DATE | TIMESTAMP (LPARENCHAR dbs_integer12 RPARENCHAR)? ); /*option lists*/ -dbs_option_list: ((LANGUAGE SQL) | option_specific | option_deterministic | option_action | option_sqldata2 | (option_returned_null | option_called)| option_dispatch| option_allow_parallel| option_debug_mode| - option_parameter_enc | option_qualifier| option_package_owner | option_asutime | option_registers| (wlm_env dbs_name)| option_current_data| option_degree| option_concurrency| +dbs_option_list: ((LANGUAGE dbs_exact_match_identifier_sql) | option_specific | option_deterministic | option_action | option_sqldata2 | (option_returned_null | option_called)| option_dispatch| option_allow_parallel| option_debug_mode| + option_parameter_enc | option_qualifier| option_package_owner | option_asutime | option_registers| (wlm_env dbs_sql_identifier)| option_current_data| option_degree| option_concurrency| option_dynamic_rules | option_app_enc| option_explain| option_query_accl | option_get_accel | option_acceleration| option_accelerator| option_sql_path| option_reopt| option_validate | option_rounding | option_format_date | option_decimal | option_for_update | option_format_time| option_secured| option_sensitive_business| option_sensitive_system | option_sensitive_archive | option_app_compat | option_concentrate_statements)+; -dbs_option_list_ext: (option_specific| option_parameter | EXTERNAL option_name? | option_language | parameter_style (JAVA | SQL) | option_deterministic | FENCED | (option_returned_null | option_called) | +dbs_option_list_ext: (option_specific| option_parameter | EXTERNAL option_name? | option_language | parameter_style dbs_function_parameter_style | option_deterministic | FENCED | (option_returned_null | option_called) | option_sqldata3 | option_action | option_package_path | option_scratch| option_final_call| option_allow_parallel| option_dbinfo | option_collid | option_wlm_env_short | option_asutime | option_stay_resident | option_program_type | option_security | option_after | option_run | option_registers | option_dispatch | option_secured)+; @@ -1201,10 +1199,10 @@ dbs_option_list_proc_ext: (option_specific | option_dynamic | option_parameter| option_package_path | FENCED| option_dbinfo| option_collid | option_wlm_env | option_asutime | option_stay_resident| option_program_type| option_security| option_after | option_run | option_commit | option_registers | option_called | option_debug_mode)+; -dbs_option_list_ext_table: (option_specific | option_parameter | EXTERNAL option_name | option_language | parameter_style SQL | option_deterministic| FENCED| (option_returned_null | option_called)| +dbs_option_list_ext_table: (option_specific | option_parameter | EXTERNAL option_name | option_language | parameter_style dbs_exact_match_identifier_sql | option_deterministic| FENCED| (option_returned_null | option_called)| option_sqldata| option_action | option_package_path| option_scratch | option_final_call | DISALLOW PARALLEL | option_dbinfo| option_cardinality| option_collid| option_wlm_env_short | option_asutime | option_stay_resident | option_program_type | option_security| option_run | option_registers | option_dispatch | option_after | option_secured)+; -dbs_option_list_proc_native: (LANGUAGE SQL | option_specific | option_deterministic | option_sqldata2 | option_called | option_dynamic | +dbs_option_list_proc_native: (LANGUAGE dbs_exact_match_identifier_sql | option_specific | option_deterministic | option_sqldata2 | option_called | option_dynamic | option_debug_mode | option_parameter_enc option_qualifier | option_package_owner | option_asutime | option_commit_aut | option_registers | option_wlm_env_debug | option_defer | option_current_data | option_degree | option_concurrency | option_dynamic_rules | option_app_enc | option_explain | option_write_imd | option_isolation_level | @@ -1217,17 +1215,17 @@ dbs_option_list_trigger: (option_debug_mode | option_qualifier | option_asutime option_rounding | option_format_date | option_decimal | option_format_time | option_for_update | option_secured | option_sensitive_business | option_sensitive_system | option_sensitive_archive | option_app_compat | option_concentrate_statements)+; -dbs_option_list_inl_def: (option_specific | option_parameter | option_deterministic| option_action| option_sqldata_common| option_dispatch| option_called| option_secured | LANGUAGE SQL)+; +dbs_option_list_inl_def: (option_specific | option_parameter | option_deterministic| option_action| option_sqldata_common| option_dispatch| option_called| option_secured | LANGUAGE dbs_exact_match_identifier_sql)+; option_acceleration: ACCELERATION WAITFORDATA NUMERICLITERAL {validateTokenWithRegex($NUMERICLITERAL.text, "\\d{1,4}.\\d\\b", "db2SqlParser.currentQueryAcceleration");}; option_accelerator: ACCELERATOR dbs_accelerator_name; option_action: NO? EXTERNAL ACTION; -option_after: (STOP AFTER (SYSTEM DEFAULT FAILURES | dbs_integer FAILURES) | CONTINUE AFTER FAILURE); +option_after: (STOP AFTER (SYSTEM DEFAULT FAILURES | INTEGERLITERAL FAILURES) | CONTINUE AFTER FAILURE); option_allow_parallel: (ALLOW | DISALLOW) PARALLEL; -option_asutime: ASUTIME (NO LIMIT | LIMIT dbs_integer); +option_asutime: ASUTIME (NO LIMIT | LIMIT INTEGERLITERAL); option_app_enc: APPLICATION ENCODING SCHEME oneof_encoding; option_app_compat: APPLCOMPAT dbs_applcompat_value; option_called: CALLED ON NULL INPUT; -option_cardinality: CARDINALITY dbs_integer; +option_cardinality: CARDINALITY INTEGERLITERAL; option_collid: (NO COLLID | COLLID dbs_collection_id); option_commit: COMMIT ON RETURN no_or_yes; option_commit_aut: (option_commit | AUTONOMOUS); @@ -1239,12 +1237,12 @@ option_format_time: TIME option_format_opts; option_format_opts: FORMAT (ISO | EUR | USA | JIS | LOCAL); option_dbinfo: NO? DBINFO; option_debug_mode: (DISALLOW | ALLOW | DISABLE) DEBUG MODE; -option_decimal: DECIMAL LPARENCHAR (dbs_integer15 (dbs_comma_separator dbs_s)? | dbs_integer31 (dbs_comma_separator dbs_s)?); +option_decimal: DECIMAL LPARENCHAR dbs_decimal_15_31 (dbs_comma_separator dbs_char_s)? RPARENCHAR; option_defer: (DEFER | NODEFER) PREPARE; -option_degree: DEGREE (T=dbs_integer {validateLevel($T.text);} | ANY); +option_degree: DEGREE (T=INTEGERLITERAL {validateLevel($T.text);} | ANY); option_deterministic: NOT? DETERMINISTIC; option_dispatch: STATIC DISPATCH; -option_dynamic: DYNAMIC RESULT SETS (ZERO_DIGIT | dbs_integer); +option_dynamic: DYNAMIC RESULT SETS INTEGERLITERAL; option_dynamic_keep: without_or_with KEEP DYNAMIC; option_dynamic_rules: DYNAMICRULES (RUN | BIND | DEFINEBIND | DEFINERUN | INVOKEBIND | INVOKERUN); option_explain: without_or_with EXPLAIN; @@ -1253,13 +1251,13 @@ option_for_update: OR UPDATE CLAUSE (REQUIRED | OPTIONAL); option_get_accel: GET_ACCEL_ARCHIVE no_or_yes; option_isolation_level: ISOLATION LEVEL cs_rs_rr_ur; option_language: LANGUAGE oneof_lang; -option_name: NAME ( dbs_ext_program_name | dbs_sql_identifier); +option_name: NAME ( dbs_string_constant | dbs_sql_identifier); option_opthint: OPTHINT ( DOUBLEQUOTE | dbs_string_constant); option_package_owner: PACKAGE OWNER dbs_authorization_name; option_package_path: (NO PACKAGE PATH | PACKAGE PATH dbs_package_path); option_parameter_enc: PARAMETER CCSID oneof_encoding; option_parameter: PARAMETER (CCSID oneof_encoding | VARCHAR (NULTERM | STRUCTURE))*; -option_parameter_style: parameter_style ( SQL | GENERAL | GENERAL WITH NULLS | JAVA); +option_parameter_style: parameter_style ( dbs_function_parameter_style | GENERAL | GENERAL WITH NULLS); option_qualifier: QUALIFIER dbs_schema_name; option_query_accl: QUERY ACCELERATION ( NONE | ENABLE (WITH FAILBACK)? | ELIGIBLE | ALL); option_program_type: program_type (SUB | MAIN); @@ -1268,34 +1266,30 @@ option_registers: (INHERIT | DEFAULT ) SPECIAL REGISTERS; option_returned_null: RETURNS NULL ON NULL INPUT; option_reopt: REOPT (NONE | ALWAYS | ONCE); option_rounding: ROUNDING (DEC_ROUND_CEILING | DEC_ROUND_DOWN | DEC_ROUND_FLOOR | DEC_ROUND_HALF_DOWN | DEC_ROUND_HALF_EVEN | DEC_ROUND_HALF_UP | DEC_ROUND_UP); -option_run: RUN OPTIONS dbs_run_time_options; -option_scratch: (NO SCRATCHPAD | SCRATCHPAD (dbs_integer100 | dbs_length)?); +option_run: RUN OPTIONS dbs_string_constant; +option_scratch: (NO SCRATCHPAD | SCRATCHPAD INTEGERLITERAL?); option_security: SECURITY (DB2 | (USER | DEFINER)); option_secured: NOT? SECURED; option_sensitive_archive: ARCHIVE SENSITIVE SENSITIVE no_or_yes; option_sensitive_business: BUSINESS_TIME SENSITIVE no_or_yes; option_sensitive_system: SYSTEM_TIME SENSITIVE SENSITIVE no_or_yes; option_specific: SPECIFIC dbs_specific_name; -option_sqldata_common: (READS SQL DATA | CONTAINS SQL); -option_sqldata: (option_sqldata_common | NO SQL); -option_sqldata2: (MODIFIES SQL DATA | option_sqldata_common); -option_sqldata3: (option_sqldata2 | NO (SQL | EXTERNAL ACTION)); -option_sql: (MODIFIES SQL DATA | READS SQL DATA | CONTAINS SQL | NO SQL); +option_sqldata_common: (READS dbs_exact_match_identifier_sql DATA | CONTAINS dbs_exact_match_identifier_sql); +option_sqldata: (option_sqldata_common | NO dbs_exact_match_identifier_sql); +option_sqldata2: (MODIFIES dbs_exact_match_identifier_sql DATA | option_sqldata_common); +option_sqldata3: (option_sqldata2 | NO (dbs_exact_match_identifier_sql | EXTERNAL ACTION)); +option_sql: (MODIFIES dbs_exact_match_identifier_sql DATA | READS dbs_exact_match_identifier_sql DATA | CONTAINS dbs_exact_match_identifier_sql | NO dbs_exact_match_identifier_sql); option_sql_body: (dbs_schema_name | SYSTEM PATH | SESSION? USER); -option_sql_path: SQL PATH option_sql_body (dbs_comma_separator option_sql_body)*; +option_sql_path: dbs_exact_match_identifier_sql PATH option_sql_body (dbs_comma_separator option_sql_body)*; option_stay_resident: STAY RESIDENT no_or_yes; option_timezone: without_or_with TIME ZONE; option_validate: VALIDATE (RUN | BIND); option_write_imd: without_or_with IMMEDIATE WRITE; -option_wlm_env: wlm_env (dbs_name | LPARENCHAR dbs_name dbs_comma_separator ASTERISKCHAR RPARENCHAR); -option_wlm_env_short: wlm_env (dbs_name | LPARENCHAR dbs_name RPARENCHAR); -option_wlm_env_debug: wlm_env FOR DEBUG MODE dbs_name; - -k_m_g: (K_CHAR | M_CHAR | G_CHAR); -lobSize: (dbs_integer k_m_g?| T=IDENTIFIER {validateTokenWithRegex($T.text, "\\d+[kKmMgG]", "unexpected token");} ); +option_wlm_env: wlm_env (dbs_sql_identifier | LPARENCHAR dbs_sql_identifier dbs_comma_separator ASTERISKCHAR RPARENCHAR); +option_wlm_env_short: wlm_env (dbs_sql_identifier | LPARENCHAR dbs_sql_identifier RPARENCHAR); +option_wlm_env_debug: wlm_env FOR DEBUG MODE dbs_sql_identifier; no_or_yes: (NO | YES); oneof_encoding: (ASCII | EBCDIC | UNICODE); -oneof_lang: (ASSEMBLE | LANGUAGE_C | COBOL | JAVA | PLI | REXX | SQL); parameter_style: PARAMETER STYLE; program_type: PROGRAM TYPE; wlm_env: WLM ENVIRONMENT; @@ -1304,42 +1298,60 @@ yes_or_no: (YES | NO); cs_rs_rr_ur: (CS | RS | RR | UR); /// STATEMENTS /// -dbs_control_statement: dbs_assignment_statement | dbs_call_control | dbs_case_statement_pl_sql | dbs_compund_statement | dbs_for_statement | dbs_get | - dbs_goto_statement | dbs_if_statement | dbs_iterate_statement | dbs_leave_statement | dbs_loop_statement | dbs_repeat_statement | - dbs_resignal_statement |dbs_return_statement | dbs_signal_statement | dbs_while_statement | dbs_fullselect | dbs_select_into | dbs_signal; - -dbs_assignment_statement : SET (dbs_sql_parameter_name | dbs_sql_variable_name) EQUALCHAR (CURRENT SERVER | CURRENT PACKAGESET | CURRENT PACKAGE PATH | dbs_expression | NULL); -dbs_procedure_argument_list : dbs_sql_variable_name| dbs_sql_parameter_name | dbs_expression| NULL; -dbs_call_control : (dbs_key_label_name COLONCHAR)? CALL dbs_procedure_name (LPARENCHAR dbs_procedure_argument_list (dbs_comma_separator dbs_procedure_argument_list)* RPARENCHAR)?; -dbs_case_statement_pl_sql: (dbs_key_label_name COLONCHAR)? CASE (dbs_simple_when_clause_pl_sql | dbs_searched_when_clause_pl_sql) ELSE (dbs_sql_procedure_statement dbs_semicolon_end)+ END CASE; +// ref: https://www.ibm.com/docs/en/db2-for-zos/13?topic=sql-control-statements-external-procedures +// deprecated, should we remove it ???? +dbs_control_statement: dbs_assignment_statement + | dbs_call_control + | dbs_case_statement_pl_sql + | dbs_compund_statement +// | dbs_for_statement //<-- cant find in docs + | dbs_get_diagnostics_statement + | dbs_goto_statement + | dbs_if_statement + | dbs_iterate_statement + | dbs_leave_statement + | dbs_loop_statement + | dbs_repeat_statement + | dbs_resignal_statement + | dbs_return_statement + | dbs_signal_statement + | dbs_while_statement + | dbs_fullselect // <-- cant find in docs + | dbs_select_into // <-- cant find in docs + | dbs_signal; // <-- cant find in docs + +dbs_assignment_statement : SET (dbs_parameter | dbs_sql_variable_reference) EQUALCHAR (CURRENT SERVER | CURRENT PACKAGESET | CURRENT PACKAGE PATH | dbs_expression | NULL); +dbs_procedure_argument_list : dbs_sql_variable_reference| dbs_parameter | dbs_expression| NULL; +dbs_call_control : (dbs_sql_identifier COLONCHAR)? CALL dbs_procedure_name (LPARENCHAR dbs_procedure_argument_list (dbs_comma_separator dbs_procedure_argument_list)* RPARENCHAR)?; +dbs_case_statement_pl_sql: (dbs_sql_identifier COLONCHAR)? CASE (dbs_simple_when_clause_pl_sql | dbs_searched_when_clause_pl_sql) ELSE (dbs_sql_procedure_statement dbs_semicolon_end)+ END CASE; dbs_simple_when_clause_pl_sql: dbs_expressions (WHEN dbs_expressions THEN (dbs_sql_procedure_statement dbs_semicolon_end)+)+; dbs_searched_when_clause_pl_sql: (WHEN dbs_search_condition THEN (dbs_sql_procedure_statement dbs_semicolon_end)+)+; -dbs_compund_statement: (dbs_key_label_name COLONCHAR)? BEGIN (NOT ATOMIC | ATOMIC)? ((dbs_sql_variable_declaration|dbs_sql_condition_declaration +dbs_compund_statement: (dbs_sql_identifier COLONCHAR)? BEGIN (NOT ATOMIC | ATOMIC)? ((dbs_sql_variable_declaration|dbs_sql_condition_declaration | dbs_return_code_declaration) dbs_semicolon_end)* (dbs_declare_statement dbs_semicolon_end)* (DECLARE dbs_declare_cursor dbs_semicolon_end)* (dbs_handler_declaration dbs_semicolon_end)* - (dbs_sql_procedure_statement dbs_semicolon_end)* END dbs_key_label_name?; // check the labelname matches. -dbs_sql_variable_declaration: DECLARE dbs_sql_variable_name (dbs_comma_separator dbs_sql_variable_name)* (RESULT_SET_LOCATOR VARYING | dbs_insert_data_type (DEFAULT NULL | CONSTANT NULL | (DEFAULT | CONSTANT) dbs_constant)?) ; -dbs_sql_condition_declaration: DECLARE dbs_sql_condition_name CONDITION FOR (SQLSTATE VALUE?)? dbs_string_constant; + (dbs_sql_procedure_statement dbs_semicolon_end)* END dbs_sql_identifier?; // check the labelname matches. +dbs_sql_variable_declaration: DECLARE dbs_sql_variable_reference (dbs_comma_separator dbs_sql_variable_reference)* (RESULT_SET_LOCATOR VARYING | dbs_insert_data_type (DEFAULT NULL | CONSTANT NULL | (DEFAULT | CONSTANT) dbs_constant)?) ; +dbs_sql_condition_declaration: DECLARE dbs_constraint_name CONDITION FOR (SQLSTATE VALUE?)? dbs_string_constant; dbs_return_code_declaration: DECLARE (SQLSTATE (CHAR LPARENCHAR dbs_integer5 RPARENCHAR | CHARACTER LPARENCHAR dbs_integer5 RPARENCHAR) (DEFAULT dbs_string_constant)? | SQLCODE (INTEGER | INT) (DEFAULT dbs_integer_constant)?); dbs_handler_declaration: DECLARE (CONTINUE | EXIT) HANDLER FOR (dbs_specific_condition_value | dbs_general_condition_value) dbs_sql_procedure_statement; -dbs_specific_condition_value: (SQLSTATE VALUE? dbs_string_constant | dbs_sql_condition_name) (dbs_comma_separator (SQLSTATE VALUE? dbs_string_constant | dbs_sql_condition_name))*; +dbs_specific_condition_value: (SQLSTATE VALUE? dbs_string_constant | dbs_constraint_name) (dbs_comma_separator (SQLSTATE VALUE? dbs_string_constant | dbs_constraint_name))*; dbs_general_condition_value: (SQLEXCEPTION | SQLWARNING | NOT FOUND) (dbs_comma_separator (SQLEXCEPTION | SQLWARNING | NOT FOUND))*; -dbs_for_statement: (dbs_key_label_name COLONCHAR)? FOR (dbs_for_loop_name AS)? (dbs_cursor_name CURSOR (WITHOUT HOLD | WITH HOLD) FOR)? - dbs_select_clause DO (dbs_sql_procedure_statement dbs_semicolon_end)+ END FOR dbs_key_label_name; // check label name matches -dbs_for_loop_name: dbs_generic_name; -dbs_goto_statement: (dbs_key_label_name COLONCHAR)? GOTO dbs_key_label_name; +//dbs_for_statement: (IDENTIFIER COLONCHAR)? FOR (dbs_for_loop_name AS)? (dbs_cursor_name CURSOR (WITHOUT HOLD | WITH HOLD) FOR)? +// dbs_select_clause DO (dbs_sql_procedure_statement dbs_semicolon_end)+ END FOR IDENTIFIER; // check label name matches +//dbs_for_loop_name: dbs_generic_name; +dbs_goto_statement: (dbs_sql_identifier COLONCHAR)? GOTO dbs_sql_identifier; dbs_if_else_conditional_statement: dbs_search_condition THEN (dbs_sql_procedure_statement dbs_semicolon_end)+; -dbs_if_statement: (dbs_key_label_name COLONCHAR)? IF dbs_if_else_conditional_statement (ELSEIF dbs_if_else_conditional_statement )* (ELSE (dbs_sql_procedure_statement dbs_semicolon_end)+)? END IF; -dbs_iterate_statement: (dbs_key_label_name COLONCHAR)? ITERATE dbs_key_label_name; -dbs_leave_statement: (dbs_key_label_name COLONCHAR)? LEAVE dbs_key_label_name; -dbs_loop_statement: (dbs_key_label_name COLONCHAR)? LOOP (dbs_sql_procedure_statement dbs_semicolon_end)+ END LOOP dbs_key_label_name?; // label name should match -dbs_repeat_statement: (dbs_key_label_name COLONCHAR)? REPEAT (dbs_sql_procedure_statement dbs_semicolon_end)+ UNTIL dbs_search_condition END REPEAT dbs_key_label_name?; // check that label name matches. -dbs_signal_arg1: (SQLSTATE VALUE? (dbs_sqlstate_string_constant | dbs_sql_variable_name | dbs_sql_parameter_name)| dbs_sql_condition_name); -dbs_resignal_statement: (dbs_key_label_name COLONCHAR)? RESIGNAL (dbs_signal_arg1 dbs_signal_information? )?; +dbs_if_statement: (dbs_sql_identifier COLONCHAR)? IF dbs_if_else_conditional_statement (ELSEIF dbs_if_else_conditional_statement )* (ELSE (dbs_sql_procedure_statement dbs_semicolon_end)+)? END IF; +dbs_iterate_statement: (dbs_sql_identifier COLONCHAR)? ITERATE dbs_sql_identifier; +dbs_leave_statement: (dbs_sql_identifier COLONCHAR)? LEAVE dbs_sql_identifier; +dbs_loop_statement: (dbs_sql_identifier COLONCHAR)? LOOP (dbs_sql_procedure_statement dbs_semicolon_end)+ END LOOP dbs_sql_identifier?; // label name should match +dbs_repeat_statement: (dbs_sql_identifier COLONCHAR)? REPEAT (dbs_sql_procedure_statement dbs_semicolon_end)+ UNTIL dbs_search_condition END REPEAT dbs_sql_identifier?; // check that label name matches. +dbs_signal_arg1: (SQLSTATE VALUE? (dbs_string_constant | dbs_sql_variable_reference | dbs_parameter)| dbs_constraint_name); +dbs_resignal_statement: (dbs_sql_identifier COLONCHAR)? RESIGNAL (dbs_signal_arg1 dbs_signal_information? )?; dbs_signal_information:SET MESSAGE_TEXT EQUALCHAR dbs_diagnostic_string_expression | LPARENCHAR dbs_diagnostic_string_expression RPARENCHAR; -dbs_return_statement: (dbs_key_label_name COLONCHAR)? RETURN (dbs_expressions | NULL | dbs_fullselect); -dbs_signal_statement: (dbs_key_label_name COLONCHAR)? SIGNAL dbs_signal_arg1 dbs_signal_information; -dbs_while_statement: (dbs_key_label_name COLONCHAR)? WHILE dbs_search_condition DO (dbs_sql_procedure_statement dbs_semicolon_end)+ END WHILE dbs_key_label_name?; +dbs_return_statement: (dbs_sql_identifier COLONCHAR)? RETURN (dbs_expressions | NULL | dbs_fullselect); +dbs_signal_statement: (dbs_sql_identifier COLONCHAR)? SIGNAL dbs_signal_arg1 dbs_signal_information; +dbs_while_statement: (dbs_sql_identifier COLONCHAR)? WHILE dbs_search_condition DO (dbs_sql_procedure_statement dbs_semicolon_end)+ END WHILE dbs_sql_identifier?; /// End STATEMENTS /// ///SQL-routine-body: DB2 SQL PROCEDURE STATEMENT @@ -1350,19 +1362,18 @@ dbs_sql_procedure_statement: (dbs_sql_control_statement | dbs_allocate | ALTER ( dbs_create_function | dbs_create_global_temp_table | dbs_create_index | dbs_create_procedure_ext | dbs_create_role | dbs_create_sequence | dbs_create_stogroup | dbs_create_alias | dbs_create_table | dbs_create_tablespace | dbs_create_trusted_context | dbs_create_type_array | dbs_create_type_distinct | dbs_create_variable | dbs_create_view) | DECLARE (dbs_declare_cursor | dbs_declare_global) | dbs_delete | dbs_drop | - dbs_exchange | dbs_execute | dbs_fetch | dbs_get | dbs_grant | dbs_insert | dbs_label | + dbs_exchange | dbs_execute | dbs_fetch | dbs_get_diagnostics_statement | dbs_grant | dbs_insert | dbs_label | dbs_lock | dbs_merge | dbs_open | dbs_prepare | dbs_refresh | dbs_release | dbs_rename | dbs_revoke | dbs_rollback | dbs_savepoint | dbs_select_into | dbs_set | dbs_truncate | dbs_update | VALUES dbs_values_into); dbs_select_into: (WITH common_table_expression_loop)? dbs_select_clause INTO (target_variable_names_loop | dbs_array_variable) dbs_from_clause dbs_where_clause? dbs_groupby_clause? dbs_having_clause? dbs_orderby_clause? dbs_offset_clause? dbs_fetch_clause? (dbs_select_statement_isolation_clause | dbs_select_statement_skip_locked_data)* dbs_select_statement_queryno_clause?; common_table_expression_loop: dbs_select_statement_common_table_expression (dbs_comma_separator dbs_select_statement_common_table_expression)*; -target_variable_names_loop: target_variable_names_opts (dbs_comma_separator target_variable_names_opts)*; -target_variable_names_opts: dbs_global_variable_name | dbs_host_variable | dbs_sql_parameter_name | dbs_sql_variable_name | dbs_transition_variable_name; +target_variable_names_loop: dbs_sql_variable_reference (dbs_comma_separator dbs_sql_variable_reference)*; dbs_select_statement_common_table_expression: dbs_sql_identifier (LPARENCHAR dbs_sql_identifier (dbs_comma_separator dbs_sql_identifier)* RPARENCHAR)? AS dbs_fullselect; dbs_select_statement_isolation_clause: WITH (RR dbs_select_statement_isolation_clause_lock_clause | RS dbs_select_statement_isolation_clause_lock_clause | CS | UR ); dbs_select_statement_isolation_clause_lock_clause: USE AND KEEP (EXCLUSIVE | UPDATE | SHARE) LOCKS; -dbs_select_statement_queryno_clause: QUERYNO dbs_integer; +dbs_select_statement_queryno_clause: QUERYNO INTEGERLITERAL; dbs_select_statement_skip_locked_data: SKIPCHAR LOCKED DATA; /// END SQL PROCEDURE STATEMENT /// @@ -1385,7 +1396,7 @@ dbs_expression: (PLUSCHAR | MINUSCHAR)? (dbs_function_invocation | dbs_OLAP_specification | dbs_row_change_expression | dbs_sequence_reference | - dbs_variable); + dbs_host_variable); dbs_expression_operator: (CONCAT | PIPECHAR | PIPECHAR2 | SLASHCHAR | ASTERISKCHAR | PLUSCHAR | MINUSCHAR); @@ -1394,7 +1405,7 @@ dbs_expressions: (dbs_expression| LPARENCHAR dbs_expressions RPARENCHAR) (dbs_ex dbs_predicate_condition: (EQUALCHAR | ERRORCHAR EQUALCHAR | LESSTHANCHAR | MORETHANCHAR | MORETHANOREQUAL | LESSTHANOREQUAL | NOTEQUALCHAR); dbs_basic_predicate: dbs_expressions dbs_predicate_condition dbs_expressions | dbs_expressions IS NULL; dbs_quantified_predicate: dbs_expression dbs_predicate_condition (SOME|ANY|ALL) LPARENCHAR dbs_select RPARENCHAR; -dbs_array_exists_predicate: ARRAY_EXISTS LPARENCHAR dbs_sql_identifier dbs_comma_separator dbs_integer RPARENCHAR; +dbs_array_exists_predicate: ARRAY_EXISTS LPARENCHAR dbs_sql_identifier dbs_comma_separator INTEGERLITERAL RPARENCHAR; dbs_between_predicate: dbs_expressions NOT? BETWEEN (dbs_expressions AND dbs_expressions | dbs_between_date_predicate); dbs_between_date_predicate: DATELITERAL AND DATELITERAL; dbs_distinct_predicate: dbs_expressions IS NOT? DISTINCT FROM dbs_expressions; @@ -1407,15 +1418,15 @@ dbs_predicate: (dbs_basic_predicate | dbs_quantified_predicate | dbs_array_exist dbs_searched_when_clause : (WHEN ((LPARENCHAR dbs_predicate RPARENCHAR) | dbs_predicate) THEN (dbs_result_expression1 | NULL))+; dbs_function_invocation : dbs_function_name LPARENCHAR (ALL | DISTINCT)? (TABLE dbs_transition_table_name | -(dbs_expressions | DATELITERAL) (dbs_comma_separator (dbs_expressions | DATELITERAL) | NUMERICLITERAL)*)? RPARENCHAR; +(dbs_expressions | DATELITERAL | ASTERISKCHAR) (dbs_comma_separator (dbs_expressions | DATELITERAL | ASTERISKCHAR) | NUMERICLITERAL)*)? RPARENCHAR; dbs_cast_specification: CAST LPARENCHAR (dbs_expression | NULL | dbs_parameter_marker) AS dbs_comment_parameter_type RPARENCHAR; dbs_time_zone_expression : ( dbs_function_invocation | LPARENCHAR dbs_expression RPARENCHAR | dbs_constant | -dbs_column_name | dbs_variable | dbs_special_register | dbs_scalar_fullselect | dbs_case_expression | dbs_cast_specification); +dbs_column_name | dbs_host_variable | dbs_special_register | dbs_scalar_fullselect | dbs_case_expression | dbs_cast_specification); dbs_time_zone_specific_expression : dbs_time_zone_expression ( AT LOCAL | AT TIME ZONE dbs_time_zone_expression); dbs_time_unit: (YEAR | YEARS | MONTH | MONTHS | DAY | DAYS | HOUR | HOURS | MINUTE | MINUTES | SECOND | SECONDS | MICROSECOND | MICROSECONDS ); dbs_labeled_duration: (dbs_function_invocation | LPARENCHAR dbs_expressions RPARENCHAR | dbs_constant | -dbs_column_name | dbs_variable) dbs_time_unit; +dbs_column_name | dbs_host_variable) dbs_time_unit; dbs_XMLCAST_specification: XMLCAST LPARENCHAR (dbs_expression | NULL | dbs_parameter_marker) AS dbs_comment_parameter_type RPARENCHAR; dbs_array_element_specification: dbs_array_variable; @@ -1424,21 +1435,25 @@ dbs_xquery_expression_constant: (dbs_expression|COLONCHAR|LSQUAREBRACKET|RSQUARE dbs_array_constructor: ARRAY LSQUAREBRACKET (QUESTIONMARK | dbs_fullselect | (dbs_array_element_specification | NULL) (dbs_comma_separator (dbs_array_element_specification | NULL))*) RSQUAREBRACKET; -dbs_lag_lead_expression: LPARENCHAR dbs_expression (dbs_comma_separator dbs_integer (dbs_comma_separator dbs_integer (dbs_comma_separator SINGLEQUOTE RESPECT NULLS SINGLEQUOTE | +dbs_lag_lead_expression: LPARENCHAR dbs_expression (dbs_comma_separator INTEGERLITERAL (dbs_comma_separator INTEGERLITERAL (dbs_comma_separator SINGLEQUOTE RESPECT NULLS SINGLEQUOTE | dbs_comma_separator SINGLEQUOTE IGNORE NULLS SINGLEQUOTE)?)?)? RPARENCHAR; dbs_lag_function: LAG dbs_lag_lead_expression; dbs_lead_function: LEAD dbs_lag_lead_expression; -dbs_partitioning_expression: DOLLARCHAR dbs_integer? dbs_char_n (PLUSCHAR dbs_integer (PERCENT dbs_integer)? | PERCENT dbs_integer (PLUSCHAR dbs_integer)?)? | dbs_expression; + +// commenting out a part of dbs_partitioning_expression, as it couldn't be found in the documentation +// ref: https://www.ibm.com/docs/en/db2-for-zos/13?topic=expressions-olap-specifications +// dbs_partitioning_expression: DOLLARCHAR INTEGERLITERAL? dbs_char_n (PLUSCHAR INTEGERLITERAL (PERCENT INTEGERLITERAL)? | PERCENT INTEGERLITERAL (PLUSCHAR INTEGERLITERAL)?)? | dbs_expression; +dbs_partitioning_expression: dbs_expression; dbs_window_partition_clause: PARTITION BY dbs_partitioning_expression (dbs_comma_separator dbs_partitioning_expression)* ; -dbs_sort_key_expression: dbs_column_name (dbs_expression_operator dbs_column_name)* | dbs_integer; +dbs_sort_key_expression: dbs_column_name (dbs_expression_operator dbs_column_name)* | INTEGERLITERAL; dbs_window_each_order_clause: dbs_sort_key_expression (ASC (NULLS LAST)? | ASC NULLS FIRST | DESC (NULLS FIRST)? | DESC NULLS LAST )?; dbs_window_order_clause: ORDER BY dbs_window_each_order_clause (dbs_comma_separator dbs_window_each_order_clause)*; dbs_ordered_OLAP_specification: (CUME_DIST LPARENCHAR RPARENCHAR| PERCENT_RANK LPARENCHAR RPARENCHAR | RANK LPARENCHAR RPARENCHAR| -DENSE_RANK LPARENCHAR RPARENCHAR | NTILE LPARENCHAR dbs_integer RPARENCHAR | dbs_lag_function | dbs_lead_function) +DENSE_RANK LPARENCHAR RPARENCHAR | NTILE LPARENCHAR INTEGERLITERAL RPARENCHAR | dbs_lag_function | dbs_lead_function) OVER LPARENCHAR dbs_window_partition_clause? dbs_window_order_clause RPARENCHAR; dbs_numbering_specification: ROW_NUMBER LPARENCHAR RPARENCHAR OVER LPARENCHAR dbs_window_partition_clause? dbs_window_order_clause? RPARENCHAR; @@ -1455,12 +1470,12 @@ dbs_comma_separator SINGLEQUOTE IGNORE NULLS SINGLEQUOTE) RPARENCHAR; dbs_ratio_to_report_function: RATIO_TO_REPORT LPARENCHAR dbs_expression RPARENCHAR; dbs_OLAP_column_function: dbs_value_function | dbs_ratio_to_report_function ; -dbs_group_start: (UNBOUNDED PRECEDING | CURRENT ROW | dbs_integer PRECEDING); -dbs_group_bound: (dbs_integer PRECEDING | dbs_integer FOLLOWING | CURRENT ROW); +dbs_group_start: (UNBOUNDED PRECEDING | CURRENT ROW | INTEGERLITERAL PRECEDING); +dbs_group_bound: (INTEGERLITERAL PRECEDING | INTEGERLITERAL FOLLOWING | CURRENT ROW); dbs_group_bound1: (UNBOUNDED PRECEDING | dbs_group_bound); dbs_group_bound2: (UNBOUNDED FOLLOWING | dbs_group_bound); dbs_group_between: BETWEEN dbs_group_bound1 AND dbs_group_bound2; -dbs_group_end: (UNBOUNDED FOLLOWING | dbs_integer FOLLOWING); +dbs_group_end: (UNBOUNDED FOLLOWING | INTEGERLITERAL FOLLOWING); dbs_window_aggregation_group_clause: (ROWS | RANGE) (dbs_group_start | dbs_group_between | dbs_group_end); dbs_aggregation_specification : (dbs_aggregate_function | dbs_OLAP_column_function) (OVER LPARENCHAR dbs_window_partition_clause? @@ -1470,7 +1485,7 @@ dbs_OLAP_specification: dbs_ordered_OLAP_specification | dbs_numbering_specification | dbs_aggregation_specification ; -dbs_table_designator: literal+; //? +dbs_table_designator: dbs_constant+; // TODO check me dbs_row_change_expression: ROW CHANGE (TIMESTAMP | TOKEN) FOR dbs_table_designator; dbs_sequence_reference: (NEXT| PREVIOUS) VALUE FOR dbs_sequence_name; @@ -1480,7 +1495,7 @@ dbs_sequence_reference: (NEXT| PREVIOUS) VALUE FOR dbs_sequence_name; /////// Variables ///////////// -literal: NONNUMERICLITERAL | NUMERICLITERAL | dbs_integer; +//literal: dbs_string_constant | NUMERICLITERAL | INTEGERLITERAL; db2sql_db_privileges: DBADM | DBCTRL | DBMAINT | CREATETAB | CREATETS | DISPLAYDB | DROP | IMAGCOPY | LOAD | RECOVERDB | REORG | REPAIR | STARTDB | STATS | STOPDB; db2sql_system_privileges: ACCESSCTRL | ARCHIVE | BINDADD | BINDAGENT | BSDS | CREATEALIAS | CREATEDBA | CREATEDBC | CREATESG | CREATETMTAB | CREATE_SECURE_OBJECT | @@ -1512,54 +1527,32 @@ CURRENT OPTIMIZATION HINT | CURRENT PACKAGE PATH | CURRENT PACKAGESET | (CURRENT CURRENT QUERY ACCELERATION | CURRENT QUERY ACCELERATION WAITFORDATA | CURRENT REFRESH AGE | CURRENT ROUTINE VERSION | CURRENT RULES | (CURRENT SCHEMA | CURRENT_SCHEMA) | (CURRENT SERVER | CURRENT_SERVER) | CURRENT SQLID | CURRENT TEMPORAL BUSINESS_TIME | CURRENT TEMPORAL SYSTEM_TIME | (CURRENT TIME | CURRENT_TIME) | -((CURRENT TIMESTAMP| CURRENT_TIMESTAMP) (LPARENCHAR dbs_integer RPARENCHAR)? (WITHOUT TIME ZONE|WITH TIME ZONE)? ) | +((CURRENT TIMESTAMP| CURRENT_TIMESTAMP) (LPARENCHAR INTEGERLITERAL RPARENCHAR)? (WITHOUT TIME ZONE|WITH TIME ZONE)? ) | (CURRENT TIME ZONE| CURRENT TIMEZONE | CURRENT_TIMEZONE) | ENCRYPTION PASSWORD | (SESSION TIME ZONE | SESSION TIMEZONE) | (SESSION_USER | USER) ); - -db2sql_data_value: DATELITERAL; -dbs_accelerator_name: IDENTIFIER; // - 1 -dbs_hostname_identifier : (IDENTIFIER | (DOT_FS | COLONCHAR | SLASHCHAR))+; -dbs_quad: (ZERO_DIGIT HEX_NUMBERS+ | ZERO_DIGIT OCTDIGITS+) | dbs_integer; -dbs_ip4: dbs_quad DOT_FS dbs_quad DOT_FS dbs_quad DOT_FS dbs_quad+; -dbs_address_value: dbs_ip4 | dbs_hostname_identifier | NONNUMERICLITERAL ; -dbs_alias_name: T=dbs_sql_identifier { validateLength($T.text, "Alias name", 128); }; //must not be an alias that exists at the current server +dbs_ip4: INTEGERLITERAL DOT_FS INTEGERLITERAL DOT_FS INTEGERLITERAL DOT_FS INTEGERLITERAL+ | dbs_string_constant; // TODO check this +dbs_address_value: dbs_ip4 | dbs_host_identifier ; // TODO check this dbs_applcompat_value: FUNCTION_LEVEL_10 | FUNCTION_LEVEL_11 | FUNCTION_LEVEL_12; -dbs_array_index: dbs_integer; -dbs_array_type_name: dbs_sql_identifier; dbs_array_variable: dbs_sql_identifier LSQUAREBRACKET (dbs_expressions) RSQUAREBRACKET; -dbs_array_variable_name: literal+; -dbs_attr_host_variable: dbs_hostname_identifier | NUMERICLITERAL ; // VARCHAR(128) -dbs_authorization_name: dbs_sql_identifier; -dbs_authorization_specification: IDENTIFIER; -dbs_aux_table_name: T=dbs_sql_identifier {validateLength($T.text, "Auxiliary table name", 128);}; -dbs_begin_column_name: dbs_generic_name; -dbs_binary_string_constant: BINARY_STRING_CONSTANT; +dbs_attr_host_variable: dbs_host_identifier | NUMERICLITERAL ; // VARCHAR(128) dbs_bp_name: T=dbs_sql_identifier {validateLength($T.text, "Buffer pool name", 8);}; dbs_case_expression : CASE (dbs_searched_when_clause | dbs_simple_when_clause) (ELSE NULL | ELSE dbs_result_expression1)? END ; dbs_cast_function_name: dbs_sql_identifier; dbs_catalog_name: T=dbs_sql_identifier {validateLength($T.text, "Catalog name", 8);}; -dbs_ccsid_value: dbs_integer; -dbs_character_string_constant: CHAR_STRING_CONSTANT; dbs_clone_table_name: T=dbs_sql_identifier {validateLength($T.text, "Clone table name", 128);}; -dbs_collection_id: IDENTIFIER; -dbs_collection_id_package_name: FILENAME; dbs_collection_name: T=dbs_sql_identifier {validateLength($T.text, "Collection name", 128);}; // SQLIDENTIFIER are case sensitive. allows only uppercase or quoted string as per doc. -dbs_generic_name: dbs_host_names | NONNUMERICLITERAL; -dbs_host_names: dbs_special_name | IDENTIFIER ; -dbs_host_names_var: COLONCHAR? dbs_host_name_container; -dbs_host_name_container: dbs_host_names (MINUSCHAR (dbs_host_names | dbs_integer))*; dbs_special_name: ABSOLUTE | ACCELERATION | ACCELERATOR | ACCESS | ACCESSCTRL | ACCTNG| ACTION | ACTIVATE | ACTIVE | ADD | ADDRESS | AFTER | AGE| ALGORITHM | ALIAS | ALL | ALLOCATE | ALLOW | ALTER | ALTERIN | ALWAYS | AND | ANY | APPEND | APPLCOMPAT | APPLICATION | APPLNAME | ARCHIVE | ARRAY| ARRAY_EXISTS | AS - | ASC | ASCII | ASENSITIVE | ASSEMBLE | ASSOCIATE | ASUTIME | AT | ATOMIC | ATTRIBUTES | AUDIT + | ASC | ASCII | ASENSITIVE | ASSOCIATE | ASUTIME | AT | ATOMIC | ATTRIBUTES | AUDIT | AUTHENTICATION | AUTHID | AUTONOMOUS | AUX | AUXILIARY | AVG | BASED | BEFORE | BEGIN - | BETWEEN | BIGINT | BINARY | BINARY_STRING_CONSTANT | BIND | BINDADD | BINDAGENT | BIT | BLOB + | BETWEEN | BIGINT | BINARY | BIND | BINDADD | BINDAGENT | BIT | BLOB | BOTH | BSDS | BUFFERPOOL | BUFFERPOOLS | BUSINESS_TIME | BY | CACHE| CALL | CALLED | CALLER | CAPTURE | CARDINALITY | CASCADE | CASCADED | CASE | CAST | CATALOG_NAME| CCSID | CHANGE | CHANGED | CHANGES | CHAR | CHARACTER | CHARACTER_LENGTH | CHAR_LENGTH | CHECK | CLAUSE | CLIENT | CLIENT_ACCTNG | CLIENT_APPLNAME| CLIENT_CORR_TOKEN| CLIENT_USERID| CLIENT_WRKSTNNAME| CLOB - | CLONE | CLOSE | CLUSTER | COALESCE | COBOL | COLLECTION | COLLID | COLUMN | COLUMNS | COMMENT + | CLONE | CLOSE | CLUSTER | COALESCE | COLLECTION | COLLID | COLUMN | COLUMNS | COMMENT | COMMIT | COMMITTED| COMPATIBILITY | COMPRESS | CONCAT | CONCENTRATE | CONCURRENT | CONDITION | CONDITION_NUMBER | CONNECT | CONNECTION | CONSTANT | CONSTRAINT | CONTAINS | CONTEXT | CONTINUE | CONTROL | COPY | CORR | CORRELATION | COUNT | COUNT_BIG | COVARIANCE| CREATE | CREATEALIAS @@ -1588,29 +1581,29 @@ dbs_special_name: ABSOLUTE | ACCELERATION | ACCELERATOR | ACCESS | ACCESSCTRL | | ELSEIF | EMPTY | ENABLE | ENCODING | ENCRYPTION | END | ENDING | ENFORCED | ENVIRONMENT | ERASE | ESCAPE | EUR | EVERY | EXCEPT | EXCHANGE | EXCLUDE | EXCLUDING | EXCLUSIVE | EXECUTE | EXISTS | EXIT | EXPLAIN | EXTERNAL | EXTRA | EXTRACT | FAILBACK | FAILURE| FAILURES | FENCED | FETCH - | FIELDPROC| FINAL | FIRST | FIRST_VALUE| FILENAME | FLOAT | FOLLOWING | FOR | FOREIGN | FORMAT | FOUND | FREE + | FIELDPROC| FINAL | FIRST | FIRST_VALUE| FLOAT | FOLLOWING | FOR | FOREIGN | FORMAT | FOUND | FREE | FREEPAGE | FULL | FUNCTION | FUNCTION_LEVEL_10| FUNCTION_LEVEL_11| FUNCTION_LEVEL_12 | GBPCACHE | GENERAL | GENERATE | GENERATED | GENERIC | GET | GET_ACCEL_ARCHIVE | GLOBAL | GO - | GOTO | GRANT | GRAPHIC | GROUP | GROUPING | G_CHAR| HANDLER | HASH | HAVING | HEX | HIDDENCHAR + | GOTO | GRANT | GRAPHIC | GROUP | GROUPING | HANDLER | HASH | HAVING | HEX | HIDDENCHAR | HIGH | HINT| HISTORY | HOLD | HOUR | HOURS | ID | IDENTITY | IF | IGNORE | IMAGCOPY | IMMEDIATE | IMPLICITLY | IN | INCLUDE | INCLUDING | INCLUSIVE | INCREMENT | INDEX | INDEXBP | INDICATOR | INHERIT | INITIALLY | INLINE | INOUT | INPUT | INSENSITIVE | INSERT | INSTEAD | INT | INTEGER | INTERSECT | INVALID | INVOKEBIND | INVOKERUN | IS | ISO | ISOLATION | ITERATE - | JAR | JAVA | JIS | JOBNAME| JOIN | KEEP | KEY | KEYS | K_CHAR| LABEL | LABELS | LAG| LANGUAGE - | LANGUAGE_C | LARGE | LAST | LAST_VALUE| LC_CTYPE | LEAD | LEAVE | LEFT | LENGTH | LEVEL | LIKE + | JAR | JIS | JOBNAME| JOIN | KEEP | KEY | KEYS | LABEL | LABELS | LAG| LANGUAGE + | LARGE | LAST | LAST_VALUE| LC_CTYPE | LEAD | LEAVE | LEFT | LENGTH | LEVEL | LIKE | LIMIT | LITERALS | LOAD | LOB | LOCAL | LOCALE | LOCATION | LOCATOR | LOCATORS | LOCK | LOCKED | LOCKMAX | LOCKS | LOCKSIZE | LOGGED | LOOP | LOW | LOWER | MAIN | MAINTAINED | MASK | MATCHED | MATERIALIZED | MAX | MAXPARTITIONS | MAXROWS | MAXVALUE | MEMBER | MERGE | MESSAGE_TEXT | MGMTCLAS| MICROSECOND | MICROSECONDS | MIN| MINUTE | MINUTES | MINVALUE | MIXED | MODE | MODIFIERS | MODIFIES | MONITOR1 | MONITOR2 | MONTH | MONTHS | MORECHAR | MOVE | MULTIPLIER - | M_CHAR| NAME | NAMES | NAMESPACE | NATIONAL | NCNAME| NEW | NEW_TABLE | NEXT | NO | NODEFER + | NAME | NAMES | NAMESPACE | NATIONAL | NCNAME| NEW | NEW_TABLE | NEXT | NO | NODEFER | NONE | NOT | NTH_VALUE| NTILE| NULL | NULLS | NULTERM | NUMBER | NUMERIC | NUMPARTS| OBID| OBJECT | OF | OFF | OFFSET | OLD | OLD_TABLE | ON | ONCE | ONLY | OPEN | OPERATION | OPTHINT | OPTIMIZE | OPTIMIZATION | OPTION | OPTIONAL | OPTIONS | OR | ORDER | ORDINALITY | ORGANIZE | ORIGINAL | OUT | OUTCOME | OUTER | OUTPUT | OVER | OVERLAPS | OVERRIDING | OWNER | OWNERSHIP | PACKADM | PACKAGE | PACKAGESET| PACKAGE_NAME | PACKAGE_SCHEMA | PACKAGE_VERSION | PADDED | PAGE | PAGENUM | PARALLEL | PARAMETER | PART | PARTITION | PARTITIONED| PASSING | PASSWORD | PATH | PCTFREE | PENDING - | PERCENT_RANK| PERIOD | PERMISSION | PIECESIZE | PLAN | PLI | PORTION | POSITION | POSITIONING + | PERCENT_RANK| PERIOD | PERMISSION | PIECESIZE | PLAN | PORTION | POSITION | POSITIONING | PRECEDING | PRECISION | PREPARE | PRESERVE | PREVIOUS| PRIMARY | PRIOR | PRIQTY | PRIVILEGES | PROCEDURE | PROFILE | PROGRAM | PUBLIC | QUALIFIER | QUERY | QUERYNO | QUOTED_NONE | RANDOM | RANGE | RANK | RATIO_TO_REPORT| READ | READS | REAL | RECORDS | RECOVER | RECOVERDB | REF @@ -1623,7 +1616,7 @@ dbs_special_name: ABSOLUTE | ACCELERATION | ACCELERATOR | ACCESS | ACCESSCTRL | | ROW_NUMBER| RR | RS | RULES| RUN | SAVEPOINT | SBCS | SCHEMA | SCHEME | SCRATCHPAD | SCROLL | SECOND | SECONDS | SECQTY | SECTION | SECURED | SECURITY | SEGSIZE| SELECT | SELECTIVITY | SENSITIVE | SEQUENCE | SERVAUTH | SERVER | SERVER_NAME | SESSION | SESSION_USER | SET | SETS - | SHARE | SIGNAL | SIZE | SKIPCHAR | SMALLINT | SOME | SOURCE | SPACE | SPECIAL | SPECIFIC | SQL + | SHARE | SIGNAL | SIZE | SKIPCHAR | SMALLINT | SOME | SOURCE | SPACE | SPECIAL | SPECIFIC | SQLADM | SQLCA | SQLCODE | SQLD | SQLDA | SQLDABC | SQLERROR | SQLEXCEPTION | SQLID | SQLN | SQLSTATE | SQLVAR | SQLWARNING | STABILIZED | STACKED | START | STARTDB | STARTING | STATEMENT | STATEMENTS | STATIC | STATS | STAY | STDDEV | STMTCACHE | STMTID | STMTTOKEN | STOGROUP | STOP @@ -1638,110 +1631,53 @@ dbs_special_name: ABSOLUTE | ACCELERATION | ACCELERATOR | ACCESS | ACCESSCTRL | | WHENEVER | WHERE | WHILE | WITH | WITHOUT | WLM | WORK | WORKFILE | WRAPPED | WRITE | WRKSTNNAME | XML | XMLCAST| XMLNAMESPACES| XMLPATTERN| XMLQUERY| XMLSCHEMA| XMLTABLE | YEAR | YEARS | YES | ZONE; -dbs_column_name: (dbs_generic_name DOT_FS)? T=dbs_generic_name {validateLength($T.text, "Column name", 30);}; -dbs_constant : (dbs_string_constant | dbs_integer_constant | DATELITERAL); -dbs_constraint_name: T=dbs_sql_identifier {validateLength($T.text, "Constraint name", 128);}; -dbs_context: dbs_sql_identifier; -dbs_context_name: T=dbs_host_name_container {validateLength($T.text, "Profile name", 127);}; dbs_copy_id: CURRENT | PREVIOUS | ORIGINAL; -dbs_correlation_name: T=dbs_host_name_container {validateLength($T.text, "Correlation name", 128);}; -dbs_cursor_name: T=dbs_host_name_container {validateLength($T.text, "Cursor name", 128);}; -dbs_database_name: T=dbs_host_name_container {validateLength($T.text, "Database name", 8);}; -dbs_dc_name: dbs_host_name_container;// JAVA - lenght must be < 9 -dbs_descriptor_name: COLONCHAR? (SQLD | SQLDABC | SQLN | SQLVAR | SQLDA | IDENTIFIER); dbs_diagnostic_string_expression: dbs_expressions; dbs_distinct_type: db2sql_data_types+; -dbs_distinct_type_name: T=dbs_sql_identifier {validateLength($T.text, "Distinct type name", 128);}; -dbs_dpsegsz_param: dbs_s? (ZERO_DIGIT | dbs_integer2 | dbs_integer4 | dbs_integer6 | dbs_integer8);// DPSEGSZ value, divisible by 4. Range [0,64], must be checked in code. -dbs_end_column_name: dbs_generic_name; -dbs_element_name: IDENTIFIER; +// Note: The DPSEGSZ subsystem parameter is not directly specified in a CREATE TABLESPACE statement. +// ref: https://www.ibm.com/docs/en/db2-for-zos/12?topic=2-default-partition-segsize-field-dpsegsz-subsystem-parameter +//dbs_dpsegsz_param: INTEGERLITERAL? (dbs_integer2 | dbs_integer4 | dbs_integer6 | dbs_integer8);// DPSEGSZ value, divisible by 4. Range [0,64], must be checked in code. dbs_encryption_value: QUOTED_NONE | LOW | HIGH; dbs_explainable_sql_statement: ( dbs_allocate | dbs_alter | dbs_associate | dbs_fetch | dbs_insert | dbs_label | dbs_lock | dbs_merge | dbs_open | dbs_prepare | dbs_refresh | dbs_release | dbs_rename | dbs_select | dbs_truncate | dbs_select | dbs_set | dbs_delete | dbs_drop); // RE-CHECK -dbs_ext_program_name: dbs_sql_identifier; -dbs_external_program_name: IDENTIFIER; -dbs_hint_variable: dbs_variable; -dbs_hint_string_constant: IDENTIFIER; -dbs_fetch_clause: FETCH (FIRST | NEXT) (PLUSCHAR? dbs_integer)? (ROW | ROWS) ONLY; -dbs_field_name: dbs_sql_identifier; -dbs_function_name: T=dbs_sql_identifier {validateLength($T.text, "Function name", 128);} | dbs_inbuild_functions; //must not be any of the system-reserved keywords -dbs_global_variable_name: dbs_generic_name | ROWID; -dbs_graphic_string_constant: GRAPHIC_CONSTANT; -dbs_history_table_name: dbs_table_name; -dbs_host_variable: dbs_host_var_identifier (INDICATOR? dbs_host_var_identifier)?; -dbs_host_variable_array: IDENTIFIER; // variable array must be defined in the application program -dbs_host_var_identifier: T=dbs_host_names_var {validateLength($T.text, "Host variable name", 128);}; -dbs_id_host_variable: NUMERICLITERAL; -dbs_identifier: dbs_sql_identifier; +dbs_fetch_clause: FETCH (FIRST | NEXT) (PLUSCHAR? INTEGERLITERAL)? (ROW | ROWS) ONLY; +// dbs_function_name: T=dbs_sql_identifier {validateLength($T.text, "Function name", 128);} | dbs_inbuild_functions; //must not be any of the system-reserved keywords +dbs_function_name: dbs_inbuild_functions | (dbs_sql_identifier DOT_FS)? dbs_sql_identifier; //must not be any of the system-reserved keywords dbs_imptkmod_param: YES | NO; dbs_include_data_type: dbs_alter_procedure_bit_int | dbs_alter_procedure_bit_decimal | dbs_alter_procedure_bit_float | dbs_alter_procedure_bit_decfloat | dbs_alter_procedure_bit_char | dbs_alter_procedure_bit_graphic | dbs_alter_procedure_bit_varchar | DATE | TIME | dbs_alter_procedure_bit_timestamp; -dbs_index_identifier: IDENTIFIER; -dbs_index_name: T=dbs_sql_identifier {validateLength($T.text, "Index name", 128);}; -dbs_integer: INTEGERLITERAL | SINGLEDIGIT_1 | DOUBLEDIGIT_1 | SINGLEDIGITLITERAL; -dbs_integer_constant: dbs_integer | NUMERICLITERAL; //range 1 - 32767 -dbs_jar_name: T=dbs_hostname_identifier {validateLength($T.text, "Jar name", 128);}; -dbs_jobname_value: IDENTIFIER | NONNUMERICLITERAL; -dbs_key_label_name: IDENTIFIER; -dbs_length: dbs_integer; //length must be between 1 and 32767. The default value is 100 bytes. -dbs_level: dbs_integer0 | dbs_integer1 dbs_integer2; -dbs_location_name: IDENTIFIER {validateLength($IDENTIFIER.text, "Location name", 16);}; //not greater than 16 -dbs_mask_name: dbs_sql_identifier; -dbs_mc_name: IDENTIFIER;// must be 1-8 characters in length -dbs_member_name: dbs_sql_identifier; -dbs_name: dbs_sql_identifier; // name of the WLM environment is an SQL identifier -dbs_namespace_name: VARCHAR; -dbs_nnnn_m: dbs_s dbs_s? dbs_s? dbs_s? DOT_FS dbs_s; +dbs_jobname_value: dbs_string_constant; +dbs_insert_algorithm_level: INTEGERLITERAL {validateTokenWithRegex($INTEGERLITERAL.text, "^0*[12]$", "level 1 and 2 are only allowed");}; +dbs_create_algorithm_level: INTEGERLITERAL {validateTokenWithRegex($INTEGERLITERAL.text, "^0*[0-2]$", "level 0, 1 and 2 are only allowed");}; +dbs_nnnn_m: NUMERICLITERAL {validateTokenWithRegex($NUMERICLITERAL.text, "^\\d{4}\\.\\d$", "a DECIMAL(5,1) numeric-constant is only allowed");}; dbs_non_deterministic_expression: DATA CHANGE OPERATION | dbs_special_register | dbs_session_variable; dbs_session_variable : SYSIBM DOT_FS PACKAGE_NAME | SYSIBM DOT_FS PACKAGE_SCHEMA | SYSIBM DOT_FS PACKAGE_VERSION; -dbs_numeric_constant: dbs_integer;// numeric literal without non-zero digits to the right of the decimal point. -dbs_obfuscated_statement_text: literal+ ; -dbs_package_name: NONNUMERICLITERAL {validateLength($NONNUMERICLITERAL.text, "Package name", 8);}; -dbs_password_variable: COLONCHAR? (literal | dbs_generic_name)+; -dbs_password_string_constant: IDENTIFIER; -dbs_package_path: FILENAME+; -dbs_pageset_pagenum_param: ABSOLUTE | dbs_char_a | RELATIVE | dbs_char_r ; -dbs_parameter_marker: ( QUESTIONMARK | COLONCHAR dbs_variable); +dbs_obfuscated_statement_text: dbs_constant+ ; +dbs_package_path: dbs_string_constant; +dbs_pageset_pagenum_param: ABSOLUTE | dbs_pagenum_char_a_r | RELATIVE; +dbs_parameter_marker: ( QUESTIONMARK | COLONCHAR dbs_host_variable); dbs_parameter_name: T=dbs_sql_identifier {validateLength($T.text, "Parameter name", 128);}; dbs_permission_name: dbs_sql_identifier; dbs_plan_name: T=dbs_sql_identifier {validateLength($T.text, "Plan name", 8);} ; -dbs_procedure_name: T=dbs_sql_identifier {validateLength($T.text, "Procedure name", 128);}; -dbs_profile_name: NONNUMERICLITERAL;// -dbs_program_name: IDENTIFIER {validateLength($IDENTIFIER.text, "Program name", 8);}; +dbs_program_name: T=dbs_sql_identifier {validateLength($T.text, "Program name", 8);}; dbs_registered_xml_schema_name: dbs_sql_identifier; dbs_result_expression1: dbs_expressions; dbs_role_name: T=dbs_sql_identifier+ {validateLength($T.text, "Role name", 128);}; -dbs_routine_version_id: IDENTIFIER {validateLength($IDENTIFIER.text, "Routine version identifier in UTF-8", 122);}; -dbs_rs_locator_variable: dbs_host_var_identifier; -dbs_run_time_options: NONNUMERICLITERAL; // a character string that is no longer than 254 bytes -dbs_s: SINGLEDIGITLITERAL | SINGLEDIGIT_1 ; // a number between 1 and 9 -dbs_sc_name: IDENTIFIER;// must be from 1-8 characters in length +dbs_routine_version_id: T=dbs_sql_identifier {validateLength($T.text, "Routine version dbs_sql_identifier in UTF-8", 122);}; dbs_scalar_fullselect : LPARENCHAR dbs_fullselect RPARENCHAR; -dbs_schema_location: dbs_hostname_identifier; -dbs_schema_name: IDENTIFIER {validateLength($IDENTIFIER.text, "Schema name", 128);} | SYSIBM; +dbs_schema_location: dbs_host_identifier; +dbs_schema_name: T=dbs_sql_identifier {validateLength($T.text, "Schema name", 128);}; dbs_search_condition: (NOT? dbs_predicate (SELECTIVITY dbs_integer_constant)? | LPARENCHAR dbs_search_condition RPARENCHAR) ((AND|OR) NOT? (dbs_predicate | dbs_search_condition))* ; -dbs_seclabel_name: IDENTIFIER {validateLength($IDENTIFIER.text, "Security label", 8);}; -dbs_sequence_name: T=dbs_sql_identifier {validateLength($T.text, "Sequence name", 128);}; -dbs_servauth_value: NONNUMERICLITERAL; +dbs_seclabel_name: T=dbs_sql_identifier {validateLength($T.text, "Security label", 8);}; dbs_simple_when_clause: (dbs_expressions) (WHEN (dbs_basic_predicate | dbs_expressions) THEN (dbs_result_expression1 | NULL))+; dbs_smallint: T=dbs_integer_constant {validateTextInRange($T.text, -2, 100);};//MINUSCHAR? SINGLEDIGITLITERAL SINGLEDIGITLITERAL?;// java ref - -1 to 99 -dbs_specific_name: T=dbs_sql_identifier {validateLength($T.text, "Specific name", 128);}; -dbs_sql_condition_name: T=dbs_generic_name {validateLength($T.text, "SQL condition name", 128);}; // No particular spec found in doc. Specifies the name of the condition. +dbs_specific_name: dbs_object_name; dbs_sql_control_statement: dbs_control_statement; -dbs_sql_parameter_name: T=dbs_sql_parameter_name_rule {validateLength($T.text, "SQL parameter name", 128);}; -dbs_sql_parameter_name_rule: COLONCHAR? dbs_generic_name; -dbs_sql_variable_name: dbs_sql_parameter_name | ASTERISKCHAR; -dbs_sqlstate_string_constant: NONNUMERICLITERAL; -dbs_statement_name: T=dbs_generic_name {validateLength($T.text, "Statement name", 128);}; dbs_stogroup_name: T=dbs_sql_identifier {validateLength($T.text, "Storage group name", 128);}; -dbs_string_constant: dbs_binary_string_constant | dbs_character_string_constant | dbs_graphic_string_constant | NONNUMERICLITERAL; dbs_string_expression: (DOUBLEQUOTE | SINGLEQUOTE) (dbs_allocate | dbs_alter | dbs_associate | dbs_comment | dbs_commit | dbs_create | dbs_declare_global | dbs_delete | dbs_drop | dbs_explain | dbs_free | dbs_grant |dbs_hold |dbs_insert | dbs_label | dbs_lock | dbs_merge | dbs_refresh | dbs_release| dbs_rename | dbs_revoke | dbs_rollback | dbs_savepoint | dbs_set | dbs_signal |dbs_truncate | dbs_update) (DOUBLEQUOTE | SINGLEQUOTE); // ref- https://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/sqlref/src/tpc/db2z_sql_executeimmediate.html dbs_synonym: T=dbs_sql_identifier {validateLength($T.text, "Synonym name", 128);}; -dbs_table_identifier: dbs_sql_identifier; -dbs_table_name: T=dbs_sql_identifier {validateLength($T.text, "Table name", 128);}; - dbs_table_reference: dbs_joined_table | dbs_table_reference_non_join; dbs_joined_table : dbs_normal_join @@ -1768,7 +1704,7 @@ empty_rule: /* epsilon */; dbs_table_reference_non_join : dbs_single_table_ref | dbs_single_view_ref | dbs_nested_table_expression | dbs_data_change_table_ref | dbs_table_function_ref | dbs_table_locator_ref | dbs_xmltable_expression | dbs_collection_derived_table; dbs_single_table_ref : dbs_table_name dbs_period_specification* dbs_correlation_clause?; -dbs_period_specification : FOR (SYSTEM_TIME | BUSINESS_TIME) (AS OF dbs_value | FROM dbs_value TO dbs_value | BETWEEN dbs_value AND dbs_value); +dbs_period_specification : FOR (SYSTEM_TIME | BUSINESS_TIME) (AS OF dbs_expressions | FROM dbs_expressions TO dbs_expressions | BETWEEN dbs_expressions AND dbs_expressions); dbs_correlation_clause : AS? dbs_correlation_name (LPARENCHAR dbs_column_name (dbs_comma_separator dbs_column_name)* RPARENCHAR)?; dbs_single_view_ref : dbs_single_table_ref; dbs_nested_table_expression : TABLE? LPARENCHAR dbs_fullselect RPARENCHAR dbs_correlation_clause?; @@ -1776,74 +1712,107 @@ dbs_data_change_table_ref : (FINAL TABLE LPARENCHAR dbs_insert RPARENCHAR | (FIN OLD TABLE LPARENCHAR dbs_delete RPARENCHAR | FINAL TABLE LPARENCHAR dbs_merge RPARENCHAR) dbs_correlation_clause?; dbs_table_function_ref : TABLE LPARENCHAR dbs_function_name LPARENCHAR ((dbs_expression | TABLE dbs_transition_table_name) (dbs_comma_separator (dbs_expression | TABLE dbs_transition_table_name))*)* RPARENCHAR dbs_table_udf_cardinality_clause? RPARENCHAR (dbs_correlation_clause | dbs_type_correlation_clause)?; -dbs_table_udf_cardinality_clause : CARDINALITY dbs_integer_constant | CARDINALITY MULTIPLIER dbs_numeric_constant; +dbs_table_udf_cardinality_clause : CARDINALITY dbs_integer_constant | CARDINALITY MULTIPLIER INTEGERLITERAL; dbs_type_correlation_clause : AS? dbs_correlation_name LPARENCHAR (dbs_column_name dbs_insert_data_type (dbs_comma_separator dbs_column_name dbs_insert_data_type)*) RPARENCHAR; -dbs_table_locator_ref : TABLE LPARENCHAR dbs_rs_locator_variable LIKE dbs_table_name RPARENCHAR dbs_correlation_name?; +dbs_table_locator_ref : TABLE LPARENCHAR dbs_host_variable LIKE dbs_table_name RPARENCHAR dbs_correlation_name?; dbs_xmltable_expression : dbs_xmltable_function dbs_correlation_clause?; dbs_xmltable_function : XMLTABLE LPARENCHAR (dbs_xml_namespace_declaration dbs_comma_separator)? dbs_row_query_expression_constant (PASSING (BY REF)? dbs_row_xquery_argument (dbs_comma_separator dbs_row_xquery_argument)*)? (COLUMNS (dbs_xml_table_regular_column_defn | dbs_xml_table_ordinality_column_defn) (dbs_comma_separator (dbs_xml_table_regular_column_defn | dbs_xml_table_ordinality_column_defn))* RPARENCHAR)?; -dbs_xml_namespace_args : dbs_namespace_uri AS dbs_namespace_prefix | DEFAULT dbs_namespace_uri | NO DEFAULT; -dbs_namespace_uri : NONNUMERICLITERAL; -dbs_namespace_prefix : NONNUMERICLITERAL; -dbs_xquery_context_item_expression : dbs_generic_name ; +dbs_xml_namespace_args : dbs_string_constant AS dbs_string_constant | DEFAULT dbs_string_constant | NO DEFAULT; dbs_xquery_variable_expression : dbs_expression; dbs_xml_namespace_declaration : XMLNAMESPACES LPARENCHAR dbs_xml_namespace_args (dbs_comma_separator dbs_xml_namespace_args)* RPARENCHAR; -dbs_row_query_expression_constant: NONNUMERICLITERAL; // must not contain an empty string or a string of all blanks. -dbs_column_xquery_expression_constant: NONNUMERICLITERAL; // must not be an empty string or a string of all blanks -dbs_row_xquery_argument : dbs_xquery_context_item_expression | dbs_xquery_variable_expression AS (NONNUMERICLITERAL | IDENTIFIER) (BY REF)?; +dbs_row_query_expression_constant: dbs_string_constant; // must not contain an empty string or a string of all blanks. +dbs_column_xquery_expression_constant: dbs_string_constant; // must not be an empty string or a string of all blanks +dbs_row_xquery_argument : dbs_xquery_context_item_expression | dbs_xquery_variable_expression AS (dbs_string_constant | dbs_sql_identifier) (BY REF)?; dbs_xml_table_regular_column_defn : dbs_column_name dbs_insert_data_type (column_def_clause | PATH dbs_column_xquery_expression_constant)?; dbs_xml_table_ordinality_column_defn: dbs_column_name FOR ORDINALITY; dbs_collection_derived_table : UNNEST LPARENCHAR (dbs_ordinary_array_expression (dbs_comma_separator dbs_ordinary_array_expression)* | dbs_assosiative_array_expression) RPARENCHAR (WITH ORDINALITY)? dbs_correlation_clause?; -dbs_ordinary_array_expression : IDENTIFIER; -dbs_assosiative_array_expression : NONNUMERICLITERAL; +dbs_ordinary_array_expression : dbs_sql_identifier; +dbs_assosiative_array_expression : dbs_string_constant; dbs_join_condition: dbs_inner_left_outer_join | dbs_full_join_expression; dbs_inner_left_outer_join : dbs_search_condition; dbs_full_join_expression : (dbs_column_name | dbs_cast_specification) | COALESCE LPARENCHAR (dbs_column_name | dbs_cast_specification) (dbs_comma_separator dbs_column_name | dbs_comma_separator dbs_cast_specification)+ RPARENCHAR; dbs_table_space_name: T=dbs_sql_identifier {validateDbNames($T.text);}; -dbs_target_namespace: dbs_hostname_identifier; -dbs_token_host_variable: dbs_generic_name; dbs_transition_table_name: dbs_sql_identifier; -dbs_transition_variable_name: COLONCHAR? dbs_generic_name; -dbs_trigger_name: T=dbs_sql_identifier {validateLength($T.text, "Trigger name", 128);}; dbs_trigger_version_id: dbs_sql_identifier; dbs_triggered_sql_statement : dbs_call | dbs_delete | dbs_select_statement_common_table_expression | dbs_fullselect | dbs_insert | dbs_merge | dbs_refresh | dbs_set | dbs_signal | dbs_truncate | dbs_update | dbs_values_statement; dbs_values_statement : VALUES (LPARENCHAR dbs_expression (dbs_comma_separator dbs_expression)* RPARENCHAR | dbs_expression) ; -dbs_triggered_sql_statement_adv: dbs_call | dbs_delete | dbs_get | dbs_insert | dbs_merge | dbs_refresh | +dbs_triggered_sql_statement_adv: dbs_call | dbs_delete | dbs_get_diagnostics_statement | dbs_insert | dbs_merge | dbs_refresh | dbs_set | dbs_signal | dbs_truncate | dbs_update | dbs_values_into; dbs_triggered_sql_statement_basic: dbs_triggered_sql_statement; -dbs_type_name: IDENTIFIER; -dbs_value: db2sql_data_value; -dbs_variable : ( dbs_host_variable | dbs_transition_variable_name | dbs_sql_variable_name | dbs_global_variable_name ) dbs_integer*; -dbs_variable_name: dbs_sql_identifier; -dbs_version_id: dbs_hostname_identifier | FILENAME | NONNUMERICLITERAL; -dbs_version_name: IDENTIFIER | FILENAME; -dbs_view_name: dbs_hostname_identifier? T=dbs_sql_identifier {validateLength($T.text, "View name", 128);}; -dbs_volume_id: IDENTIFIER; -dbs_pieceSize : IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");}; -dbs_sql_identifier: NONNUMERICLITERAL | IDENTIFIER | FILENAME | FILENAME (DOT_FS IDENTIFIER)* | DSNDB04 | TRANSACTION | RECORDS | dbs_special_name; +dbs_version_id: dbs_host_variable | dbs_sql_identifier | dbs_string_constant; +dbs_view_name: dbs_host_variable | dsb_alias_name; +dbs_pieceSize : T=dbs_sql_identifier {validateTokenWithRegex($T.text, "\\d+[MmGgKk]", "db2SqlParser.pieceSize");}; dbs_comma_separator: (COMMASEPARATORDB2 | COMMACHAR); dbs_semicolon_end: SEMICOLON_FS | SEMICOLONSEPARATORSQL; -dbs_integer0: T=dbs_integer {validateValue($T.text, "0");}; -dbs_integer1: T=dbs_integer {validateValue($T.text, "1");}; -dbs_integer2: T=dbs_integer {validateValue($T.text, "2");}; -dbs_integer4: T=dbs_integer {validateValue($T.text, "4");}; -dbs_integer5: T=dbs_integer {validateValue($T.text, "5");}; -dbs_integer6: T=dbs_integer {validateValue($T.text, "6");}; -dbs_integer8: T=dbs_integer {validateValue($T.text, "8");}; -dbs_integer12: T=dbs_integer {validateValue($T.text, "12");}; -dbs_integer15: T=dbs_integer {validateValue($T.text, "15");}; -dbs_integer16: T=dbs_integer {validateValue($T.text, "16");}; -dbs_integer31: T=dbs_integer {validateValue($T.text, "31");}; -dbs_integer34: T=dbs_integer {validateValue($T.text, "34");}; -dbs_integer100: T=dbs_integer {validateValue($T.text, "100");}; -dbs_integer256: T=dbs_integer {validateValue($T.text, "256");}; -dbs_integer1200: T=dbs_integer {validateValue($T.text, "1200");}; -dbs_integer1208: T=dbs_integer {validateValue($T.text, "1208");}; -dbs_integer_max: T=dbs_integer {validateValue($T.text, "2147483647");}; -dbs_char_a: T=(NONNUMERICLITERAL | IDENTIFIER) {validateValue($T.text, "A");}; -dbs_char_n: T=(NONNUMERICLITERAL | IDENTIFIER) {validateValue($T.text, "N");}; -dbs_char_r: T=(NONNUMERICLITERAL | IDENTIFIER) {validateValue($T.text, "R");}; +//////// BUILDING BLOCKS /// +/////// Ref: https://www.ibm.com/docs/en/db2-for-zos/12?topic=elements-naming-conventions //// +dbs_integer_constant: INTEGERLITERAL | NUMERICLITERAL; //range 1 - 32767 +dbs_sql_identifier: IDENTIFIER | DSNDB04 | TRANSACTION | RECORDS | dbs_special_name; +dbs_constant : (dbs_string_constant | dbs_integer_constant); +dbs_generic_name: dbs_host_variable | dbs_string_constant | dbs_sql_identifier; //TODO : check this +dbs_string_constant: CHAR_STRING_LITERAL | HEXSTRING | BXSTRING | GRAPHIC_CONSTANT | DATELITERAL; +dbs_accelerator_name: dbs_sql_identifier; // TODO {1-8 chars} +dsb_alias_name: dbs_sql_identifier DOT_FS dbs_sql_identifier DOT_FS dbs_sql_identifier + | dbs_sql_identifier DOT_FS dbs_sql_identifier + | dbs_sql_identifier; +dbs_array_type_name: dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; +dbs_authorization_name: dbs_sql_identifier; +dbs_authorization_id: dbs_string_constant; +dbs_aux_table_name: dsb_alias_name; //TODO {validateLength($T.text, "Auxiliary table name", 128);}; +dbs_table_name: dsb_alias_name; +//dbs_bpname: ('B' | 'b') ('P' |' p') INTEGERLITERAL (('K' | 'k') INTEGERLITERAL)?; +dbs_collection_id: dbs_sql_identifier; +dbs_column_name: (dsb_alias_name DOT_FS)? dbs_sql_identifier; //TODO {validateLength($T.text, "Column name", 30);}; +dbs_constraint_name: dbs_sql_identifier; //todo {validateLength($T.text, "Constraint name", 128);}; +dbs_context_name: dbs_sql_identifier; //TODO {validateLength($T.text, "Profile name", 127);}; +dbs_correlation_name: dbs_sql_identifier; //todo {validateLength($T.text, "Correlation name", 128);}; +dbs_cursor_name: dbs_sql_identifier; +dbs_host_identifier: COLONCHAR dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; //todo: {validateLength($T.text, "Cursor name", 128);}; +dbs_database_name: dbs_sql_identifier; //TODO check identifier must start with a letter and must not include special characters +dbs_host_variable: dbs_host_identifier (INDICATOR? dbs_host_identifier)?; +dbs_host_label: COLONCHAR? dbs_sql_identifier; +dbs_descriptor_name: dbs_host_variable;// dbs_descriptor_name: COLONCHAR? (SQLD | SQLDABC | SQLN | SQLVAR | SQLDA | IDENTIFIER); +dbs_distinct_type_name: dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; // {validateLength($T.text, "Distinct type name", 128);}; +dbs_external_program_name: dbs_procedure_name; +dbs_procedure_name: dsb_alias_name | dbs_host_identifier; // {validateLength($T.text, "Procedure name", 128);}; +dbs_profile_name: dbs_sql_identifier; +db2_function_name: dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; +dbs_global_variable: dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; +dbs_index_name: dbs_sql_identifier (DOT_FS dbs_sql_identifier)? + | dbs_authorization_id DOT_FS dbs_sql_identifier; // {validateLength($T.text, "Index name", 128);}; +dbs_location_name: dbs_sql_identifier; // TODO: A location name is 1 to 16 bytes, does not include alphabetic extenders (national characters), lowercase letters, or Katakana characters. +dbs_mask_name: dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; +dbs_parameter: dbs_expression | TABLE dbs_sql_identifier | NULL; +//dbs_package_name: dbs_sql_identifier DOT_FS (dbs_sql_identifier | ASTERISKCHAR); // added below correction +dbs_package_name: (dbs_sql_identifier DOT_FS)? dbs_sql_identifier; +dbs_sequence_name : dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; // {validateLength($T.text, "Sequence name", 128);}; +dbs_trigger_name : dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; // {validateLength($T.text, "Trigger name", 128);}; +dbs_version_name: CHAR_STRING_LITERAL | dbs_host_variable | ;//empty alternative; +dbs_object_name: dbs_sql_identifier (DOT_FS dbs_sql_identifier)?; +dbs_sql_variable_reference: dbs_host_variable | dbs_object_name; +dbs_statement_name: dbs_sql_identifier; +dbs_xquery_context_item_expression: dbs_generic_name; +///// validation rules ///// +dbs_integer5: T=INTEGERLITERAL {validateValue($T.text, "5");}; +dbs_integer12: T=INTEGERLITERAL {validateValue($T.text, "12");}; +dbs_integer1200: T=INTEGERLITERAL {validateValue($T.text, "1200");}; +dbs_integer1208: T=INTEGERLITERAL {validateValue($T.text, "1208");}; +dbs_decfloat_integer: INTEGERLITERAL {validate34or16($INTEGERLITERAL.text);}; +dbs_decimal_15_31: INTEGERLITERAL {validateTokenWithRegex($INTEGERLITERAL.text, "\\b(15|31)\\b", "15 or 31 are only allowed");}; +dbs_pagenum_char_a_r: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "^[aArR]$", "unknown token. Expected A, R");}; +dbs_char_s: T=IDENTIFIER {validateValue($T.text, "S");}; +dbs_function_language: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "(?i)\\b(ASSEMBLE|C|COBOL|JAVA|PLI)\\b", "unknown token. Supported tokens are JAVA, ASSEMBLE, C, COBOL, PLI");}; +dbs_function_parameter_style: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "(?i)\\b(SQL|JAVA)\\b", "unknown token. Supported tokens are JAVA, SQL");}; +dbs_procedure_language: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "(?i)\\b(ASSEMBLE|C|COBOL|JAVA|PLI|REXX)\\b", "unknown token. Supported tokens are JAVA, ASSEMBLE, C, COBOL, PLI, REXX");}; +oneof_lang: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "(?i)\\b(ASSEMBLE|C|COBOL|JAVA|PLI|REXX|SQL)\\b", "unknown token. Supported tokens are JAVA, ASSEMBLE, C, COBOL, PLI, REXX, SQL");}; +dbs_exact_match_identifier_sql: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "(?i)\\b(SQL)\\b", "unknown token. Supported tokens is SQL");}; +dbs_k_m_g_identifier: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "(?i)\\b(K|M|G)\\b", "unknown token. Supported tokens is K, M, G");}; +kmg_blob_parameter: INTEGERLITERAL dbs_k_m_g_identifier? | IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "(?i)^\\d+[KMG]?$", "unknown token");}; +dbs_g_char_identifier: IDENTIFIER {validateTokenWithRegex($IDENTIFIER.text, "^[gG]$", "unknown token. Expected G");}; +dbs_dsize_parameter: INTEGERLITERAL dbs_g_char_identifier | IDENTIFIER; +dbs_maxPartition: INTEGERLITERAL {validateIntegerRange($INTEGERLITERAL.text, 1, 4096);}; ///// diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/cfg/CFASTBuilderImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/cfg/CFASTBuilderImpl.java index b037830a63..947fa584db 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/cfg/CFASTBuilderImpl.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/cfg/CFASTBuilderImpl.java @@ -107,16 +107,20 @@ private void traverse(CFASTNode parent, Node node) { node.getChildren().forEach(child -> traverse(parent, child)); } else if (node instanceof PerformNode) { if (((PerformNode) node).isInline()) { - addChild(parent, new CFASTNode(CFASTNodeType.INLINE_PERFORM.getValue(), convertLocation(node))); + + PerformUntilType performUntilType = getPerformUntilType((PerformNode) node); + addChild(parent, new InlinePerform(convertLocation(node), performUntilType == PerformUntilType.UNTIL_EXIT)); node.getChildren().forEach(child -> traverse(parent, child)); addChild(parent, new CFASTNode(CFASTNodeType.END_INLINE_PERFORM.getValue(), convertLocation(node))); } else { PerformNode performNode = ((PerformNode) node); - addChild( - parent, + PerformUntilType performUntilType = getPerformUntilType((PerformNode) node); + + addChild(parent, new Perform(performNode.getTarget(), performNode.getThru(), - convertLocation(node) + convertLocation(node), + performUntilType )); } } else if (node instanceof ExitPerformNode) { @@ -278,4 +282,14 @@ private String cutSnippet(Node node) { }); return sb.toString(); } + + private PerformUntilType getPerformUntilType(PerformNode performNode) { + return performNode.getDepthFirstStream() + .filter(n -> n instanceof PerformUntilNode) + .findFirst() + .map(PerformUntilNode.class::cast) + .map(PerformUntilNode::isUntilExit) + .map(n -> n ? PerformUntilType.UNTIL_EXIT : PerformUntilType.UNTIL_CONDITION) + .orElse(null); + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/StatementValidate.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/StatementValidate.java index 79b79d4e67..f4c7127691 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/StatementValidate.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/StatementValidate.java @@ -15,6 +15,7 @@ package org.eclipse.lsp.cobol.core.engine.processors; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import lombok.extern.slf4j.Slf4j; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.common.error.SyntaxError; @@ -22,17 +23,13 @@ import org.eclipse.lsp.cobol.common.model.Locality; import org.eclipse.lsp.cobol.common.model.tree.Node; import org.eclipse.lsp.cobol.common.model.NodeType; +import org.eclipse.lsp.cobol.common.model.tree.statements.*; import org.eclipse.lsp.cobol.common.model.tree.variable.*; import org.eclipse.lsp.cobol.common.processor.ProcessingContext; import org.eclipse.lsp.cobol.common.processor.Processor; import org.eclipse.lsp.cobol.common.model.tree.LiteralNode; -import org.eclipse.lsp.cobol.common.model.tree.statements.SetToBooleanStatement; -import org.eclipse.lsp.cobol.common.model.tree.statements.SetToOnOffStatement; -import org.eclipse.lsp.cobol.common.model.tree.statements.SetUpDownByStatement; -import org.eclipse.lsp.cobol.common.model.tree.statements.StatementNode; -import java.util.List; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -53,6 +50,10 @@ public class StatementValidate implements Processor { MessageTemplate.of("variables.elementaryWithType", MessageTemplate.of("variables.integer")), MessageTemplate.of("variables.nonzeroInteger") }; + private static final Set POINTER_USAGE_FORMATS = ImmutableSet.of( + UsageFormat.PROCEDURE_POINTER, + UsageFormat.POINTER, + UsageFormat.FUNCTION_POINTER); @Override public void accept(StatementNode node, ProcessingContext ctx) { @@ -87,6 +88,36 @@ public void accept(StatementNode node, ProcessingContext ctx) { INVALID_SENDING_FIELD_TEMPLATE, SENDING_FIELD_TYPES)); } + + if (node instanceof SetToStatement && !((SetToStatement) node).isAddress()) { + SetToStatement setToStatementNode = (SetToStatement) node; + if (!(setToStatementNode.getSendingField() instanceof QualifiedReferenceNode)) { + ctx.getErrors().addAll(validateVariableUsageFormat(setToStatementNode.getReceivingFields())); + } + } + } + + private List validateVariableUsageFormat(List fields) { + return fields.stream() + .filter(Node.hasType(QUALIFIED_REFERENCE_NODE)) + .map(QualifiedReferenceNode.class::cast) + .filter( + reference -> + reference + .getVariableDefinitionNode() + .map(variableNode -> { + if (variableNode.getVariableType() != VariableType.INDEX_ITEM + && variableNode.getVariableType() != VariableType.GROUP_ITEM) { + return true; + } + if (variableNode instanceof GroupItemNode && variableNode.getVariableType() == VariableType.GROUP_ITEM) { + return !POINTER_USAGE_FORMATS.contains(((GroupItemNode) variableNode).getUsageFormat()); + } + return false; + }) + .orElse(false)) + .map(variableNode -> createError(variableNode.getLocality(), INVALID_RECEIVING_FIELD_TEMPLATE, VariableType.INDEX_ITEM.getTemplate())) + .collect(Collectors.toList()); } private List validateVariableType( diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/InlinePerform.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/InlinePerform.java new file mode 100644 index 0000000000..ae4b605576 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/InlinePerform.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.core.model.extendedapi; + +import lombok.EqualsAndHashCode; +import lombok.Value; + +/** Data transport object of CF AST. InlinePerform type represents PERFORM UNTIL COBOL statement */ +@Value +@EqualsAndHashCode(callSuper = true) +public class InlinePerform extends CFASTNode { + boolean untilExit; + + public InlinePerform(Location location, boolean untilExit) { + super(CFASTNodeType.INLINE_PERFORM.getValue(), location); + this.untilExit = untilExit; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/Perform.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/Perform.java index adae653167..16cb285476 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/Perform.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/Perform.java @@ -28,12 +28,14 @@ public class Perform extends CFASTNode { String targetSectionName; String thruName; String thruSectionName; + PerformUntilType performUntilType; - public Perform(ProcedureName target, ProcedureName thru, Location location) { + public Perform(ProcedureName target, ProcedureName thru, Location location, PerformUntilType performUntilType) { super(CFASTNodeType.PERFORM.getValue(), location); this.targetName = Optional.ofNullable(target).map(ProcedureName::getName).orElse(null); this.targetSectionName = Optional.ofNullable(target).map(ProcedureName::getInSection).orElse(null); this.thruName = Optional.ofNullable(thru).map(ProcedureName::getName).orElse(null); this.thruSectionName = Optional.ofNullable(thru).map(ProcedureName::getInSection).orElse(null); + this.performUntilType = performUntilType; } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/PerformUntilType.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/PerformUntilType.java new file mode 100644 index 0000000000..9ac7c583ba --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/extendedapi/PerformUntilType.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.core.model.extendedapi; + +/** + * Perform type represents PERFORM UNTIL Clause type + */ +public enum PerformUntilType { + UNTIL_EXIT, + UNTIL_CONDITION +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java index 5b0d656f6c..46e6ce1c7b 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java @@ -32,10 +32,7 @@ import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.common.model.*; import org.eclipse.lsp.cobol.common.model.tree.*; -import org.eclipse.lsp.cobol.common.model.tree.statements.SetToBooleanStatement; -import org.eclipse.lsp.cobol.common.model.tree.statements.SetToOnOffStatement; -import org.eclipse.lsp.cobol.common.model.tree.statements.SetUpDownByStatement; -import org.eclipse.lsp.cobol.common.model.tree.statements.StatementNode; +import org.eclipse.lsp.cobol.common.model.tree.statements.*; import org.eclipse.lsp.cobol.common.model.tree.variable.*; import org.eclipse.lsp.cobol.common.model.tree.variable.VariableDefinitionNode.Builder; import org.eclipse.lsp.cobol.common.model.variables.DivisionType; @@ -914,6 +911,16 @@ public List visitPerformInlineStatement(PerformInlineStatementContext ctx) return addTreeNode(ctx, PerformNode::new); } + @Override + public List visitPerformUntil(PerformUntilContext ctx) { + boolean untilExit = Optional.of(ctx) + .map(PerformUntilContext::performUntilCondition) + .map(PerformUntilConditionContext::EXIT) + .isPresent(); + + return addTreeNode(ctx, locality -> new PerformUntilNode(locality, untilExit)); + } + @Override public List visitPerformProcedureStatement(PerformProcedureStatementContext ctx) { final ProcedureName targetName = parseProcedureName(ctx.procedureName()); @@ -1078,6 +1085,33 @@ && ofNullable(ctx.dataOccursClause().get(0).dataOccursTo().UNBOUNDED()) visitChildren(ctx)); } + @Override + public List visitSetToStatement(SetToStatementContext ctx) { + List receivingField = + ctx.receivingField().stream().map(this::visit).flatMap(List::stream).collect(toList()); + + boolean address = ctx.receivingField().stream() + .map(f -> f.children) + .filter(Objects::nonNull) + .flatMap(Collection::stream) + .filter(c -> c instanceof GeneralIdentifierContext) + .flatMap(c -> ((GeneralIdentifierContext) c).children.stream()) + .anyMatch(c -> c instanceof SpecialRegisterContext); + + List sendingField = + ofNullable(ctx.sendingField()).map(this::visit).orElseGet(ImmutableList::of); + List children = new ArrayList<>(); + children.addAll(receivingField); + children.addAll(sendingField); + if (sendingField.size() != 1) return children; + SetToStatement statement = + new SetToStatement(address, + retrieveLocality(ctx, extendedDocument, copybooks).orElse(null), + receivingField, + sendingField.get(0)); + return addTreeNode(statement, children); + } + @Override public List visitSetUpDownByStatement(SetUpDownByStatementContext ctx) { List receivingField = diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessor.java index dda8495bfd..6a30cee7a9 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessor.java @@ -24,46 +24,30 @@ import org.eclipse.lsp.cobol.implicitDialects.cics.generator.CICSBulkImplicitVariablesGenerator; import org.eclipse.lsp.cobol.implicitDialects.cics.generator.CICSSRImplicitVariablesGenerator; -import java.util.List; - /** Enrich symbolic table with predefined variables */ public class CICSImplicitVariablesProcessor implements Processor { @Override public void accept(SectionNode sectionNode, ProcessingContext processingContext) { - if (sectionNode.getSectionType() == SectionType.LINKAGE) { - VariableAccumulator variableAccumulator = processingContext.getVariableAccumulator(); - ProgramNode programNode = - sectionNode - .getProgram() - .orElseThrow( - () -> - new RuntimeException( - "Program for section " + sectionNode.getSectionType() + " not found")); - registerVariable( - variableAccumulator, programNode, CICSBulkImplicitVariablesGenerator.generate()); - } - - if (sectionNode.getSectionType() == SectionType.WORKING_STORAGE) { - VariableAccumulator variableAccumulator = processingContext.getVariableAccumulator(); - ProgramNode programNode = - sectionNode - .getProgram() - .orElseThrow( - () -> - new RuntimeException( - "Program for section " + sectionNode.getSectionType() + " not found")); - registerVariables( - variableAccumulator, programNode, CICSSRImplicitVariablesGenerator.generate()); + final SectionType st = sectionNode.getSectionType(); + final boolean lstor = st == SectionType.LINKAGE; + final boolean wstor = st == SectionType.WORKING_STORAGE; + if (!lstor && !wstor) + return; + + final VariableAccumulator variableAccumulator = processingContext.getVariableAccumulator(); + final ProgramNode programNode = sectionNode + .getProgram() + .orElseThrow(() -> new RuntimeException("Program for section " + st + " not found")); + + if (lstor) + registerVariable(variableAccumulator, programNode, CICSBulkImplicitVariablesGenerator.generate()); + if (wstor) { + for (VariableNode vn : CICSSRImplicitVariablesGenerator.generate()) + registerVariable(variableAccumulator, programNode, vn); } } - - private void registerVariables( - VariableAccumulator variableAccumulator, ProgramNode programNode, List nodes) { - nodes.forEach(n -> registerVariable(variableAccumulator, programNode, n)); - } - private void registerVariable( VariableAccumulator variableAccumulator, ProgramNode programNode, VariableNode variable) { variableAccumulator.addVariableDefinition(programNode, variable); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSCreateSPOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSCreateSPOptionsCheckUtility.java new file mode 100644 index 0000000000..75f1b04f50 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSCreateSPOptionsCheckUtility.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + + import org.antlr.v4.runtime.ParserRuleContext; + + import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; + import org.eclipse.lsp.cobol.common.error.ErrorSeverity; + import org.eclipse.lsp.cobol.common.error.SyntaxError; + import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; + import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + + import java.util.HashMap; + import java.util.List; + import java.util.Map; + + import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_create; + +/** Checks CICS Create System Command rules for required and invalid options */ +public class CICSCreateSPOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_create; + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.ATOMSERVICE, ErrorSeverity.ERROR); + put(CICSLexer.BUNDLE, ErrorSeverity.ERROR); + put(CICSLexer.DB2CONN, ErrorSeverity.ERROR); + put(CICSLexer.DB2ENTRY, ErrorSeverity.ERROR); + put(CICSLexer.DB2TRAN, ErrorSeverity.ERROR); + put(CICSLexer.DOCTEMPLATE, ErrorSeverity.ERROR); + put(CICSLexer.DUMPCODE, ErrorSeverity.ERROR); + put(CICSLexer.ENQMODEL, ErrorSeverity.ERROR); + put(CICSLexer.FILE, ErrorSeverity.ERROR); + put(CICSLexer.PIPELINE, ErrorSeverity.ERROR); + put(CICSLexer.IPCONN, ErrorSeverity.ERROR); + put(CICSLexer.JOURNALMODEL, ErrorSeverity.ERROR); + put(CICSLexer.JVMSERVER, ErrorSeverity.ERROR); + put(CICSLexer.LIBRARY, ErrorSeverity.ERROR); + put(CICSLexer.LSRPOOL, ErrorSeverity.ERROR); + put(CICSLexer.MAPSET, ErrorSeverity.ERROR); + put(CICSLexer.MQCONN, ErrorSeverity.ERROR); + put(CICSLexer.MQMONITOR, ErrorSeverity.ERROR); + put(CICSLexer.PARTITIONSET, ErrorSeverity.ERROR); + put(CICSLexer.PARTNER, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSTYPE, ErrorSeverity.ERROR); + put(CICSLexer.PROFILE, ErrorSeverity.ERROR); + put(CICSLexer.PROGRAM, ErrorSeverity.ERROR); + put(CICSLexer.TCPIPSERVICE, ErrorSeverity.ERROR); + put(CICSLexer.TDQUEUE, ErrorSeverity.ERROR); + put(CICSLexer.TRANCLASS, ErrorSeverity.ERROR); + put(CICSLexer.TRANSACTION, ErrorSeverity.ERROR); + put(CICSLexer.TSMODEL, ErrorSeverity.ERROR); + put(CICSLexer.TYPETERM, ErrorSeverity.ERROR); + put(CICSLexer.URIMAP, ErrorSeverity.ERROR); + put(CICSLexer.WEBSERVICE, ErrorSeverity.ERROR); + put(CICSLexer.SESSIONS, ErrorSeverity.ERROR); + put(CICSLexer.TERMINAL, ErrorSeverity.ERROR); + put(CICSLexer.CONNECTION, ErrorSeverity.ERROR); + put(CICSLexer.ATTRIBUTES, ErrorSeverity.ERROR); + put(CICSLexer.ATTRLEN, ErrorSeverity.ERROR); + put(CICSLexer.DISCARD, ErrorSeverity.WARNING); + put(CICSLexer.COMPLETE, ErrorSeverity.WARNING); + put(CICSLexer.LOG, ErrorSeverity.WARNING); + put(CICSLexer.NOLOG, ErrorSeverity.WARNING); + put(CICSLexer.LOGMESSAGE, ErrorSeverity.ERROR); + } + }; + public CICSCreateSPOptionsCheckUtility( + DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS Create System Command rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + if (ctx.getRuleIndex() == CICSParser.RULE_cics_create_opts) + checkOpts((CICSParser.Cics_create_optsContext) ctx); + + checkDuplicates(ctx); + } + private void checkOpts(CICSParser.Cics_create_optsContext ctx) { + checkHasMutuallyExclusiveOptions(ctx.ATOMSERVICE(), ctx.BUNDLE(), ctx.DB2CONN(), ctx.DB2ENTRY(), ctx.DB2TRAN(), ctx.DOCTEMPLATE(), ctx.DUMPCODE(), + ctx.ENQMODEL(), ctx.FILE(), ctx.PIPELINE(), ctx.IPCONN(), ctx.JOURNALMODEL(), ctx.JVMSERVER(), ctx.LIBRARY(), + ctx.LSRPOOL(), ctx.MAPSET(), ctx.MQCONN(), ctx.MQMONITOR(), ctx.PARTITIONSET(), ctx.PARTNER(), + ctx.PROCESSTYPE(), ctx.PROFILE(), ctx.PROGRAM(), ctx.TCPIPSERVICE(), ctx.TDQUEUE(), ctx.TRANCLASS(), + ctx.TRANSACTION(), ctx.TSMODEL(), ctx.TYPETERM(), ctx.URIMAP(), ctx.WEBSERVICE(), ctx.SESSIONS(), + ctx.TERMINAL(), ctx.CONNECTION()); + + if (!ctx.CONNECTION().isEmpty() || !ctx.TERMINAL().isEmpty()) { + checkHasExactlyOneOption("ATTRIBUTES or COMPLETE or DISCARD", ctx, ctx.ATTRIBUTES(), ctx.COMPLETE(), ctx.DISCARD()); + if (!ctx.DISCARD().isEmpty() || !ctx.COMPLETE().isEmpty()) { + checkHasIllegalOptions(ctx.ATTRLEN(), "ATTRLEN"); + checkHasIllegalOptions(ctx.LOG(), "LOG"); + checkHasIllegalOptions(ctx.NOLOG(), "NOLOG"); + checkHasIllegalOptions(ctx.LOGMESSAGE(), "LOGMESSAGE"); + } + } else { + checkHasIllegalOptions(ctx.DISCARD(), "DISCARD"); + checkHasIllegalOptions(ctx.COMPLETE(), "COMPLETE"); + checkHasMandatoryOptions(ctx.ATTRIBUTES(), ctx, "ATTRIBUTES"); + } + checkHasMutuallyExclusiveOptions("LOG or NOLOG or LOGMESSAGE", ctx.LOG(), ctx.NOLOG(), ctx.LOGMESSAGE()); + } +} + diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSEndBrowseOptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSEndBrowseOptionsUtility.java index 9fbab6d678..ced460740e 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSEndBrowseOptionsUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSEndBrowseOptionsUtility.java @@ -26,29 +26,24 @@ import java.util.List; import java.util.Map; -import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_endbr; import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_endbrowse; +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_endbrowse_opts; /** Checks CICS Extract rules for required and invalid options */ public class CICSEndBrowseOptionsUtility extends CICSOptionsCheckBaseUtility { - public static final int RULE_ENDBROWSE_INDEX = RULE_cics_endbrowse; - public static final int RULE_ENDBR_INDEX = RULE_cics_endbr; + public static final int RULE_INDEX = RULE_cics_endbrowse; private static final Map DUPLICATE_CHECK_OPTIONS = new HashMap() { { - put(CICSLexer.ENDBR, ErrorSeverity.ERROR); - put(CICSLexer.FILE, ErrorSeverity.ERROR); - put(CICSLexer.REQID, ErrorSeverity.ERROR); - put(CICSLexer.SYSID, ErrorSeverity.ERROR); - put(CICSLexer.ENDBROWSE, ErrorSeverity.ERROR); put(CICSLexer.ACTIVITY, ErrorSeverity.WARNING); put(CICSLexer.BROWSETOKEN, ErrorSeverity.ERROR); put(CICSLexer.CONTAINER, ErrorSeverity.WARNING); put(CICSLexer.EVENT, ErrorSeverity.WARNING); put(CICSLexer.PROCESS, ErrorSeverity.WARNING); put(CICSLexer.TIMER, ErrorSeverity.WARNING); + put(CICSLexer.RETCODE, ErrorSeverity.ERROR); } }; @@ -63,32 +58,21 @@ public CICSEndBrowseOptionsUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - switch (ctx.getParent().getRuleIndex()) { - case CICSParser.RULE_cics_endbr: - checkEndbr((CICSParser.Cics_endbrContext) ctx.getParent()); - break; - case CICSParser.RULE_cics_endbrowse: - checkEndBrowse((CICSParser.Cics_endbrowseContext) ctx.getParent()); - break; - default: - break; - } - checkDuplicates(ctx.getParent()); + if (ctx.getRuleIndex() == RULE_cics_endbrowse_opts) { + checkEndBrowse((CICSParser.Cics_endbrowse_optsContext) ctx); + } + checkDuplicates(ctx); } @SuppressWarnings("unchecked") - private void checkEndbr(CICSParser.Cics_endbrContext ctx) { - checkHasExactlyOneOption("FILE or DATASET", ctx, ctx.FILE(), ctx.DATASET()); - } - - @SuppressWarnings("unchecked") - private void checkEndBrowse(CICSParser.Cics_endbrowseContext ctx) { + private void checkEndBrowse(CICSParser.Cics_endbrowse_optsContext ctx) { checkHasExactlyOneOption("ACTIVITY or CONTAINER or EVENT or PROCESS or TIMER", ctx, ctx.ACTIVITY(), ctx.CONTAINER(), ctx.EVENT(), ctx.PROCESS(), ctx.TIMER()); checkHasMandatoryOptions(ctx.BROWSETOKEN(), ctx, "BROWSETOKEN"); - if (!ctx.CONTAINER().isEmpty()) { - checkHasMandatoryOptions(ctx.RETCODE(), ctx, "RETCODE"); - } +// TODO: https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/pull/2596 (RETCODE is only mandatory in the EXCI mode.) +// if (!ctx.CONTAINER().isEmpty()) { +// checkHasMandatoryOptions(ctx.RETCODE(), ctx, "RETCODE"); +// } } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSEndbrOptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSEndbrOptionsUtility.java new file mode 100644 index 0000000000..ae42087aed --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSEndbrOptionsUtility.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_endbr; +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_endbr_opts; + +/** Checks CICS Extract rules for required and invalid options */ +public class CICSEndbrOptionsUtility extends CICSOptionsCheckBaseUtility { + + public static final int RULE_INDEX = RULE_cics_endbr; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.FILE, ErrorSeverity.ERROR); + put(CICSLexer.DATASET, ErrorSeverity.ERROR); + put(CICSLexer.REQID, ErrorSeverity.ERROR); + put(CICSLexer.SYSID, ErrorSeverity.ERROR); + } + }; + + public CICSEndbrOptionsUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS Extract rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + if (ctx.getRuleIndex() == RULE_cics_endbr_opts) { + checkEndbr((CICSParser.Cics_endbr_optsContext) ctx); + } + checkDuplicates(ctx); + } + + @SuppressWarnings("unchecked") + private void checkEndbr(CICSParser.Cics_endbr_optsContext ctx) { + checkHasExactlyOneOption("FILE or DATASET", ctx, ctx.FILE(), ctx.DATASET()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSExtractSPOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSExtractSPOptionsCheckUtility.java new file mode 100644 index 0000000000..d2cbd607fe --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSExtractSPOptionsCheckUtility.java @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.tree.TerminalNode; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** Checks CICS Extract System Command rules for required and invalid options */ +public class CICSExtractSPOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + + public static final int RULE_INDEX = CICSParser.RULE_cics_extract_system_programming; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.EXIT, ErrorSeverity.WARNING); + put(CICSLexer.PROGRAM, ErrorSeverity.ERROR); + put(CICSLexer.ENTRYNAME, ErrorSeverity.ERROR); + put(CICSLexer.GALENGTH, ErrorSeverity.ERROR); + put(CICSLexer.GASET, ErrorSeverity.ERROR); + put(CICSLexer.STATISTICS, ErrorSeverity.WARNING); + put(CICSLexer.RESTYPE, ErrorSeverity.ERROR); + put(CICSLexer.RESID, ErrorSeverity.ERROR); + put(CICSLexer.RESIDLEN, ErrorSeverity.ERROR); + put(CICSLexer.SET, ErrorSeverity.ERROR); + put(CICSLexer.SUBRESTYPE, ErrorSeverity.ERROR); + put(CICSLexer.SUBRESID, ErrorSeverity.ERROR); + put(CICSLexer.SUBRESIDLEN, ErrorSeverity.ERROR); + put(CICSLexer.APPLICATION, ErrorSeverity.ERROR); + put(CICSLexer.APPLMAJORVER, ErrorSeverity.ERROR); + put(CICSLexer.APPLMINORVER, ErrorSeverity.ERROR); + put(CICSLexer.APPLMICROVER, ErrorSeverity.ERROR); + put(CICSLexer.PLATFORM, ErrorSeverity.ERROR); + put(CICSLexer.LASTRESET, ErrorSeverity.ERROR); + put(CICSLexer.LASTRESETABS, ErrorSeverity.ERROR); + put(CICSLexer.LASTRESETHRS, ErrorSeverity.ERROR); + put(CICSLexer.LASTRESETMIN, ErrorSeverity.ERROR); + put(CICSLexer.LASTRESETSEC, ErrorSeverity.ERROR); + //RESTYPE options// + put(CICSLexer.ASYNCSERVICE, ErrorSeverity.WARNING); + put(CICSLexer.ATOMSERVICE, ErrorSeverity.WARNING); + put(CICSLexer.BUNDLE, ErrorSeverity.WARNING); + put(CICSLexer.DB2CONN, ErrorSeverity.WARNING); + put(CICSLexer.DB2ENTRY, ErrorSeverity.WARNING); + put(CICSLexer.DISPATCHER, ErrorSeverity.WARNING); + put(CICSLexer.DOCTEMPLATE, ErrorSeverity.WARNING); + put(CICSLexer.EPADAPTER, ErrorSeverity.WARNING); + put(CICSLexer.ENQUEUE, ErrorSeverity.WARNING); + put(CICSLexer.EVENTBINDING, ErrorSeverity.WARNING); + put(CICSLexer.EVENTPROCESS, ErrorSeverity.WARNING); + put(CICSLexer.FILE, ErrorSeverity.WARNING); + put(CICSLexer.IPCONN, ErrorSeverity.WARNING); + put(CICSLexer.JOURNALNAME, ErrorSeverity.WARNING); + put(CICSLexer.JVMPROGRAM, ErrorSeverity.WARNING); + put(CICSLexer.JVMSERVER, ErrorSeverity.WARNING); + put(CICSLexer.LIBRARY, ErrorSeverity.WARNING); + put(CICSLexer.LSRPOOL, ErrorSeverity.WARNING); + put(CICSLexer.MONITOR, ErrorSeverity.WARNING); + put(CICSLexer.MQCONN, ErrorSeverity.WARNING); + put(CICSLexer.MQMONITOR, ErrorSeverity.WARNING); + put(CICSLexer.MVSTCB, ErrorSeverity.WARNING); + put(CICSLexer.NODEJSAPP, ErrorSeverity.WARNING); + put(CICSLexer.PIPELINE, ErrorSeverity.WARNING); + put(CICSLexer.POLICY, ErrorSeverity.WARNING); + put(CICSLexer.PROGAUTO, ErrorSeverity.WARNING); + put(CICSLexer.PROGRAMDEF, ErrorSeverity.WARNING); + put(CICSLexer.RECOVERY, ErrorSeverity.WARNING); + put(CICSLexer.SECURITY, ErrorSeverity.WARNING); + put(CICSLexer.STATS, ErrorSeverity.WARNING); + put(CICSLexer.STORAGE, ErrorSeverity.WARNING); + put(CICSLexer.STREAMNAME, ErrorSeverity.WARNING); + put(CICSLexer.SUBPOOL, ErrorSeverity.WARNING); + put(CICSLexer.SYSDUMPCODE, ErrorSeverity.WARNING); + put(CICSLexer.TASKSUBPOOL, ErrorSeverity.WARNING); + put(CICSLexer.TCPIP, ErrorSeverity.WARNING); + put(CICSLexer.TCPIPSERVICE, ErrorSeverity.WARNING); + put(CICSLexer.TDQUEUE, ErrorSeverity.WARNING); + put(CICSLexer.TRANCLASS, ErrorSeverity.WARNING); + put(CICSLexer.TRANDUMPCODE, ErrorSeverity.WARNING); + put(CICSLexer.TRANSACTION, ErrorSeverity.WARNING); + put(CICSLexer.TSQUEUE, ErrorSeverity.WARNING); + put(CICSLexer.URIMAP, ErrorSeverity.WARNING); + put(CICSLexer.USER, ErrorSeverity.WARNING); + put(CICSLexer.WEBSERVICE, ErrorSeverity.WARNING); + put(CICSLexer.XMLTRANSFORM, ErrorSeverity.WARNING); + } + }; + + public CICSExtractSPOptionsCheckUtility( + DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS Extract System Command rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + switch (ctx.getRuleIndex()) { + case CICSParser.RULE_cics_extract_exit: + checkExtractExit((CICSParser.Cics_extract_exitContext) ctx); + break; + case CICSParser.RULE_cics_extract_statistics: + checkExtractStatistics((CICSParser.Cics_extract_statisticsContext) ctx); + break; + default: + break; + } + checkDuplicates(ctx); + } + + private void checkExtractExit(CICSParser.Cics_extract_exitContext ctx) { + checkHasMandatoryOptions(ctx.EXIT(), ctx, "EXIT"); + checkHasMandatoryOptions(ctx.GALENGTH(), ctx, "GALENGTH"); + checkHasMandatoryOptions(ctx.GASET(), ctx, "GASET"); + checkHasMandatoryOptions(ctx.PROGRAM(), ctx, "PROGRAM"); + } + + private void checkExtractStatistics(CICSParser.Cics_extract_statisticsContext ctx) { + checkHasMandatoryOptions(ctx.STATISTICS(), ctx, "STATISTICS"); + checkRestypeOptions(ctx); + checkHasMandatoryOptions(ctx.SET(), ctx, "SET"); + if (ctx.RESID().isEmpty()) { + checkForResidRequiredOptions(ctx); + } else { + checkAllOptionsArePresentOrAbsent("APPLICATION, APPLMAJORVER, APPLMINORVER, APPLMICROVER, PLATFORM", ctx, ctx.APPLICATION(), ctx.APPLMAJORVER(), ctx.APPLMINORVER(), ctx.APPLMICROVER(), ctx.PLATFORM()); + } + checkSubResidOptions(ctx); + checkLastTimeOptions(ctx); + } + + /** + * Helper function to enforce mututally exclusive RESTYPE options + * @param ctx + */ + private void checkRestypeOptions(CICSParser.Cics_extract_statisticsContext ctx) { + List restypes = ctx.cics_restype(); + checkHasMandatoryOptions(restypes, ctx, "RESTYPE"); + long distinctOptions = restypes.stream() + .map(node -> (TerminalNode) node.getChild(0)) + .map(TerminalNode::getSymbol) + .map(Token::getType) + .distinct().count(); + + if (distinctOptions > 1) { + restypes.forEach( + node -> throwException(ErrorSeverity.ERROR, getLocality(node), "Multiple RESTYPE options are not allowed", "") + ); + } + } + + private void checkForResidRequiredOptions(CICSParser.Cics_extract_statisticsContext ctx) { + checkHasIllegalOptions(ctx.RESIDLEN(), "RESIDLEN without RESID"); + checkHasIllegalOptions(ctx.APPLICATION(), "APPLICATION without RESID"); + checkHasIllegalOptions(ctx.APPLMAJORVER(), "APPLMAJORVER without RESID"); + checkHasIllegalOptions(ctx.APPLMINORVER(), "APPLMINORVER without RESID"); + checkHasIllegalOptions(ctx.APPLMICROVER(), "APPLMICROVER without RESID"); + checkHasIllegalOptions(ctx.PLATFORM(), "PLATFORM without RESID"); + } + + private void checkSubResidOptions(CICSParser.Cics_extract_statisticsContext ctx) { + List subrestypes = ctx.cics_subrestype(); + if (ctx.SUBRESID().isEmpty()) { + checkHasIllegalOptions(ctx.SUBRESIDLEN(), "SUBRESIDLEN without SUBRESID"); + checkHasIllegalOptions(subrestypes, "SUBRESTYPE without SUBRESID"); + } + List subrestype = subrestypes.stream().map(CICSParser.Cics_subrestypeContext::SUBRESTYPE).collect(Collectors.toList()); + List capturespec = subrestypes.stream().map(CICSParser.Cics_subrestypeContext::CAPTURESPEC).collect(Collectors.toList()); + List policyrule = subrestypes.stream().map(CICSParser.Cics_subrestypeContext::POLICYRULE).collect(Collectors.toList()); + + checkHasMutuallyExclusiveOptions("SUBRESTYPE or CAPTURESPEC or POLICYRULE", subrestype, capturespec, policyrule); + + if (subrestypes.isEmpty()) { + checkHasIllegalOptions(ctx.SUBRESID(), "SUBRESID without SUBRESTYPE"); + checkHasIllegalOptions(ctx.SUBRESIDLEN(), "SUBRESIDLEN without SUBRESTYPE"); + } + } + + private void checkLastTimeOptions(CICSParser.Cics_extract_statisticsContext ctx) { + if (!ctx.LASTRESET().isEmpty()) { + checkHasIllegalOptions(ctx.LASTRESETABS(), "LASTRESETABS with LASTRESET"); + checkHasIllegalOptions(ctx.LASTRESETHRS(), "LASTRESETHRS with LASTRESET"); + checkHasIllegalOptions(ctx.LASTRESETMIN(), "LASTRESETMIN with LASTRESET"); + checkHasIllegalOptions(ctx.LASTRESETSEC(), "LASTRESETSEC with LASTRESET"); + } + if (!ctx.LASTRESETABS().isEmpty()) { + checkHasIllegalOptions(ctx.LASTRESET(), "LASTRESET with LASTRESETABS"); + checkHasIllegalOptions(ctx.LASTRESETHRS(), "LASTRESETHRS with LASTRESETABS"); + checkHasIllegalOptions(ctx.LASTRESETMIN(), "LASTRESETMIN with LASTRESETABS"); + checkHasIllegalOptions(ctx.LASTRESETSEC(), "LASTRESETSEC with LASTRESETABS"); + } + checkAllOptionsArePresentOrAbsent("LASTRESETHRS, LASTRESETMIN, LASTRESETSEC", ctx, ctx.LASTRESETHRS(), ctx.LASTRESETMIN(), ctx.LASTRESETSEC()); + } + +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMain64OptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMain64OptionsUtility.java index 5d1986d3c3..9451b13c45 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMain64OptionsUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMain64OptionsUtility.java @@ -58,14 +58,14 @@ public CICSGetMain64OptionsUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_getmain64) { - checkGetMain((CICSParser.Cics_getmain64Context) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_getmain64_body) { + checkGetMain((CICSParser.Cics_getmain64_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } @SuppressWarnings("unchecked") - private void checkGetMain(CICSParser.Cics_getmain64Context ctx) { + private void checkGetMain(CICSParser.Cics_getmain64_bodyContext ctx) { checkHasMandatoryOptions(ctx.SET(), ctx, "SET"); checkHasMandatoryOptions(ctx.FLENGTH(), ctx, "FLENGTH"); if (ctx.LOCATION().isEmpty()) checkHasIllegalOptions(ctx.EXECUTABLE(), "EXECUTABLE without LOCATION"); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMainOptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMainOptionsUtility.java index e68b159577..addc26c828 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMainOptionsUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSGetMainOptionsUtility.java @@ -59,14 +59,14 @@ public CICSGetMainOptionsUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_getmain) { - checkGetMain((CICSParser.Cics_getmainContext) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_getmain_body) { + checkGetMain((CICSParser.Cics_getmain_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } @SuppressWarnings("unchecked") - private void checkGetMain(CICSParser.Cics_getmainContext ctx) { + private void checkGetMain(CICSParser.Cics_getmain_bodyContext ctx) { checkHasMandatoryOptions(ctx.SET(), ctx, "SET"); checkHasExactlyOneOption("FLENGTH or LENGTH", ctx, ctx.FLENGTH(), ctx.LENGTH()); if (ctx.FLENGTH().isEmpty()) checkHasIllegalOptions(ctx.BELOW(), "BELOW without FLENGTH"); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java new file mode 100644 index 0000000000..86bcc29e7d --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.TerminalNode; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_handle; + +/** Checks CICS HANDLE rules for required and invalid options */ +public class CICSHandleOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_handle; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.CONDITION, ErrorSeverity.WARNING); + put(CICSLexer.ABEND, ErrorSeverity.ERROR); + put(CICSLexer.CANCEL, ErrorSeverity.WARNING); + put(CICSLexer.PROGRAM, ErrorSeverity.ERROR); + put(CICSLexer.LABEL, ErrorSeverity.ERROR); + put(CICSLexer.RESET, ErrorSeverity.WARNING); + put(CICSLexer.AID, ErrorSeverity.WARNING); + put(CICSLexer.ANYKEY, ErrorSeverity.ERROR); + put(CICSLexer.CLEAR, ErrorSeverity.ERROR); + put(CICSLexer.CLRPARTN, ErrorSeverity.ERROR); + put(CICSLexer.ENTER, ErrorSeverity.ERROR); + put(CICSLexer.LIGHTPEN, ErrorSeverity.ERROR); + put(CICSLexer.OPERID, ErrorSeverity.ERROR); + put(CICSLexer.PA1, ErrorSeverity.ERROR); + put(CICSLexer.PA2, ErrorSeverity.ERROR); + put(CICSLexer.PA3, ErrorSeverity.ERROR); + put(CICSLexer.PF1, ErrorSeverity.ERROR); + put(CICSLexer.PF2, ErrorSeverity.ERROR); + put(CICSLexer.PF3, ErrorSeverity.ERROR); + put(CICSLexer.PF4, ErrorSeverity.ERROR); + put(CICSLexer.PF5, ErrorSeverity.ERROR); + put(CICSLexer.PF6, ErrorSeverity.ERROR); + put(CICSLexer.PF7, ErrorSeverity.ERROR); + put(CICSLexer.PF8, ErrorSeverity.ERROR); + put(CICSLexer.PF9, ErrorSeverity.ERROR); + put(CICSLexer.PF10, ErrorSeverity.ERROR); + put(CICSLexer.PF11, ErrorSeverity.ERROR); + put(CICSLexer.PF12, ErrorSeverity.ERROR); + put(CICSLexer.PF13, ErrorSeverity.ERROR); + put(CICSLexer.PF14, ErrorSeverity.ERROR); + put(CICSLexer.PF15, ErrorSeverity.ERROR); + put(CICSLexer.PF16, ErrorSeverity.ERROR); + put(CICSLexer.PF17, ErrorSeverity.ERROR); + put(CICSLexer.PF18, ErrorSeverity.ERROR); + put(CICSLexer.PF19, ErrorSeverity.ERROR); + put(CICSLexer.PF20, ErrorSeverity.ERROR); + put(CICSLexer.PF21, ErrorSeverity.ERROR); + put(CICSLexer.PF22, ErrorSeverity.ERROR); + put(CICSLexer.PF23, ErrorSeverity.ERROR); + put(CICSLexer.PF24, ErrorSeverity.ERROR); + put(CICSLexer.TRIGGER, ErrorSeverity.ERROR); + put(CICSLexer.NORMAL, ErrorSeverity.ERROR); + put(CICSLexer.ERROR, ErrorSeverity.ERROR); + put(CICSLexer.RDATT, ErrorSeverity.ERROR); + put(CICSLexer.WRBRK, ErrorSeverity.ERROR); + put(CICSLexer.EOF, ErrorSeverity.ERROR); + put(CICSLexer.EODS, ErrorSeverity.ERROR); + put(CICSLexer.EOC, ErrorSeverity.ERROR); + put(CICSLexer.INBFMH, ErrorSeverity.ERROR); + put(CICSLexer.ENDINPT, ErrorSeverity.ERROR); + put(CICSLexer.NONVAL, ErrorSeverity.ERROR); + put(CICSLexer.NOSTART, ErrorSeverity.ERROR); + put(CICSLexer.TERMIDERR, ErrorSeverity.ERROR); + put(CICSLexer.FILENOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.NOTFND, ErrorSeverity.ERROR); + put(CICSLexer.DUPREC, ErrorSeverity.ERROR); + put(CICSLexer.DUPKEY, ErrorSeverity.ERROR); + put(CICSLexer.INVREQ, ErrorSeverity.ERROR); + put(CICSLexer.IOERR, ErrorSeverity.ERROR); + put(CICSLexer.NOSPACE, ErrorSeverity.ERROR); + put(CICSLexer.NOTOPEN, ErrorSeverity.ERROR); + put(CICSLexer.ENDFILE, ErrorSeverity.ERROR); + put(CICSLexer.ILLOGIC, ErrorSeverity.ERROR); + put(CICSLexer.LENGERR, ErrorSeverity.ERROR); + put(CICSLexer.QZERO, ErrorSeverity.ERROR); + put(CICSLexer.SIGNAL, ErrorSeverity.ERROR); + put(CICSLexer.QBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ITEMERR, ErrorSeverity.ERROR); + put(CICSLexer.PGMIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TRANSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.ENDDATA, ErrorSeverity.ERROR); + put(CICSLexer.INVTSREQ, ErrorSeverity.ERROR); + put(CICSLexer.EXPIRED, ErrorSeverity.ERROR); + put(CICSLexer.RETPAGE, ErrorSeverity.ERROR); + put(CICSLexer.RTEFAIL, ErrorSeverity.ERROR); + put(CICSLexer.RTESOME, ErrorSeverity.ERROR); + put(CICSLexer.TSIOERR, ErrorSeverity.ERROR); + put(CICSLexer.MAPFAIL, ErrorSeverity.ERROR); + put(CICSLexer.INVERRTERM, ErrorSeverity.ERROR); + put(CICSLexer.INVMPSZ, ErrorSeverity.ERROR); + put(CICSLexer.IGREQID, ErrorSeverity.ERROR); + put(CICSLexer.OVERFLOW, ErrorSeverity.ERROR); + put(CICSLexer.INVLDC, ErrorSeverity.ERROR); + put(CICSLexer.NOSTG, ErrorSeverity.ERROR); + put(CICSLexer.JIDERR, ErrorSeverity.ERROR); + put(CICSLexer.QIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOJBUFSP, ErrorSeverity.ERROR); + put(CICSLexer.DSSTAT, ErrorSeverity.ERROR); + put(CICSLexer.SELNERR, ErrorSeverity.ERROR); + put(CICSLexer.FUNCERR, ErrorSeverity.ERROR); + put(CICSLexer.UNEXPIN, ErrorSeverity.ERROR); + put(CICSLexer.NOPASSBKRD, ErrorSeverity.ERROR); + put(CICSLexer.NOPASSBKWR, ErrorSeverity.ERROR); + put(CICSLexer.SEGIDERR, ErrorSeverity.ERROR); + put(CICSLexer.SYSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.ISCINVREQ, ErrorSeverity.ERROR); + put(CICSLexer.ENQBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ENVDEFERR, ErrorSeverity.ERROR); + put(CICSLexer.IGREQCD, ErrorSeverity.ERROR); + put(CICSLexer.SESSIONERR, ErrorSeverity.ERROR); + put(CICSLexer.SYSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.SESSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.NOTALLOC, ErrorSeverity.ERROR); + put(CICSLexer.CBIDERR, ErrorSeverity.ERROR); + put(CICSLexer.INVEXITREQ, ErrorSeverity.ERROR); + put(CICSLexer.INVPARTNSET, ErrorSeverity.ERROR); + put(CICSLexer.INVPARTN, ErrorSeverity.ERROR); + put(CICSLexer.PARTNFAIL, ErrorSeverity.ERROR); + put(CICSLexer.USERIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTAUTH, ErrorSeverity.ERROR); + put(CICSLexer.VOLIDERR, ErrorSeverity.ERROR); + put(CICSLexer.SUPPRESSED, ErrorSeverity.ERROR); + put(CICSLexer.RESIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOSPOOL, ErrorSeverity.ERROR); + put(CICSLexer.TERMERR, ErrorSeverity.ERROR); + put(CICSLexer.ROLLEDBACK, ErrorSeverity.ERROR); + put(CICSLexer.END, ErrorSeverity.ERROR); + put(CICSLexer.DISABLED, ErrorSeverity.ERROR); + put(CICSLexer.ALLOCERR, ErrorSeverity.ERROR); + put(CICSLexer.STRELERR, ErrorSeverity.ERROR); + put(CICSLexer.OPENERR, ErrorSeverity.ERROR); + put(CICSLexer.SPOLBUSY, ErrorSeverity.ERROR); + put(CICSLexer.SPOLERR, ErrorSeverity.ERROR); + put(CICSLexer.NODEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TASKIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TCIDERR, ErrorSeverity.ERROR); + put(CICSLexer.DSNNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.LOADING, ErrorSeverity.ERROR); + put(CICSLexer.MODELIDERR, ErrorSeverity.ERROR); + put(CICSLexer.OUTDESCRERR, ErrorSeverity.ERROR); + put(CICSLexer.PARTNERIDERR, ErrorSeverity.ERROR); + put(CICSLexer.PROFILEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NETNAMEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.LOCKED, ErrorSeverity.ERROR); + put(CICSLexer.RECORDBUSY, ErrorSeverity.ERROR); + put(CICSLexer.UOWNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.UOWLNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.LINKABEND, ErrorSeverity.ERROR); + put(CICSLexer.CHANGED, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITYBUSY, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSERR, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITYERR, ErrorSeverity.ERROR); + put(CICSLexer.CONTAINERERR, ErrorSeverity.ERROR); + put(CICSLexer.EVENTERR, ErrorSeverity.ERROR); + put(CICSLexer.TOKENERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTFINISHED, ErrorSeverity.ERROR); + put(CICSLexer.POOLERR, ErrorSeverity.ERROR); + put(CICSLexer.TIMERERR, ErrorSeverity.ERROR); + put(CICSLexer.SYMBOLERR, ErrorSeverity.ERROR); + put(CICSLexer.TEMPLATERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTSUPERUSER, ErrorSeverity.ERROR); + put(CICSLexer.CSDERR, ErrorSeverity.ERROR); + put(CICSLexer.DUPRES, ErrorSeverity.ERROR); + put(CICSLexer.RESUNAVAIL, ErrorSeverity.ERROR); + put(CICSLexer.CHANNELERR, ErrorSeverity.ERROR); + put(CICSLexer.CCSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TIMEDOUT, ErrorSeverity.ERROR); + put(CICSLexer.CODEPAGEERR, ErrorSeverity.ERROR); + put(CICSLexer.INCOMPLETE, ErrorSeverity.ERROR); + put(CICSLexer.APPNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.BUSY, ErrorSeverity.ERROR); + } + }; + + public CICSHandleOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS Handle rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + switch (ctx.getRuleIndex()) { + case CICSParser.RULE_cics_handle_abend: + checkHandleAbend((CICSParser.Cics_handle_abendContext) ctx); + break; + case CICSParser.RULE_cics_handle_aid: + checkHandleAid((CICSParser.Cics_handle_aidContext) ctx); + break; + case CICSParser.RULE_cics_handle_condition: + checkHandleCondition((CICSParser.Cics_handle_conditionContext) ctx); + break; + default: + break; + } + checkDuplicates(ctx); + } + + @SuppressWarnings("unchecked") + private void checkHandleAbend(CICSParser.Cics_handle_abendContext ctx) { + checkHasMandatoryOptions(ctx.ABEND(), ctx, "ABEND"); + checkHasMutuallyExclusiveOptions("CANCEL or PROGRAM or LABEL or RESET", ctx.CANCEL(), ctx.PROGRAM(), ctx.LABEL(), ctx.RESET()); + } + + private void checkHandleAid(CICSParser.Cics_handle_aidContext ctx) { + checkHasMandatoryOptions(ctx.AID(), ctx, "AID"); + checkHasTooManyOptions(ctx); + } + + private void checkHandleCondition(CICSParser.Cics_handle_conditionContext ctx) { + checkHasMandatoryOptions(ctx.CONDITION(), ctx, "CONDITION"); + } + + private void checkHasTooManyOptions(ParserRuleContext parentCtx) { + if (parentCtx.children == null) + return; + long commandOptionsCount = parentCtx.children.stream() + .filter(node -> node instanceof TerminalNode) + .map(TerminalNode.class::cast) + .filter(node -> node.getSymbol().getType() != CICSLexer.AID) + .count(); + if (commandOptionsCount > 16) { + throwException(ErrorSeverity.ERROR, getLocality(parentCtx), "Too many options provided for: ", "HANDLE AID"); + } + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSIgnoreOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSIgnoreOptionsCheckUtility.java new file mode 100644 index 0000000000..1221fdf425 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSIgnoreOptionsCheckUtility.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_ignore; + +/** Checks CICS IGNORE CONDITION rules for required and invalid options */ +public class CICSIgnoreOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_ignore; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.CONDITION, ErrorSeverity.WARNING); + put(CICSLexer.NORMAL, ErrorSeverity.ERROR); + put(CICSLexer.ERROR, ErrorSeverity.ERROR); + put(CICSLexer.RDATT, ErrorSeverity.ERROR); + put(CICSLexer.WRBRK, ErrorSeverity.ERROR); + put(CICSLexer.EOF, ErrorSeverity.ERROR); + put(CICSLexer.EODS, ErrorSeverity.ERROR); + put(CICSLexer.EOC, ErrorSeverity.ERROR); + put(CICSLexer.INBFMH, ErrorSeverity.ERROR); + put(CICSLexer.ENDINPT, ErrorSeverity.ERROR); + put(CICSLexer.NONVAL, ErrorSeverity.ERROR); + put(CICSLexer.NOSTART, ErrorSeverity.ERROR); + put(CICSLexer.TERMIDERR, ErrorSeverity.ERROR); + put(CICSLexer.FILENOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.NOTFND, ErrorSeverity.ERROR); + put(CICSLexer.DUPREC, ErrorSeverity.ERROR); + put(CICSLexer.DUPKEY, ErrorSeverity.ERROR); + put(CICSLexer.INVREQ, ErrorSeverity.ERROR); + put(CICSLexer.IOERR, ErrorSeverity.ERROR); + put(CICSLexer.NOSPACE, ErrorSeverity.ERROR); + put(CICSLexer.NOTOPEN, ErrorSeverity.ERROR); + put(CICSLexer.ENDFILE, ErrorSeverity.ERROR); + put(CICSLexer.ILLOGIC, ErrorSeverity.ERROR); + put(CICSLexer.LENGERR, ErrorSeverity.ERROR); + put(CICSLexer.QZERO, ErrorSeverity.ERROR); + put(CICSLexer.SIGNAL, ErrorSeverity.ERROR); + put(CICSLexer.QBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ITEMERR, ErrorSeverity.ERROR); + put(CICSLexer.PGMIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TRANSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.ENDDATA, ErrorSeverity.ERROR); + put(CICSLexer.INVTSREQ, ErrorSeverity.ERROR); + put(CICSLexer.EXPIRED, ErrorSeverity.ERROR); + put(CICSLexer.RETPAGE, ErrorSeverity.ERROR); + put(CICSLexer.RTEFAIL, ErrorSeverity.ERROR); + put(CICSLexer.RTESOME, ErrorSeverity.ERROR); + put(CICSLexer.TSIOERR, ErrorSeverity.ERROR); + put(CICSLexer.MAPFAIL, ErrorSeverity.ERROR); + put(CICSLexer.INVERRTERM, ErrorSeverity.ERROR); + put(CICSLexer.INVMPSZ, ErrorSeverity.ERROR); + put(CICSLexer.IGREQID, ErrorSeverity.ERROR); + put(CICSLexer.OVERFLOW, ErrorSeverity.ERROR); + put(CICSLexer.INVLDC, ErrorSeverity.ERROR); + put(CICSLexer.NOSTG, ErrorSeverity.ERROR); + put(CICSLexer.JIDERR, ErrorSeverity.ERROR); + put(CICSLexer.QIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOJBUFSP, ErrorSeverity.ERROR); + put(CICSLexer.DSSTAT, ErrorSeverity.ERROR); + put(CICSLexer.SELNERR, ErrorSeverity.ERROR); + put(CICSLexer.FUNCERR, ErrorSeverity.ERROR); + put(CICSLexer.UNEXPIN, ErrorSeverity.ERROR); + put(CICSLexer.NOPASSBKRD, ErrorSeverity.ERROR); + put(CICSLexer.NOPASSBKWR, ErrorSeverity.ERROR); + put(CICSLexer.SEGIDERR, ErrorSeverity.ERROR); + put(CICSLexer.SYSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.ISCINVREQ, ErrorSeverity.ERROR); + put(CICSLexer.ENQBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ENVDEFERR, ErrorSeverity.ERROR); + put(CICSLexer.IGREQCD, ErrorSeverity.ERROR); + put(CICSLexer.SESSIONERR, ErrorSeverity.ERROR); + put(CICSLexer.SYSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.SESSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.NOTALLOC, ErrorSeverity.ERROR); + put(CICSLexer.CBIDERR, ErrorSeverity.ERROR); + put(CICSLexer.INVEXITREQ, ErrorSeverity.ERROR); + put(CICSLexer.INVPARTNSET, ErrorSeverity.ERROR); + put(CICSLexer.INVPARTN, ErrorSeverity.ERROR); + put(CICSLexer.PARTNFAIL, ErrorSeverity.ERROR); + put(CICSLexer.USERIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTAUTH, ErrorSeverity.ERROR); + put(CICSLexer.VOLIDERR, ErrorSeverity.ERROR); + put(CICSLexer.SUPPRESSED, ErrorSeverity.ERROR); + put(CICSLexer.RESIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOSPOOL, ErrorSeverity.ERROR); + put(CICSLexer.TERMERR, ErrorSeverity.ERROR); + put(CICSLexer.ROLLEDBACK, ErrorSeverity.ERROR); + put(CICSLexer.END, ErrorSeverity.ERROR); + put(CICSLexer.DISABLED, ErrorSeverity.ERROR); + put(CICSLexer.ALLOCERR, ErrorSeverity.ERROR); + put(CICSLexer.STRELERR, ErrorSeverity.ERROR); + put(CICSLexer.OPENERR, ErrorSeverity.ERROR); + put(CICSLexer.SPOLBUSY, ErrorSeverity.ERROR); + put(CICSLexer.SPOLERR, ErrorSeverity.ERROR); + put(CICSLexer.NODEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TASKIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TCIDERR, ErrorSeverity.ERROR); + put(CICSLexer.DSNNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.LOADING, ErrorSeverity.ERROR); + put(CICSLexer.MODELIDERR, ErrorSeverity.ERROR); + put(CICSLexer.OUTDESCRERR, ErrorSeverity.ERROR); + put(CICSLexer.PARTNERIDERR, ErrorSeverity.ERROR); + put(CICSLexer.PROFILEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NETNAMEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.LOCKED, ErrorSeverity.ERROR); + put(CICSLexer.RECORDBUSY, ErrorSeverity.ERROR); + put(CICSLexer.UOWNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.UOWLNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.LINKABEND, ErrorSeverity.ERROR); + put(CICSLexer.CHANGED, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITYBUSY, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSERR, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITYERR, ErrorSeverity.ERROR); + put(CICSLexer.CONTAINERERR, ErrorSeverity.ERROR); + put(CICSLexer.EVENTERR, ErrorSeverity.ERROR); + put(CICSLexer.TOKENERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTFINISHED, ErrorSeverity.ERROR); + put(CICSLexer.POOLERR, ErrorSeverity.ERROR); + put(CICSLexer.TIMERERR, ErrorSeverity.ERROR); + put(CICSLexer.SYMBOLERR, ErrorSeverity.ERROR); + put(CICSLexer.TEMPLATERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTSUPERUSER, ErrorSeverity.ERROR); + put(CICSLexer.CSDERR, ErrorSeverity.ERROR); + put(CICSLexer.DUPRES, ErrorSeverity.ERROR); + put(CICSLexer.RESUNAVAIL, ErrorSeverity.ERROR); + put(CICSLexer.CHANNELERR, ErrorSeverity.ERROR); + put(CICSLexer.CCSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TIMEDOUT, ErrorSeverity.ERROR); + put(CICSLexer.CODEPAGEERR, ErrorSeverity.ERROR); + put(CICSLexer.INCOMPLETE, ErrorSeverity.ERROR); + put(CICSLexer.APPNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.BUSY, ErrorSeverity.ERROR); + } + }; + + public CICSIgnoreOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS IGNORE CONDITION rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + if (ctx instanceof CICSParser.Cics_ignore_optionsContext) { + checkIgnoreCondition((CICSParser.Cics_ignore_optionsContext) ctx); + } + checkDuplicates(ctx); + } + + private void checkIgnoreCondition(CICSParser.Cics_ignore_optionsContext ctx) { + checkHasMandatoryOptions(ctx.CONDITION(), ctx, "CONDITION"); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireOptionsCheckUtility.java index 07ebc89cd4..47aacaa117 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireOptionsCheckUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireOptionsCheckUtility.java @@ -27,80 +27,69 @@ import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_inquire; -/** Checks CICS Inquire rules for required and invalid options */ +/** + * Checks CICS Inquire rules for required and invalid options + */ public class CICSInquireOptionsCheckUtility extends CICSOptionsCheckBaseUtility { - public static final int RULE_INDEX = RULE_cics_inquire; + public static final int RULE_INDEX = RULE_cics_inquire; - private static final Map DUPLICATE_CHECK_OPTIONS = - new HashMap() { - { - put(CICSLexer.ABCODE, ErrorSeverity.ERROR); - put(CICSLexer.ABPROGRAM, ErrorSeverity.ERROR); - put(CICSLexer.ABSTIME, ErrorSeverity.ERROR); - put(CICSLexer.ACTIVITY, ErrorSeverity.ERROR); - put(CICSLexer.ACTIVITYID, ErrorSeverity.ERROR); - put(CICSLexer.COMPOSITE, ErrorSeverity.ERROR); - put(CICSLexer.COMPSTATUS, ErrorSeverity.ERROR); - put(CICSLexer.CONTAINER, ErrorSeverity.ERROR); - put(CICSLexer.DATALENTH, ErrorSeverity.ERROR); - put(CICSLexer.EVENT, ErrorSeverity.ERROR); - put(CICSLexer.EVENTTYPE, ErrorSeverity.ERROR); - put(CICSLexer.FIRESTATUS, ErrorSeverity.ERROR); - put(CICSLexer.MODE, ErrorSeverity.ERROR); - put(CICSLexer.PREDICATE, ErrorSeverity.ERROR); - put(CICSLexer.PROCESS, ErrorSeverity.ERROR); - put(CICSLexer.PROCESSTYPE, ErrorSeverity.ERROR); - put(CICSLexer.PROGRAM, ErrorSeverity.ERROR); - put(CICSLexer.SET, ErrorSeverity.ERROR); - put(CICSLexer.SUSPSTATUS, ErrorSeverity.ERROR); - put(CICSLexer.TIMER, ErrorSeverity.ERROR); - put(CICSLexer.TRANSID, ErrorSeverity.ERROR); - put(CICSLexer.USERID, ErrorSeverity.ERROR); - } - }; + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.ABCODE, ErrorSeverity.ERROR); + put(CICSLexer.ABPROGRAM, ErrorSeverity.ERROR); + put(CICSLexer.ABSTIME, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITY, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITYID, ErrorSeverity.ERROR); + put(CICSLexer.COMPOSITE, ErrorSeverity.ERROR); + put(CICSLexer.COMPSTATUS, ErrorSeverity.ERROR); + put(CICSLexer.CONTAINER, ErrorSeverity.ERROR); + put(CICSLexer.DATALENGTH, ErrorSeverity.ERROR); + put(CICSLexer.EVENT, ErrorSeverity.ERROR); + put(CICSLexer.EVENTTYPE, ErrorSeverity.ERROR); + put(CICSLexer.FIRESTATUS, ErrorSeverity.ERROR); + put(CICSLexer.MODE, ErrorSeverity.ERROR); + put(CICSLexer.PREDICATE, ErrorSeverity.ERROR); + put(CICSLexer.PROCESS, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSTYPE, ErrorSeverity.ERROR); + put(CICSLexer.PROGRAM, ErrorSeverity.ERROR); + put(CICSLexer.SET, ErrorSeverity.ERROR); + put(CICSLexer.SUSPSTATUS, ErrorSeverity.ERROR); + put(CICSLexer.TIMER, ErrorSeverity.ERROR); + put(CICSLexer.TRANSID, ErrorSeverity.ERROR); + put(CICSLexer.USERID, ErrorSeverity.ERROR); + } + }; - public CICSInquireOptionsCheckUtility( - DialectProcessingContext context, List errors) { - super(context, errors, DUPLICATE_CHECK_OPTIONS); - } + public CICSInquireOptionsCheckUtility( + DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } - /** - * Entrypoint to check CICS Inquire rule options - * - * @param ctx ParserRuleContext subclass containing options - * @param A subclass of ParserRuleContext - */ - public void checkOptions(E ctx) { - switch (ctx.getRuleIndex()) { - case CICSParser.RULE_cics_inquire_activityid: - checkHasMandatoryOptions( - ((CICSParser.Cics_inquire_activityidContext) ctx).ACTIVITYID(), ctx, "ACTIVITYID"); - break; - case CICSParser.RULE_cics_inquire_container: - CICSParser.Cics_inquire_containerContext containerContext = - (CICSParser.Cics_inquire_containerContext) ctx; - checkHasMandatoryOptions(containerContext.CONTAINER(), ctx, "CONTAINER"); - checkHasMutuallyExclusiveOptions( - "ACTIVITYID and PROCESS", containerContext.ACTIVITYID(), containerContext.PROCESS()); - if (containerContext.PROCESS().isEmpty()) - checkHasIllegalOptions(containerContext.PROCESSTYPE(), "PROCESSTYPE without PROCESS"); - break; - case CICSParser.RULE_cics_inquire_event: - checkHasMandatoryOptions( - ((CICSParser.Cics_inquire_eventContext) ctx).EVENT(), ctx, "EVENT"); - break; - case CICSParser.RULE_cics_inquire_process: - CICSParser.Cics_inquire_processContext processContext = - (CICSParser.Cics_inquire_processContext) ctx; - checkHasMandatoryOptions(processContext.PROCESSTYPE(), ctx, "PROCESSTYPE"); - break; - case CICSParser.RULE_cics_inquire_timer: - checkHasMandatoryOptions( - ((CICSParser.Cics_inquire_timerContext) ctx).TIMER(), ctx, "TIMER"); - break; - default: - break; + /** + * Entrypoint to check CICS Inquire rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + switch (ctx.getRuleIndex()) { + case CICSParser.RULE_cics_inquire_container: + CICSParser.Cics_inquire_containerContext containerContext = + (CICSParser.Cics_inquire_containerContext) ctx; + checkHasMutuallyExclusiveOptions( + "ACTIVITYID and PROCESS", containerContext.ACTIVITYID(), containerContext.PROCESS()); + if (containerContext.PROCESS().isEmpty()) + checkHasIllegalOptions(containerContext.PROCESSTYPE(), "PROCESSTYPE without PROCESS"); + break; + case CICSParser.RULE_cics_inquire_process: + CICSParser.Cics_inquire_processContext processContext = + (CICSParser.Cics_inquire_processContext) ctx; + checkHasMandatoryOptions(processContext.PROCESSTYPE(), ctx, "PROCESSTYPE"); + break; + default: + break; + } + checkDuplicates(ctx); } - checkDuplicates(ctx); - } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireSPOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireSPOptionsCheckUtility.java index 3944fbf4f3..3af010e373 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireSPOptionsCheckUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSInquireSPOptionsCheckUtility.java @@ -47,6 +47,7 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSParser.RULE_cics_inquire_epadapter, CICSParser.EPADAPTER); put(CICSParser.RULE_cics_inquire_epadapterset, CICSParser.EPADAPTERSET); put(CICSParser.RULE_cics_inquire_eventbinding, CICSParser.EVENTBINDING); + put(CICSParser.RULE_cics_inquire_exci, CICSParser.EXCI); put(CICSParser.RULE_cics_inquire_file, CICSParser.FILE); put(CICSParser.RULE_cics_inquire_host, CICSParser.HOST); put(CICSParser.RULE_cics_inquire_ipconn, CICSParser.IPCONN); @@ -64,6 +65,7 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSParser.RULE_cics_inquire_secrecording, CICSParser.SECRECORDING); put(CICSParser.RULE_cics_inquire_streamname, CICSParser.STREAMNAME); put(CICSParser.RULE_cics_inquire_sysdumpcode, CICSParser.SYSDUMPCODE); + put(CICSParser.RULE_cics_inquire_tcpipservice, CICSParser.TCPIPSERVICE); put(CICSParser.RULE_cics_inquire_tdqueue, CICSParser.TDQUEUE); put(CICSParser.RULE_cics_inquire_trandumpcode, CICSParser.TRANDUMPCODE); put(CICSParser.RULE_cics_inquire_tsmodel, CICSParser.TSMODEL); @@ -72,6 +74,7 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSParser.RULE_cics_inquire_uowlink, CICSParser.UOWLINK); put(CICSParser.RULE_cics_inquire_urimap, CICSParser.URIMAP); put(CICSParser.RULE_cics_inquire_webservice, CICSParser.WEBSERVICE); + put(CICSParser.RULE_cics_inquire_xmltransform, CICSParser.XMLTRANSFORM); } }; @@ -97,7 +100,7 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSLexer.ADD, ErrorSeverity.ERROR); put(CICSLexer.ADDRESS, ErrorSeverity.ERROR); put(CICSLexer.ADJUSTMENT, ErrorSeverity.ERROR); - put(CICSLexer.ADRESS64, ErrorSeverity.ERROR); + put(CICSLexer.ADDRESS64, ErrorSeverity.ERROR); put(CICSLexer.AGE, ErrorSeverity.ERROR); put(CICSLexer.AIBRIDGE, ErrorSeverity.ERROR); put(CICSLexer.AIDCOUNT, ErrorSeverity.ERROR); @@ -459,7 +462,7 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSLexer.LASTUSEDINT, ErrorSeverity.ERROR); put(CICSLexer.LASTWARMTIME, ErrorSeverity.ERROR); put(CICSLexer.LASTWRITTIME, ErrorSeverity.ERROR); - put(CICSLexer.LATSECDTIME, ErrorSeverity.ERROR); + put(CICSLexer.LASTSECDTIME, ErrorSeverity.ERROR); put(CICSLexer.LENGTH, ErrorSeverity.ERROR); put(CICSLexer.LENGTHLIST, ErrorSeverity.ERROR); put(CICSLexer.LERUNOPTS, ErrorSeverity.ERROR); @@ -557,7 +560,7 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSLexer.NONTERMREL, ErrorSeverity.ERROR); put(CICSLexer.NQNAME, ErrorSeverity.ERROR); put(CICSLexer.NUMCIPHERS, ErrorSeverity.ERROR); - put(CICSLexer.NUMDATAPRD, ErrorSeverity.ERROR); + put(CICSLexer.NUMDATAPRED, ErrorSeverity.ERROR); put(CICSLexer.NUMDSNAMES, ErrorSeverity.ERROR); put(CICSLexer.NUMELEMENTS, ErrorSeverity.ERROR); put(CICSLexer.NUMEXITS, ErrorSeverity.ERROR); @@ -711,7 +714,6 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSLexer.RESRCECLASS, ErrorSeverity.ERROR); put(CICSLexer.RESSEC, ErrorSeverity.ERROR); put(CICSLexer.RESYNCMEMBER, ErrorSeverity.ERROR); - put(CICSLexer.RESYNCNUMBER, ErrorSeverity.ERROR); put(CICSLexer.RESYNCSTATUS, ErrorSeverity.ERROR); put(CICSLexer.RETLOCKS, ErrorSeverity.ERROR); put(CICSLexer.REUSELIMIT, ErrorSeverity.ERROR); @@ -968,6 +970,103 @@ public class CICSInquireSPOptionsCheckUtility extends CICSOptionsCheckBaseUtilit put(CICSLexer.VTAM, ErrorSeverity.WARNING); put(CICSLexer.WEB, ErrorSeverity.WARNING); put(CICSLexer.WLMHEALTH, ErrorSeverity.WARNING); + put(CICSLexer.AP, ErrorSeverity.ERROR); + put(CICSLexer.ASYNCSERVICE, ErrorSeverity.ERROR); + put(CICSLexer.BA, ErrorSeverity.ERROR); + put(CICSLexer.BM, ErrorSeverity.ERROR); + put(CICSLexer.BR, ErrorSeverity.ERROR); + put(CICSLexer.BUSAPPMGR, ErrorSeverity.ERROR); + put(CICSLexer.CP, ErrorSeverity.ERROR); + put(CICSLexer.CPI, ErrorSeverity.ERROR); + put(CICSLexer.DC, ErrorSeverity.ERROR); + put(CICSLexer.DD, ErrorSeverity.ERROR); + put(CICSLexer.DH, ErrorSeverity.ERROR); + put(CICSLexer.DIRMGR, ErrorSeverity.ERROR); + put(CICSLexer.DM, ErrorSeverity.ERROR); + put(CICSLexer.DOMAINMGR, ErrorSeverity.ERROR); + put(CICSLexer.DP, ErrorSeverity.ERROR); + put(CICSLexer.DS, ErrorSeverity.ERROR); + put(CICSLexer.DU, ErrorSeverity.ERROR); + put(CICSLexer.EC, ErrorSeverity.ERROR); + put(CICSLexer.EI, ErrorSeverity.ERROR); + put(CICSLexer.EJ, ErrorSeverity.ERROR); + put(CICSLexer.EM, ErrorSeverity.ERROR); + put(CICSLexer.ENQUEUE, ErrorSeverity.ERROR); + put(CICSLexer.ENTJAVA, ErrorSeverity.ERROR); + put(CICSLexer.EP, ErrorSeverity.ERROR); + put(CICSLexer.EVENTCAPTURE, ErrorSeverity.ERROR); + put(CICSLexer.EVENTMGR, ErrorSeverity.ERROR); + put(CICSLexer.EVENTPROC, ErrorSeverity.ERROR); + put(CICSLexer.FC, ErrorSeverity.ERROR); + put(CICSLexer.GC, ErrorSeverity.ERROR); + put(CICSLexer.GLOBALCATLG, ErrorSeverity.ERROR); + put(CICSLexer.IC, ErrorSeverity.ERROR); + put(CICSLexer.IE, ErrorSeverity.ERROR); + put(CICSLexer.IPECI, ErrorSeverity.ERROR); + put(CICSLexer.IS, ErrorSeverity.ERROR); + put(CICSLexer.KC, ErrorSeverity.ERROR); + put(CICSLexer.KE, ErrorSeverity.ERROR); + put(CICSLexer.KERNEL, ErrorSeverity.ERROR); + put(CICSLexer.LD, ErrorSeverity.ERROR); + put(CICSLexer.LG, ErrorSeverity.ERROR); + put(CICSLexer.LM, ErrorSeverity.ERROR); + put(CICSLexer.LOADER, ErrorSeverity.ERROR); + put(CICSLexer.LOCALCATLG, ErrorSeverity.ERROR); + put(CICSLexer.LOCKMGR, ErrorSeverity.ERROR); + put(CICSLexer.LOGGER, ErrorSeverity.ERROR); + put(CICSLexer.MANAGEDPLAT, ErrorSeverity.ERROR); + put(CICSLexer.ME, ErrorSeverity.ERROR); + put(CICSLexer.ML, ErrorSeverity.ERROR); + put(CICSLexer.MN, ErrorSeverity.ERROR); + put(CICSLexer.MP, ErrorSeverity.ERROR); + put(CICSLexer.NQ, ErrorSeverity.ERROR); + put(CICSLexer.OBJECTTRAN, ErrorSeverity.ERROR); + put(CICSLexer.OT, ErrorSeverity.ERROR); + put(CICSLexer.PA, ErrorSeverity.ERROR); + put(CICSLexer.PARAMGR, ErrorSeverity.ERROR); + put(CICSLexer.PC, ErrorSeverity.ERROR); + put(CICSLexer.PG, ErrorSeverity.ERROR); + put(CICSLexer.PI, ErrorSeverity.ERROR); + put(CICSLexer.PIPEMGR, ErrorSeverity.ERROR); + put(CICSLexer.PROGMGR, ErrorSeverity.ERROR); + put(CICSLexer.PT, ErrorSeverity.ERROR); + put(CICSLexer.RA, ErrorSeverity.ERROR); + put(CICSLexer.RECOVERY, ErrorSeverity.ERROR); + put(CICSLexer.REGIONSTAT, ErrorSeverity.ERROR); + put(CICSLexer.REQUESTSTRM, ErrorSeverity.ERROR); + put(CICSLexer.RESLIFEMGR, ErrorSeverity.ERROR); + put(CICSLexer.RI, ErrorSeverity.ERROR); + put(CICSLexer.RL, ErrorSeverity.ERROR); + put(CICSLexer.RM, ErrorSeverity.ERROR); + put(CICSLexer.RMI, ErrorSeverity.ERROR); + put(CICSLexer.RMIADAPTERS, ErrorSeverity.ERROR); + put(CICSLexer.RRS, ErrorSeverity.ERROR); + put(CICSLexer.RS, ErrorSeverity.ERROR); + put(CICSLexer.RX, ErrorSeverity.ERROR); + put(CICSLexer.RZ, ErrorSeverity.ERROR); + put(CICSLexer.SC, ErrorSeverity.ERROR); + put(CICSLexer.SCHEDULER, ErrorSeverity.ERROR); + put(CICSLexer.SH, ErrorSeverity.ERROR); + put(CICSLexer.SJ, ErrorSeverity.ERROR); + put(CICSLexer.SJVM, ErrorSeverity.ERROR); + put(CICSLexer.SM, ErrorSeverity.ERROR); + put(CICSLexer.SO, ErrorSeverity.ERROR); + put(CICSLexer.SOCKETS, ErrorSeverity.ERROR); + put(CICSLexer.ST, ErrorSeverity.ERROR); + put(CICSLexer.SZ, ErrorSeverity.ERROR); + put(CICSLexer.TC, ErrorSeverity.ERROR); + put(CICSLexer.TI, ErrorSeverity.ERROR); + put(CICSLexer.TR, ErrorSeverity.ERROR); + put(CICSLexer.TRANMGR, ErrorSeverity.ERROR); + put(CICSLexer.UE, ErrorSeverity.ERROR); + put(CICSLexer.US, ErrorSeverity.ERROR); + put(CICSLexer.W2, ErrorSeverity.ERROR); + put(CICSLexer.WB, ErrorSeverity.ERROR); + put(CICSLexer.WEB2, ErrorSeverity.ERROR); + put(CICSLexer.WEBRESTMGR, ErrorSeverity.ERROR); + put(CICSLexer.WU, ErrorSeverity.ERROR); + put(CICSLexer.XM, ErrorSeverity.ERROR); + put(CICSLexer.XS, ErrorSeverity.ERROR); } }; @@ -1015,6 +1114,7 @@ public void checkOptions(E ctx) { bundlepartContext.BUNDLE(), bundlepartContext, "BUNDLE with START"); else checkHasIllegalOptions(bundlepartContext.BUNDLE(), "BUNDLE with END"); checkBrowsingInvalidOptions(bundlepartContext, CICSParser.BUNDLEPART, CICSParser.BUNDLE); + checkBrowsingHasNotParameter(bundlepartContext, CICSParser.BUNDLEPART); } else checkStatementHasParameter(bundlepartContext, CICSParser.BUNDLEPART); break; @@ -1172,12 +1272,14 @@ public void checkOptions(E ctx) { enqContext.START(), enqContext.END(), enqContext.NEXT()); - checkHasMutuallyExclusiveOptions( - "ENQSCOPE or RESOURCE or UOW or END", - enqContext.ENQSCOPE(), - enqContext.RESOURCE(), - enqContext.UOW(), - enqContext.END()); + if (!enqContext.END().isEmpty()) { + checkHasMutuallyExclusiveOptions( + "ENQSCOPE or RESOURCE or UOW with END", + enqContext.ENQSCOPE(), + enqContext.RESOURCE(), + enqContext.UOW(), + enqContext.END()); + } if (!enqContext.START().isEmpty() || !enqContext.END().isEmpty()) { checkBrowsingInvalidOptions( enqContext, @@ -1243,6 +1345,38 @@ public void checkOptions(E ctx) { } break; + case CICSParser.RULE_cics_inquire_statistics: + CICSParser.Cics_inquire_statisticsContext statsContext = (CICSParser.Cics_inquire_statisticsContext) ctx; + + checkHasMutuallyExclusiveOptions("ENDOFDAY or ENDOFDAYHRS", statsContext.ENDOFDAY(), statsContext.ENDOFDAYHRS()); + if (!statsContext.ENDOFDAYHRS().isEmpty()) { + checkHasMandatoryOptions(statsContext.ENDOFDAYMINS(), statsContext, "ENDOFDAYMINS with ENDOFDAYHRS"); + checkHasMandatoryOptions(statsContext.ENDOFDAYSECS(), statsContext, "ENDOFDAYSECS with ENDOFDAYHRS"); + } else { + checkHasIllegalOptions(statsContext.ENDOFDAYMINS(), "ENDOFDAYMINS without ENDOFDAYHRS"); + checkHasIllegalOptions(statsContext.ENDOFDAYSECS(), "ENDOFDAYSECS without ENDOFDAYHRS"); + } + + checkHasMutuallyExclusiveOptions("INTERVAL or INTERVALHRS", statsContext.INTERVAL(), statsContext.INTERVALHRS()); + if (!statsContext.INTERVALHRS().isEmpty()) { + checkHasMandatoryOptions(statsContext.INTERVALMINS(), statsContext, "INTERVALMINS with INTERVALHRS"); + checkHasMandatoryOptions(statsContext.INTERVALSECS(), statsContext, "INTERVALSECS with INTERVALHRS"); + } else { + checkHasIllegalOptions(statsContext.INTERVALMINS(), "INTERVALMINS without INTERVALHRS"); + checkHasIllegalOptions(statsContext.INTERVALSECS(), "INTERVALSECS without INTERVALHRS"); + } + + checkHasMutuallyExclusiveOptions("NEXTTIME or NEXTTIMEHRS", statsContext.NEXTTIME(), statsContext.NEXTTIMEHRS()); + if (!statsContext.NEXTTIMEHRS().isEmpty()) { + checkHasMandatoryOptions(statsContext.NEXTTIMEMINS(), statsContext, "NEXTTIMEMINS with NEXTTIMEHRS"); + checkHasMandatoryOptions(statsContext.NEXTTIMESECS(), statsContext, "NEXTTIMESECS with NEXTTIMEHRS"); + } else { + checkHasIllegalOptions(statsContext.NEXTTIMEMINS(), "NEXTTIMEMINS without NEXTTIMEHRS"); + checkHasIllegalOptions(statsContext.NEXTTIMESECS(), "NEXTTIMESECS without NEXTTIMEHRS"); + } + + break; + case CICSParser.RULE_cics_inquire_jvmendpoint: CICSParser.Cics_inquire_jvmendpointContext jvmendpointContext = (CICSParser.Cics_inquire_jvmendpointContext) ctx; @@ -1378,6 +1512,7 @@ public void checkOptions(E ctx) { checkHasIllegalOptions(programContext.APPLMAJORVER(), "APPLMAJORVER without APPLICATION"); checkHasIllegalOptions(programContext.APPLMINORVER(), "APPLMINORVER without APPLICATION"); checkHasIllegalOptions(programContext.APPLMICROVER(), "APPLMICROVER without APPLICATION"); + checkHasIllegalOptions(programContext.PLATFORM(), "PLATFORM without APPLICATION"); } else { checkHasMandatoryOptions( programContext.APPLMAJORVER(), programContext, "APPLMAJORVER with APPLICATION"); @@ -1385,6 +1520,8 @@ public void checkOptions(E ctx) { programContext.APPLMINORVER(), programContext, "APPLMINORVER with APPLICATION"); checkHasMandatoryOptions( programContext.APPLMICROVER(), programContext, "APPLMICROVER with APPLICATION"); + checkHasMandatoryOptions( + programContext.PLATFORM(), programContext, "PLATFORM with APPLICATION"); } break; @@ -1404,7 +1541,7 @@ public void checkOptions(E ctx) { checkHasIllegalOptions(reqidContext.FMHSTATUS(), "FMHSTATUS without LENGTH"); } checkHasMutuallyExclusiveOptions( - "INTERVAL with AT or AFTER", + "INTERVAL or AT or AFTER", reqidContext.INTERVAL(), reqidContext.AT(), reqidContext.AFTER()); @@ -1422,6 +1559,66 @@ public void checkOptions(E ctx) { } break; + case CICSParser.RULE_cics_inquire_storage: + CICSParser.Cics_inquire_storageContext storageContext = (CICSParser.Cics_inquire_storageContext) ctx; + checkHasExactlyOneOption("ADDRESS or NUMELEMENTS", storageContext, storageContext.ADDRESS(), storageContext.NUMELEMENTS()); + if (!storageContext.ADDRESS().isEmpty()) { + checkHasIllegalOptions(storageContext.ELEMENTLIST(), "ELEMENTLIST with ADDRESS"); + checkHasIllegalOptions(storageContext.LENGTHLIST(), "LENGTHLIST with ADDRESS"); + checkHasIllegalOptions(storageContext.TASK(), "TASK with ADDRESS"); + } else if (!storageContext.NUMELEMENTS().isEmpty()) { + checkHasIllegalOptions(storageContext.ELEMENT(), "ELEMENT with NUMELEMENTS"); + checkHasIllegalOptions(storageContext.FLENGTH(), "FLENGTH with NUMELEMENTS"); + } + break; + + case CICSParser.RULE_cics_inquire_storage64: + CICSParser.Cics_inquire_storage64Context s64Context = (CICSParser.Cics_inquire_storage64Context) ctx; + checkHasExactlyOneOption("ADDRESS64 or NUMELEMENTS", s64Context, s64Context.ADDRESS64(), s64Context.NUMELEMENTS()); + if (!s64Context.ADDRESS64().isEmpty()) { + checkHasIllegalOptions(s64Context.ELEMENTLIST(), "ELEMENTLIST with ADDRESS64"); + checkHasIllegalOptions(s64Context.LENGTHLIST(), "LENGTHLIST with ADDRESS64"); + checkHasIllegalOptions(s64Context.TASK(), "TASK with ADDRESS64"); + } else if (!s64Context.NUMELEMENTS().isEmpty()) { + checkHasIllegalOptions(s64Context.DSANAME(), "DSANAME with NUMELEMENTS"); + checkHasIllegalOptions(s64Context.ELEMENT64(), "ELEMENT64 with NUMELEMENTS"); + checkHasIllegalOptions(s64Context.FLENGTH(), "FLENGTH with NUMELEMENTS"); + } + break; + + + case CICSParser.RULE_cics_inquire_subpool: + CICSParser.Cics_inquire_subpoolContext subpoolContext = + (CICSParser.Cics_inquire_subpoolContext) ctx; + checkBrowseMutuallyExclusive(subpoolContext); + if (!subpoolContext.START().isEmpty() || !subpoolContext.END().isEmpty()) { + if (!subpoolContext.END().isEmpty()) + checkHasIllegalOptions(subpoolContext.AT(), "AT with END"); + checkBrowsingInvalidOptions(subpoolContext, CICSParser.SUBPOOL); + checkBrowsingHasNotParameter(subpoolContext, CICSParser.SUBPOOL); + } else checkStatementHasParameter(subpoolContext, CICSParser.SUBPOOL); + + if (!subpoolContext.NEXT().isEmpty()) + checkHasIllegalOptions(subpoolContext.AT(), "AT with NEXT"); + + break; + + case CICSParser.RULE_cics_inquire_tag: + CICSParser.Cics_inquire_tagContext tagContext = (CICSParser.Cics_inquire_tagContext) ctx; + checkHasExactlyOneOption("START or END or NEXT", tagContext, tagContext.START(), tagContext.END(), tagContext.NEXT()); + if (!tagContext.START().isEmpty() || !tagContext.END().isEmpty()) { + checkBrowsingHasNotParameter(tagContext, CICSParser.TAG); + } else checkStatementHasParameter(tagContext, CICSParser.TAG); + break; + + case CICSParser.RULE_cics_inquire_task_list: + CICSParser.Cics_inquire_task_listContext taskListContext = + (CICSParser.Cics_inquire_task_listContext) ctx; + checkHasMandatoryOptions(taskListContext.LIST(), taskListContext, "LIST"); + checkHasMandatoryOptions(taskListContext.LISTSIZE(), taskListContext, "LISTSIZE"); + checkPrerequisiteIsMet(taskListContext.SET(), taskListContext.SETTRANSID(), taskListContext, "SETTRANSID without SET"); + break; + case CICSParser.RULE_cics_inquire_terminal: CICSParser.Cics_inquire_terminalContext terminalContext = (CICSParser.Cics_inquire_terminalContext) ctx; @@ -1433,6 +1630,13 @@ public void checkOptions(E ctx) { } else checkStatementHasParameter(terminalContext, CICSParser.TERMINAL); break; + case CICSParser.RULE_cics_inquire_tracetype: + CICSParser.Cics_inquire_tracetypeContext tracetypeContext = + (CICSParser.Cics_inquire_tracetypeContext) ctx; + checkCompIDMutuallyExclusive(tracetypeContext); + checkHasExactlyOneOption("FLAGSET or SPECIAL or STANDARD", tracetypeContext, tracetypeContext.FLAGSET(), tracetypeContext.SPECIAL(), tracetypeContext.STANDARD()); + break; + case CICSParser.RULE_cics_inquire_tranclass: CICSParser.Cics_inquire_tranclassContext tranclassContext = (CICSParser.Cics_inquire_tranclassContext) ctx; @@ -1455,6 +1659,7 @@ public void checkOptions(E ctx) { checkBrowsingCommon(transactionContext, CICSParser.TRANSACTION); if (!transactionContext.NEXT().isEmpty()) checkHasIllegalOptions(transactionContext.AT(), "AT with NEXT"); + checkHasMutuallyExclusiveOptions("TCLASS and TRANCLASS", transactionContext.TCLASS(), transactionContext.TRANCLASS()); break; case CICSParser.RULE_cics_inquire_tsqueue: @@ -1489,7 +1694,7 @@ public void checkOptions(E ctx) { uowdsnfailContext.END(), uowdsnfailContext.NEXT()); if (!uowdsnfailContext.START().isEmpty() || !uowdsnfailContext.END().isEmpty()) { - checkBrowsingInvalidOptions(uowdsnfailContext, CICSParser.UOW); + checkBrowsingInvalidOptions(uowdsnfailContext, CICSParser.UOWDSNFAIL); } break; @@ -1502,16 +1707,19 @@ public void checkOptions(E ctx) { uowenqContext.START(), uowenqContext.END(), uowenqContext.NEXT()); - checkHasMutuallyExclusiveOptions( - "ENQSCOPE or RESOURCE or UOW or END", - uowenqContext.ENQSCOPE(), - uowenqContext.RESOURCE(), - uowenqContext.UOW(), - uowenqContext.END()); + + if (!uowenqContext.END().isEmpty()) { + checkHasMutuallyExclusiveOptions( + "ENQSCOPE or RESOURCE or UOW or END", + uowenqContext.ENQSCOPE(), + uowenqContext.RESOURCE(), + uowenqContext.UOW(), + uowenqContext.END()); + } if (!uowenqContext.START().isEmpty() || !uowenqContext.END().isEmpty()) { checkBrowsingInvalidOptions( uowenqContext, - CICSParser.ENQ, + CICSParser.UOWENQ, CICSParser.ENQSCOPE, CICSParser.RESOURCE, CICSParser.RESLEN, @@ -1523,6 +1731,13 @@ public void checkOptions(E ctx) { break; + case CICSParser.RULE_cics_inquire_vtam: + CICSParser.Cics_inquire_vtamContext vtamContext = (CICSParser.Cics_inquire_vtamContext) ctx; + checkHasMutuallyExclusiveOptions("PSDINTHRS with PSDINTERVAL", vtamContext.PSDINTERVAL(), vtamContext.PSDINTHRS()); + checkPrerequisiteIsMet(vtamContext.PSDINTHRS(), vtamContext.PSDINTMINS(), vtamContext, "PSDINTMINS without PSDINTMINS"); + checkPrerequisiteIsMet(vtamContext.PSDINTMINS(), vtamContext.PSDINTSECS(), vtamContext, "PSDINTMINS without PSDINTMINS"); + break; + default: Integer ruleToken = COMMON_INQUIRE_BROWSE_RULES.get(ctx.getRuleIndex()); if (ruleToken != null) checkBrowsingCommon(ctx, ruleToken); @@ -1530,4 +1745,65 @@ public void checkOptions(E ctx) { } checkDuplicates(ctx); } + + /** + * Check mutually exclusive COMPID identifiers + * + * @param ctx Context Including COMPID identifiers + */ + public void checkCompIDMutuallyExclusive(CICSParser.Cics_inquire_tracetypeContext ctx) { + checkHasMutuallyExclusiveOptions("AP and APPLICATION", ctx.AP(), ctx.APPLICATION()); + checkHasMutuallyExclusiveOptions("AS and ASYNCSERVICE", ctx.AS(), ctx.ASYNCSERVICE()); + checkHasMutuallyExclusiveOptions("BA and BUSAPPMGR", ctx.BA(), ctx.BUSAPPMGR()); + checkHasMutuallyExclusiveOptions("BR and BRIDGE", ctx.BR(), ctx.BRIDGE()); + checkHasMutuallyExclusiveOptions("CP and CPI", ctx.CP(), ctx.CPI()); + checkHasMutuallyExclusiveOptions("DD and DIRMGR", ctx.DD(), ctx.DIRMGR()); + checkHasMutuallyExclusiveOptions("DH and DOCUMENT", ctx.DH(), ctx.DOCUMENT()); + checkHasMutuallyExclusiveOptions("DM and DOMAINMGR", ctx.DM(), ctx.DOMAINMGR()); + checkHasMutuallyExclusiveOptions("DP and DEBUGTOOL", ctx.DP(), ctx.DEBUGTOOL()); + checkHasMutuallyExclusiveOptions("DS and DISPATCHER", ctx.DS(), ctx.DISPATCHER()); + checkHasMutuallyExclusiveOptions("DU and DUMP", ctx.DU(), ctx.DUMP()); + checkHasMutuallyExclusiveOptions("EC and EVENTCAPTURE", ctx.EC(), ctx.EVENTCAPTURE()); + checkHasMutuallyExclusiveOptions("EJ and ENTJAVA", ctx.EJ(), ctx.ENTJAVA()); + checkHasMutuallyExclusiveOptions("EM and EVENTMGR", ctx.EM(), ctx.EVENTMGR()); + checkHasMutuallyExclusiveOptions("EP and EVENTPROC", ctx.EP(), ctx.EVENTPROC()); + checkHasMutuallyExclusiveOptions("GC and GLOBALCATLG", ctx.GC(), ctx.GLOBALCATLG()); + checkHasMutuallyExclusiveOptions("IE and IPECI", ctx.IE(), ctx.IPECI()); + checkHasMutuallyExclusiveOptions("KE and KERNEL", ctx.KE(), ctx.KERNEL()); + checkHasMutuallyExclusiveOptions("LC and LOCALCATLG", ctx.LC(), ctx.LOCALCATLG()); + checkHasMutuallyExclusiveOptions("LD and LOADER", ctx.LD(), ctx.LOADER()); + checkHasMutuallyExclusiveOptions("LG and LOGGER", ctx.LG(), ctx.LOGGER()); + checkHasMutuallyExclusiveOptions("LM and LOCKMGR", ctx.LM(), ctx.LOCKMGR()); + checkHasMutuallyExclusiveOptions("ME and MESSAGE", ctx.ME(), ctx.MESSAGE()); + checkHasMutuallyExclusiveOptions("MN and MONITOR", ctx.MN(), ctx.MONITOR()); + checkHasMutuallyExclusiveOptions("MP and MANAGEDPLAT", ctx.MP(), ctx.MANAGEDPLAT()); + checkHasMutuallyExclusiveOptions("NQ and ENQUEUE", ctx.NQ(), ctx.ENQUEUE()); + checkHasMutuallyExclusiveOptions("OT and OBJECTTRAN", ctx.OT(), ctx.OBJECTTRAN()); + checkHasMutuallyExclusiveOptions("PA and PARAMGR", ctx.PA(), ctx.PARAMGR()); + checkHasMutuallyExclusiveOptions("PG and PROGMGR", ctx.PG(), ctx.PROGMGR()); + checkHasMutuallyExclusiveOptions("PI and PIPEMGR", ctx.PI(), ctx.PIPEMGR()); + checkHasMutuallyExclusiveOptions("PT and PARTNER", ctx.PT(), ctx.PARTNER()); + checkHasMutuallyExclusiveOptions("RA and RMIADAPTERS", ctx.RA(), ctx.RMIADAPTERS()); + checkHasMutuallyExclusiveOptions("RI and RMI", ctx.RI(), ctx.RMI()); + checkHasMutuallyExclusiveOptions("RL and RESLIFEMGR", ctx.RL(), ctx.RESLIFEMGR()); + checkHasMutuallyExclusiveOptions("RM and RECOVERY", ctx.RM(), ctx.RECOVERY()); + checkHasMutuallyExclusiveOptions("RS and REGIONSTAT", ctx.RS(), ctx.REGIONSTAT()); + checkHasMutuallyExclusiveOptions("RX and RRS", ctx.RX(), ctx.RRS()); + checkHasMutuallyExclusiveOptions("RZ and REQUESTSTRM", ctx.RZ(), ctx.REQUESTSTRM()); + checkHasMutuallyExclusiveOptions("SH and SCHEDULER", ctx.SH(), ctx.SCHEDULER()); + checkHasMutuallyExclusiveOptions("SJ and SJVM", ctx.SJ(), ctx.SJVM()); + checkHasMutuallyExclusiveOptions("SM and STORAGE", ctx.SM(), ctx.STORAGE()); + checkHasMutuallyExclusiveOptions("SO and SOCKETS", ctx.SO(), ctx.SOCKETS()); + checkHasMutuallyExclusiveOptions("ST and STATISTICS", ctx.ST(), ctx.STATISTICS()); + checkHasMutuallyExclusiveOptions("TI and TIMER", ctx.TI(), ctx.TIMER()); + checkHasMutuallyExclusiveOptions("TR and TRACE", ctx.TR(), ctx.TRACE()); + checkHasMutuallyExclusiveOptions("TS and TEMPSTORAGE", ctx.TS(), ctx.TEMPSTORAGE()); + checkHasMutuallyExclusiveOptions("US and USER", ctx.US(), ctx.USER()); + checkHasMutuallyExclusiveOptions("WB and WEB", ctx.WB(), ctx.WEB()); + checkHasMutuallyExclusiveOptions("WU and WEBRESTMGR", ctx.WU(), ctx.WEBRESTMGR()); + checkHasMutuallyExclusiveOptions("W2 and WEB2", ctx.W2(), ctx.WEB2()); + checkHasMutuallyExclusiveOptions("XM and TRANMGR", ctx.XM(), ctx.TRANMGR()); + checkHasMutuallyExclusiveOptions("XS and SECURITY", ctx.XS(), ctx.SECURITY()); + + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSMoveOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSMoveOptionsCheckUtility.java index 362a692545..dd3f8bf1da 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSMoveOptionsCheckUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSMoveOptionsCheckUtility.java @@ -60,13 +60,13 @@ public CICSMoveOptionsCheckUtility( */ @Override public void checkOptions(E ctx) { - if (RULE_cics_move == (ctx.getParent().getRuleIndex())) { - checkMoveOptions((CICSParser.Cics_moveContext) ctx.getParent()); + if (CICSParser.RULE_cics_move_body == (ctx.getRuleIndex())) { + checkMoveOptions((CICSParser.Cics_move_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } - private void checkMoveOptions(CICSParser.Cics_moveContext ctx) { + private void checkMoveOptions(CICSParser.Cics_move_bodyContext ctx) { checkHasMandatoryOptions(ctx.CONTAINER(), ctx, "CONTAINER"); checkHasMandatoryOptions(ctx.AS(), ctx, "AS"); checkHasMutuallyExclusiveOptions("FROMPROCESS or FROMACTIVITY", ctx.FROMPROCESS(), ctx.FROMACTIVITY()); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java index 0b9adb565c..7de9e340ce 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java @@ -249,13 +249,13 @@ protected void checkResponseHandlers(CICSParser.Cics_handle_responseContext rule * @param Generic locality source type * @return The locality of the rule */ - private Locality getLocality(E rule) { + protected Locality getLocality(E rule) { if (ParserRuleContext.class.isAssignableFrom(rule.getClass())) return VisitorUtility.constructLocality((ParserRuleContext) rule, context); else return VisitorUtility.constructLocality((TerminalNode) rule, context); } - private void throwException( + protected void throwException( ErrorSeverity errorSeverity, @NonNull Locality locality, String message, String wrongToken) { SyntaxError error = SyntaxError.syntaxError() @@ -375,9 +375,59 @@ protected int checkHasMutuallyExclusiveOptions(String options, List... rules) { + List nodes = new ArrayList<>(Stream.of(rules) + .flatMap(Collection::stream) + .collect(Collectors.toCollection( + () -> new TreeSet<>(Comparator.comparing(node -> node.getSymbol().getType())) + ))); + nodes.removeIf(Objects::isNull); + + if (!nodes.stream() + .allMatch(e -> e.getSymbol().getType() == nodes.get(0).getSymbol().getType())) { + nodes.forEach( + node -> { + throwException( + ErrorSeverity.ERROR, + getLocality(node), + "Exactly one option required, options are mutually exclusive: ", + nodes.toString().toUpperCase().replace(",", " or").replace("[", "").replace("]", "")); + }); + } + return nodes.size(); + } + + /** + * Checks whether list of options is either empty or contains all options + * @param options Options checked to insert into error message + * @param ctx ParserRuleContext + * @param rules Lists of rules to iterate through + */ + protected void checkAllOptionsArePresentOrAbsent(String options, ParserRuleContext ctx, List... rules) { + boolean noOptions = Arrays.stream(rules).allMatch(List::isEmpty); + if (!noOptions) { + boolean allOptions = Arrays.stream(rules).noneMatch(List::isEmpty); + if (!allOptions) { + throwException( + ErrorSeverity.ERROR, + getLocality(ctx), + "If one option is specified, all options must be present: ", + options); + } + } + } + - protected void checkHasExactlyOneOption( - String options, ParserRuleContext parentCtx, List... rules) { + protected void checkHasExactlyOneOption( + String options, ParserRuleContext parentCtx, List... rules) { List children = new ArrayList<>(); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java index 1dfa0c8295..4332c88bd6 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java @@ -100,10 +100,10 @@ public CICSOptionsCheckUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_readnext_readprev) { - checkReadNextReadPrev((CICSParser.Cics_readnext_readprevContext) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_readnext_readprev_body) { + checkReadNextReadPrevBody((CICSParser.Cics_readnext_readprev_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } @SuppressWarnings("unchecked") - private void checkReadNextReadPrev(CICSParser.Cics_readnext_readprevContext ctx) { + private void checkReadNextReadPrevBody(CICSParser.Cics_readnext_readprev_bodyContext ctx) { checkHasMandatoryOptions(ctx.cics_file_name(), ctx, "FILE"); List file = ctx.cics_file_name().stream().map(CICSParser.Cics_file_nameContext::FILE).collect(Collectors.toList()); List dataset = ctx.cics_file_name().stream().map(CICSParser.Cics_file_nameContext::DATASET).collect(Collectors.toList()); @@ -84,8 +84,6 @@ private void checkReadNextReadPrev(CICSParser.Cics_readnext_readprevContext ctx) checkHasMandatoryOptions(ctx.RIDFLD(), ctx, "RIDFLD"); checkHasExactlyOneOption("INTO or SET", ctx, ctx.INTO(), ctx.SET()); - checkHasMutuallyExclusiveOptions( - "READNEXT or READPREV", Collections.singletonList(ctx.READNEXT()), Collections.singletonList(ctx.READPREV())); checkHasMutuallyExclusiveOptions( "UNCOMMITTED or CONSISTENT or REPEATABLE or UPDATE", ctx.UNCOMMITTED(), ctx.CONSISTENT(), ctx.REPEATABLE(), ctx.UPDATE()); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSRewindCounterOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSRewindCounterOptionsCheckUtility.java new file mode 100644 index 0000000000..aba9517062 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSRewindCounterOptionsCheckUtility.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2025 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + + import org.antlr.v4.runtime.ParserRuleContext; + import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; + import org.eclipse.lsp.cobol.common.error.ErrorSeverity; + import org.eclipse.lsp.cobol.common.error.SyntaxError; + import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; + import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + + import java.util.HashMap; + import java.util.List; + import java.util.Map; + + import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_rewind; + import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_rewind_opts; + +/** Checks CICS REWIND COUNTER rules for required and invalid options */ +public class CICSRewindCounterOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + + public static final int RULE_INDEX = RULE_cics_rewind; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.COUNTER, ErrorSeverity.ERROR); + put(CICSLexer.DCOUNTER, ErrorSeverity.ERROR); + put(CICSLexer.POOL, ErrorSeverity.ERROR); + put(CICSLexer.INCREMENT, ErrorSeverity.ERROR); + put(CICSLexer.NOSUSPEND, ErrorSeverity.WARNING); + } + }; + + public CICSRewindCounterOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS REWIND COUNTER rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + if (ctx.getRuleIndex() == RULE_cics_rewind_opts) { + checkOpts((CICSParser.Cics_rewind_optsContext) ctx); + } + checkDuplicates(ctx); + } + private void checkOpts(CICSParser.Cics_rewind_optsContext ctx) { + checkHasExactlyOneOption("COUNTER or DCOUNTER", ctx, ctx.COUNTER(), ctx.DCOUNTER()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSSignalOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSSignalOptionsCheckUtility.java new file mode 100644 index 0000000000..a8310b5cfa --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSSignalOptionsCheckUtility.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_signal; + +/** Checks CICS SIGNAL EVENT rules for required and invalid options */ +public class CICSSignalOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_signal; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.EVENT, ErrorSeverity.ERROR); + put(CICSLexer.FROMCHANNEL, ErrorSeverity.ERROR); + put(CICSLexer.FROM, ErrorSeverity.ERROR); + put(CICSLexer.FROMLENGTH, ErrorSeverity.ERROR); + } + }; + + public CICSSignalOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS SIGNAL EVENT rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + if (ctx instanceof CICSParser.Cics_signal_optionsContext) { + checkSignalEvent((CICSParser.Cics_signal_optionsContext) ctx); + } + checkDuplicates(ctx); + } + + @SuppressWarnings("unchecked") + private void checkSignalEvent(CICSParser.Cics_signal_optionsContext ctx) { + checkHasMandatoryOptions(ctx.EVENT(), ctx, "EVENT"); + checkHasMutuallyExclusiveOptions("FROMCHANNEL or FROM", ctx.FROMCHANNEL(), ctx.FROM()); + if (!ctx.FROMLENGTH().isEmpty()) { + checkHasMandatoryOptions(ctx.FROM(), ctx, "FROM"); + } + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSStartbrOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSStartbrOptionsCheckUtility.java new file mode 100644 index 0000000000..e2f4109308 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSStartbrOptionsCheckUtility.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_startbr; + +/** Checks CICS STARTBR rules for required and invalid options */ +public class CICSStartbrOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_startbr; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.FILE, ErrorSeverity.ERROR); + put(CICSLexer.DATASET, ErrorSeverity.ERROR); + put(CICSLexer.RIDFLD, ErrorSeverity.ERROR); + put(CICSLexer.KEYLENGTH, ErrorSeverity.ERROR); + put(CICSLexer.GENERIC, ErrorSeverity.WARNING); + put(CICSLexer.REQID, ErrorSeverity.ERROR); + put(CICSLexer.SYSID, ErrorSeverity.ERROR); + put(CICSLexer.DEBKEY, ErrorSeverity.WARNING); + put(CICSLexer.DEBREC, ErrorSeverity.WARNING); + put(CICSLexer.RBA, ErrorSeverity.WARNING); + put(CICSLexer.RRN, ErrorSeverity.WARNING); + put(CICSLexer.XRBA, ErrorSeverity.WARNING); + put(CICSLexer.GTEQ, ErrorSeverity.WARNING); + put(CICSLexer.EQUAL, ErrorSeverity.WARNING); + } + }; + + public CICSStartbrOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS STARTBR rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + if (ctx instanceof CICSParser.Cics_startbr_optionsContext) { + checkStartbr((CICSParser.Cics_startbr_optionsContext) ctx); + } + checkDuplicates(ctx); + } + + @SuppressWarnings("unchecked") + private void checkStartbr(CICSParser.Cics_startbr_optionsContext ctx) { + checkHasExactlyOneOption("FILE or DATASET", ctx, ctx.FILE(), ctx.DATASET()); + checkHasMandatoryOptions(ctx.RIDFLD(), ctx, "RIDFLD"); + checkHasMutuallyExclusiveOptions("DEBKEY, DEBREC, RBA, RRN, or XRBA", + ctx.DEBKEY(), ctx.DEBREC(), ctx.RBA(), ctx.RRN(), ctx.XRBA()); + checkHasMutuallyExclusiveOptions("GTEQ or EQUAL", ctx.GTEQ(), ctx.EQUAL()); + if (!ctx.GENERIC().isEmpty()) { + checkHasMandatoryOptions(ctx.KEYLENGTH(), ctx, "KEYLENGTH"); + } + if (!ctx.SYSID().isEmpty()) { + checkHasExactlyOneOption("KEYLENGTH, RBA, RRN, or XRBA", ctx, ctx.KEYLENGTH(), ctx.RBA(), ctx.RRN(), ctx.XRBA()); + } + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSSyncPointOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSSyncPointOptionsCheckUtility.java new file mode 100644 index 0000000000..3c40be576b --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSSyncPointOptionsCheckUtility.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_syncpoint; + +/** Checks CICS SYNCPOINT rules for required and invalid options */ +public class CICSSyncPointOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_syncpoint; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.ROLLBACK, ErrorSeverity.WARNING); + } + }; + + public CICSSyncPointOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS Syncpoint rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + checkDuplicates(ctx); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSTestOptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSTestOptionsUtility.java index 368993386d..1dd48f1f8f 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSTestOptionsUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSTestOptionsUtility.java @@ -53,13 +53,13 @@ public CICSTestOptionsUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_test) { - checkTestEvent((CICSParser.Cics_testContext) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_test_body) { + checkTestEvent((CICSParser.Cics_test_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } - private void checkTestEvent(CICSParser.Cics_testContext ctx) { + private void checkTestEvent(CICSParser.Cics_test_bodyContext ctx) { checkHasMandatoryOptions(ctx.EVENT(), ctx, "EVENT"); checkHasMandatoryOptions(ctx.FIRESTATUS(), ctx, "FIRESTATUS"); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSUnlockOptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSUnlockOptionsUtility.java index 03d396e56b..a94e38595d 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSUnlockOptionsUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSUnlockOptionsUtility.java @@ -56,14 +56,14 @@ public CICSUnlockOptionsUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_unlock) { - checkUnlock((CICSParser.Cics_unlockContext) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_unlock_body) { + checkUnlock((CICSParser.Cics_unlock_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } @SuppressWarnings("unchecked") - private void checkUnlock(CICSParser.Cics_unlockContext ctx) { + private void checkUnlock(CICSParser.Cics_unlock_bodyContext ctx) { checkHasMandatoryOptions(ctx.cics_file_name(), ctx, "FILE"); List file = ctx.cics_file_name().stream().map(CICSParser.Cics_file_nameContext::FILE).collect(Collectors.toList()); List dataset = ctx.cics_file_name().stream().map(CICSParser.Cics_file_nameContext::DATASET).collect(Collectors.toList()); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSUpdateOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSUpdateOptionsCheckUtility.java new file mode 100644 index 0000000000..f69564b031 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSUpdateOptionsCheckUtility.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_update; + +/** Checks CICS UPDATE COUNTER and UPDATE DCOUNTER rules for required and invalid options */ +public class CICSUpdateOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_update; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.COUNTER, ErrorSeverity.ERROR); + put(CICSLexer.DCOUNTER, ErrorSeverity.ERROR); + put(CICSLexer.POOL, ErrorSeverity.ERROR); + put(CICSLexer.VALUE, ErrorSeverity.ERROR); + put(CICSLexer.COMPAREMIN, ErrorSeverity.ERROR); + put(CICSLexer.COMPAREMAX, ErrorSeverity.ERROR); + put(CICSLexer.NOSUSPEND, ErrorSeverity.WARNING); + } + }; + + public CICSUpdateOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS Update rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + if (ctx.getRuleIndex() == CICSParser.RULE_cics_update_counter_dcounter) { + checkUpdateCounterDcounter((CICSParser.Cics_update_counter_dcounterContext) ctx); + } + checkDuplicates(ctx); + } + + private void checkUpdateCounterDcounter(CICSParser.Cics_update_counter_dcounterContext ctx) { + checkHasExactlyOneOption("COUNTER or DCOUNTER", ctx, ctx.COUNTER(), ctx.DCOUNTER()); + checkHasMandatoryOptions(ctx.VALUE(), ctx, "VALUE"); + } +} + diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWSAEPRUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWSAEPRUtility.java index cc87248724..cbbd1919a7 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWSAEPRUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWSAEPRUtility.java @@ -63,13 +63,13 @@ public CICSWSAEPRUtility(DialectProcessingContext context, List err * @param A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_wsaepr) { - checkWSAEPR((CICSParser.Cics_wsaeprContext) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_wsaepr_body) { + checkWSAEPR((CICSParser.Cics_wsaepr_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } - private void checkWSAEPR(CICSParser.Cics_wsaeprContext ctx) { + private void checkWSAEPR(CICSParser.Cics_wsaepr_bodyContext ctx) { checkHasMandatoryOptions(ctx.CREATE(), ctx, "CREATE"); checkHasExactlyOneOption("EPRINTO or EPRSET", ctx, ctx.EPRINTO(), ctx.EPRSET()); checkHasMandatoryOptions(ctx.EPRLENGTH(), ctx, "EPRLENGTH"); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWaitCicsOptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWaitCicsOptionsUtility.java index 07c52c3b44..fc4a98a4f2 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWaitCicsOptionsUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSWaitCicsOptionsUtility.java @@ -57,14 +57,14 @@ public CICSWaitCicsOptionsUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_waitcics) { - checkWaitCics((CICSParser.Cics_waitcicsContext) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_waitcics_body) { + checkWaitCics((CICSParser.Cics_waitcics_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } @SuppressWarnings("unchecked") - private void checkWaitCics(CICSParser.Cics_waitcicsContext ctx) { + private void checkWaitCics(CICSParser.Cics_waitcics_bodyContext ctx) { checkHasMandatoryOptions(ctx.ECBLIST(), ctx, "ECBLIST"); checkHasMandatoryOptions(ctx.NUMEVENTS(), ctx, "NUMEVENTS"); checkHasMutuallyExclusiveOptions("PURGEABLE or NOTPURGEABLE or PURGEABILITY", ctx.PURGEABLE(), ctx.NOTPURGEABLE(), ctx.PURGEABILITY()); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSXctlOptionsUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSXctlOptionsUtility.java index 9670655a19..2f89858541 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSXctlOptionsUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSXctlOptionsUtility.java @@ -56,14 +56,14 @@ public CICSXctlOptionsUtility(DialectProcessingContext context, List A subclass of ParserRuleContext */ public void checkOptions(E ctx) { - if (ctx.getParent().getRuleIndex() == CICSParser.RULE_cics_xctl) { - checkXctl((CICSParser.Cics_xctlContext) ctx.getParent()); + if (ctx.getRuleIndex() == CICSParser.RULE_cics_xctl_body) { + checkXctl((CICSParser.Cics_xctl_bodyContext) ctx); } - checkDuplicates(ctx.getParent()); + checkDuplicates(ctx); } @SuppressWarnings("unchecked") - private void checkXctl(CICSParser.Cics_xctlContext ctx) { + private void checkXctl(CICSParser.Cics_xctl_bodyContext ctx) { checkHasMandatoryOptions(ctx.PROGRAM(), ctx, "PROGRAM"); checkHasMutuallyExclusiveOptions("COMMAREA or CHANNEL", ctx.COMMAREA(), ctx.CHANNEL()); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecVisitor.java index b7ba50e646..77e3d7a9ed 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecVisitor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlExecVisitor.java @@ -15,28 +15,41 @@ package org.eclipse.lsp.cobol.implicitDialects.sql; import static java.util.stream.Collectors.toList; +import static org.eclipse.lsp.cobol.core.visitor.VisitorHelper.getName; import com.google.common.collect.ImmutableList; +import java.util.ArrayList; import java.util.List; import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Stream; import lombok.AllArgsConstructor; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.RuleNode; import org.antlr.v4.runtime.tree.TerminalNode; import org.apache.commons.lang3.tuple.Pair; import org.eclipse.lsp.cobol.AntlrRangeUtils; +import org.eclipse.lsp.cobol.common.copybook.CopybookService; import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.common.model.Locality; import org.eclipse.lsp.cobol.common.model.tree.Node; import org.eclipse.lsp.cobol.common.model.tree.variable.*; import org.eclipse.lsp.cobol.core.visitor.VisitorHelper; import org.eclipse.lsp.cobol.implicitDialects.sql.node.*; import org.eclipse.lsp4j.Location; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; /** * This visitor analyzes the parser tree for DB2 SQL and returns its semantic context as a syntax @@ -47,9 +60,14 @@ class Db2SqlExecVisitor extends Db2SqlExecParserBaseVisitor> { private final DialectProcessingContext context; + private final CopybookService copybookService; + private final MessageService messageService; + private static final Pattern DSIZE_REGEX = Pattern.compile("(\\d+)\\s*[Gg]"); + @Getter + private final List errors = new ArrayList<>(); @Override - public List visitDbs_host_variable(Db2SqlExecParser.Dbs_host_variableContext ctx) { + public List visitDbs_procedure_name(Db2SqlExecParser.Dbs_procedure_nameContext ctx) { return addTreeNode(ctx, QualifiedReferenceNode::new); } @@ -87,17 +105,30 @@ public List visitRulesAllowedInDataDivisionAndProcedureDivision( } @Override - public List visitDbs_rs_locator_variable(Db2SqlExecParser.Dbs_rs_locator_variableContext ctx) { - return addTreeNode(ctx, QualifiedReferenceNode::new); + public List visitDbs_host_identifier(Db2SqlExecParser.Dbs_host_identifierContext ctx) { + Location location = context.getExtendedDocument().mapLocation(AntlrRangeUtils.constructRange(ctx)); + Locality locality = Locality.builder().range(location.getRange()).uri(location.getUri()).build(); + QualifiedReferenceNode groupNode = new QualifiedReferenceNode(locality); + List identifiers = ctx.dbs_sql_identifier(); + for (int i = identifiers.size() - 1; i >= 0; i--) { + addVariableUsageNode(groupNode, identifiers.get(i)); + } + return ImmutableList.of(groupNode); + } + + private void addVariableUsageNode(QualifiedReferenceNode groupNode, Db2SqlExecParser.Dbs_sql_identifierContext identifierCtx) { + Location varLocation = context.getExtendedDocument().mapLocation(AntlrRangeUtils.constructRange(identifierCtx)); + Locality varLocality = Locality.builder().range(varLocation.getRange()).uri(varLocation.getUri()).build(); + groupNode.addChild(new VariableUsageNode(getName(identifierCtx), varLocality)); } @Override - public List visitDbs_host_names_var(Db2SqlExecParser.Dbs_host_names_varContext ctx) { + public List visitDbs_sql_variable_reference(Db2SqlExecParser.Dbs_sql_variable_referenceContext ctx) { return addTreeNode(ctx, QualifiedReferenceNode::new); } @Override - public List visitDbs_host_name_container(Db2SqlExecParser.Dbs_host_name_containerContext ctx) { + public List visitDbs_host_label(Db2SqlExecParser.Dbs_host_labelContext ctx) { if (isVariableUsage(ctx.getParent())) { return addVariableUsageNodes(ctx); } @@ -120,12 +151,41 @@ protected List aggregateResult(List aggregate, List nextResult return Stream.concat(aggregate.stream(), nextResult.stream()).collect(toList()); } + @Override + public List visitDbs_dsize_parameter(Db2SqlExecParser.Dbs_dsize_parameterContext ctx) { + String text = ctx.getText(); + Matcher matcher = DSIZE_REGEX.matcher(text); + if (matcher.matches()) { + int size = Integer.parseInt(matcher.group(1)); + if (!dsizeValidation(size)) { + addSyntaxError(ctx, "dsize should be a power-of-two integer in the range 1–256"); + } + } else { + addSyntaxError(ctx, "unknown token"); + } + return visitChildren(ctx); + } + + private void addSyntaxError(ParserRuleContext ctx, String messageKey, Object... messageArgs) { + SyntaxError error = SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .location(getTokenEndLocality(ctx.stop).toOriginalLocation()) + .suggestion(messageService.getMessage(messageKey, messageArgs)) + .severity(ErrorSeverity.ERROR) + .build(); + errors.add(error); + } + + private static boolean dsizeValidation(int n) { + return n > 0 && n <= 256 && (n & (n - 1)) == 0; + } + private boolean isVariableUsage(ParserRuleContext ctx) { if (hasColumn(ctx)) { return true; } - if (ctx instanceof Db2SqlExecParser.Dbs_host_names_varContext && !isSpecialName(ctx)) { + if (ctx instanceof Db2SqlExecParser.Dbs_sql_variable_referenceContext && !isSpecialName(ctx)) { return true; } @@ -172,7 +232,7 @@ private List addTreeNode(ParserRuleContext ctx, Function n } private List addVariableUsageNodes(ParserRuleContext ctx) { - String name = VisitorHelper.getName(ctx); + String name = getName(ctx); boolean hasColumn = name.startsWith(":"); if (hasColumn) { name = name.substring(1); @@ -187,4 +247,16 @@ private List addVariableUsageNodes(ParserRuleContext ctx) { String finalName = name; return addTreeNode(ctx, locality -> new VariableUsageNode(finalName, locality)); } + + private Locality getTokenEndLocality(Token token) { + return Locality.builder() + .uri(context.getProgramDocumentUri()) + .range(buildTokenEndRange(token)) + .build(); + } + + private Range buildTokenEndRange(Token token) { + Position p = new Position(token.getLine() - 1, token.getCharPositionInLine() + token.getStopIndex() - token.getStartIndex() + 1); + return new Range(p, p); + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java index e3577d2b8b..1057581dcb 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java @@ -309,7 +309,7 @@ private List getAllTerminalNodes(ParserRuleContext ctx) { public List visitSqlCode(Db2SqlParser.SqlCodeContext ctx) { String sqlCode = preProcessSqlComment(ctx); - List nodes = new Db2SqlExecVisitor(context).visitStartSqlRule(parseSQL(sqlCode, ctx)); + List nodes = new Db2SqlExecVisitor(context, copybookService, messageService).visitStartSqlRule(parseSQL(sqlCode, ctx)); Db2SqlVisitorHelper.adjustNodeLocations(ctx, context, nodes); Location location = context.getExtendedDocument().mapLocation(AntlrRangeUtils.constructRange(ctx.getParent())); Locality locality = Locality.builder().range(location.getRange()).uri(location.getUri()).build(); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java index d8519491b9..72d1fb275b 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java @@ -161,10 +161,10 @@ public static Pair getWheneverType(Db2 if (ctx.CONTINUE() != null) { return Pair.of(ExecSqlWheneverNode.WheneverType.CONTINUE, null); } - return Optional.ofNullable(ctx.dbs_host_name_container()) - .map(c -> c.dbs_host_names()) + return Optional.ofNullable(ctx.dbs_host_label()) + .map(Db2SqlExecParser.Dbs_host_labelContext::dbs_sql_identifier) .filter(hn -> !hn.isEmpty()) - .map(c -> c.get(0)) +// .map(c -> c.get(0)) .map(ParseTree::getText) .map(t -> Pair.of(ExecSqlWheneverNode.WheneverType.GOTO, t)) .orElse(Pair.of(ExecSqlWheneverNode.WheneverType.CONTINUE, null)); diff --git a/server/engine/src/main/resources/LanguageKeywords.txt b/server/engine/src/main/resources/LanguageKeywords.txt index 56db1e9a5b..4d62042b20 100644 --- a/server/engine/src/main/resources/LanguageKeywords.txt +++ b/server/engine/src/main/resources/LanguageKeywords.txt @@ -49,6 +49,8 @@ ACTIONTYPE= ACTIVATE= ACTIVE= ACTIVITY= +ACTIVITYBUSY= +ACTIVITYERR= ACTIVITYID= ACTOPENTCBS= ACTPARTN= @@ -60,6 +62,7 @@ ADA= ADAPTERTYPE= ADATA= ADD=The ADD statement sums two or more numeric operands and stores the result.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsadd.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +ADDRESS64= ADDRESS=The ADDRESS OF special register references the address of a data item in the LINKAGE SECTION, the LOCAL-STORAGE SECTION, or the WORKING-STORAGE SECTION.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rllanadd.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ADD_DAYS1= ADD_MONTHS= @@ -67,7 +70,6 @@ ADJUSTMENT= ADMIN_TASK_LIST= ADMIN_TASK_OUTPUT= ADMIN_TASK_STATUS= -ADRESS64= ADV= ADVANCING=If you specify the WITH NO ADVANCING phrase, and output is going to a ddname, the printer control character \+ (plus) is placed into the first output position from the *next* DISPLAY statement. \+ is the ANSI-defined printer control character that suppresses line spacing before a record is printed.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tpbeg16b.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. AFTER= @@ -82,6 +84,7 @@ ALIAS= ALIGNED= ALL= ALLOCATE= +ALLOCERR= ALLOW= ALPHABET=The ALPHABET clause provides a means of relating an alphabet-name to a specified character code set or collating sequence.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlconalp.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ALPHABETIC-LOWER=The ALPHABETIC-LOWER class specifies that the data consists entirely of any combination of the lowercase Latin alphabetic characters a through z and the space.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdscla.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -106,6 +109,7 @@ AND= ANSI= ANY=An RMODE parameter. Specifies that a program will have RMODE ANY if RENT is specified, and will receive an error if NORENT is specified.
[More info](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/custom/igycch250.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ANYKEY= +AP=Application APIST= APLKYBD= APLKYBDST= @@ -124,6 +128,7 @@ APPLMINORVER= APPLNAME= APPLNAMEST= APPLY= +APPNOTFOUND= AR= ARCHIVE= ARCHIVEFILE= @@ -169,6 +174,7 @@ ASSOCIATED-DATA= ASSOCIATION= ASUTIME= ASYNCHRONOUS= +ASYNCSERVICE=Asynchronous services AT= ATAN2= ATAN= @@ -188,6 +194,7 @@ ATTACHTIME= ATTLS= ATTRIBUTE= ATTRIBUTES= +ATTRLEN= AUDALARMST= AUDIT= AUDITLEVEL= @@ -217,6 +224,7 @@ AVAILABLE= AVAILSTATUS= AVG= AWO= +BA=Business applications manager BACKLOG= BACKPAGE= BACKSCAN= @@ -260,11 +268,13 @@ BLOCKING_THREADS= BLOCKKEYLEN= BLOCKSIZE= BLUE= +BM=Basic mapping support BODYCHARSET= BOOKMARK= BOTH= BOTTOM=DATA DIVISION parameter.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfde.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. BOUNDS= +BR=3270 Bridge BRANCHQUAL= BRDATA= BRDATALENGTH= @@ -288,7 +298,9 @@ BUNDLEDIR= BUNDLEID= BUNDLEPART= BURGEABILITY= +BUSAPPMGR=Business applications manager BUSINESS_TIME= +BUSY= BUT= BXNUMBER= BY= @@ -320,10 +332,12 @@ CAST= CATALOG= CATALOG_NAME= CAUSE= +CBIDERR= CBL= CBLCARD= CBUFF= CCSID= +CCSIDERR= CCSID_ENCODING= CCSVERSION= CDSASIZE= @@ -342,6 +356,7 @@ CHANGES= CHANGETIME= CHANGEUSRID= CHANNEL= +CHANNELERR= CHAR= CHARACTER=The PADDING CHARACTER clause specifies a character to be used for block padding on sequential files.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rliospad.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CHARACTERS=The CHARACTERS keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -407,6 +422,7 @@ COBOLTYPE= CODE-SET=The CODE-SET clause specifies the character code used to represent data on a magnetic tape file.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfdecsc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CODE= CODEPAGE= +CODEPAGEERR= CODEUNITS32= COLDSTATUS= COLLATE= @@ -489,6 +505,7 @@ CONSTRAINT= CONSTRAINTS= CONTAINER= CONTAINERCNT= +CONTAINERERR= CONTAINS=The CONTAINS keyword is part of the BLOCK CONTAINS and RECORD CONTAINS parameters of the DATA DIVISION.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfde.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CONTENT=The calling program passes only the contents of the literal or identifier.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tpshr03.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CONTENTS= @@ -527,6 +544,8 @@ COVARIANCE_SAMP= COVAR_POP= COVAR_SAMP= CP= +CP=Common programming interface +CPI=Common programming interface CPP= CPSM= CPU= @@ -549,6 +568,7 @@ CRLPROFILE= CROSS= CRUNCH= CS= +CSDERR= CTLCHAR= CUBE= CUME_DIST1= @@ -597,7 +617,6 @@ DATABUFFERS= DATACLAS= DATAFORMAT= DATALENGTH= -DATALENTH= DATALINK= DATALOCATION= DATAONLY= @@ -689,9 +708,11 @@ DBINFO= DBMAINT= DBNAME= DBNODE= +DC=Dump control DCOUNTER= DCT= DD= +DD=Directory manager DDMMYY= DDMMYYYY= DDNAME= @@ -790,6 +811,7 @@ DFHRESP= DFHVALUE= DFLD= DFLTUSER= +DH=Document handling DIAGNOSTICS= DIAGTRUNC= DICTNAME= @@ -800,7 +822,9 @@ DIGEST= THE The BIF DIGEST command is a CICS® built-in function that calculates DIGESTTYPE= DIGITS= DIMENSIONS= +DIRMGR= DISABLE= +DISABLED= DISABLEDACT= DISALLOW= DISCARD= @@ -820,6 +844,7 @@ DIVIDE=The DIVIDE statement divides one numeric data item into or by others and DIVISION=The DIVISION keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. DLI= DLL= +DM=Domain manager DNAME= DNAMELEN= DO= @@ -830,17 +855,20 @@ DOCTEMPLATE= DOCTOKEN= DOCUMENT= DOMAIN= +DOMAINMGR=Domain manager DOUBLE= DOUBLEQUOTE= DOUBLE_PRECISION= DOWN=When the format-2 SET statement is executed, the contents of the receiving field are decreased by a value that corresponds to the number of occurrences represented by the value of identifier-3 or integer-2.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpssetb.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. DP= +DP=Debugging Profiles domain DPLLIMIT= DPSEGSZ= DROLLBACK= DROP= DROPIN= DS3270= +DS=Dispatch manager DSALIMIT= DSANAME= DSNAME01= @@ -862,15 +890,18 @@ DSNAME16= DSNAME= DSNAMELIST= DSNDB04= +DSNNOTFOUND= DSN_XMLVALIDATE= DSPLIST= DSRTPROGRAM= DSSCS= DSSIZE= +DSSTAT= DTIMEOUT= DTR= DTRPROGRAM= DU= +DU=Dump manager DUALCASEST= DUMP= DUMPCODE= @@ -878,9 +909,11 @@ DUMPDS= DUMPID= DUMPING= DUMPSCOPE= +DUPKEY= DUPLICATE= DUPLICATES=The DUPLICATES keyword is a parameter for the ALTERNATE RECORD KEY clause and the SORT statement.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. DUPREC= +DUPRES= DURATION= DYN= DYNAM= @@ -892,6 +925,7 @@ EAU= EBCDIC=The EBCDIC collating sequence is used for all alphanumeric comparisons.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsmerg.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EBCDIC_CHR= EBCDIC_STR= +EC=Event capture ECADDR= ECBLIST= ECDSASIZE= @@ -902,7 +936,9 @@ EDITPROC= EDSALIMIT= EGCS=A category name in the INITIALIZE statement.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsinit.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EGI= +EI=EXEC interface EIB= +EJ=Enterprise Javaâ„¢ domain EJECT= EJPD= ELEMENT64= @@ -915,6 +951,7 @@ ELEMNSLEN= ELIGIBLE= ELSE=Use IF . . . ELSE to code a choice between two processing actions. (The word THEN is optional.) Use the EVALUATE statement to code a choice among three or more possible actions.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tpctl04.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ELSEIF= +EM=Event manager EMI= EMITMODE= EMPTY= @@ -925,10 +962,9 @@ ENABLEDCOUNT= ENABLESTATUS= ENCODING= ENCRYPTION= +ENCRYPTKEY= ENCRYPT_DATAKEY= ENCRYPT_TDES= -ENCRYPTION= -ENCRYPTKEY= END-ACCEPT= END-ADD=This explicit scope terminator serves to delimit the scope of the ADD statement.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsadd.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. END-CALL=This explicit scope terminator serves to delimit the scope of the CALL statement.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpscall.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -955,8 +991,10 @@ END=The END keyword has several functions.
[Search IBM documentation](https:/ ENDACTIVITY= ENDBR= ENDBROWSE= +ENDDATA= ENDFILE= ENDING= +ENDINPT= ENDOFDAY= ENDOFDAYHRS= ENDOFDAYMINS= @@ -968,18 +1006,24 @@ END_EXEC= ENFORCED= ENGLISH= ENQ= +ENQBUSY= ENQFAILS= ENQMODEL= ENQNAME= ENQSCOPE= +ENQUEUE=Enqueue domain ENTER=The ENTER statement is designed to facilitate the use of more than one source language in the same source program. However, only COBOL is allowed in the source program.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlcdsent.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +ENTJAVA=Enterprise Javaâ„¢ domain ENTRY=The ENTRY statement establishes an alternate entry point into a COBOL called subprogram.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsentr.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ENTRYNAME= ENTRYPOINT= +ENVDEFERR= ENVIRONMENT=In the ENVIRONMENT DIVISION of a program, you describe the aspects of the program that depend on the computing environment.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tppgm10.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EOC= EODS= +EOF= EOP=When END-OF-PAGE is specified, and the logical end of the printed page is reached during execution of the WRITE statement, the END-OF-PAGE imperative-statement is executed.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpswrit.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +EP=Event processing domain EPADAPTER= EPADAPTERNUM= EPADAPTERRES= @@ -1000,6 +1044,7 @@ EQUALCHAR= ERASE= ERASEAUP= ERDSASIZE= +ERROR= ERROR=The ERROR keyword can refer to the SIZE ERROR phrase and the EXCEPTION/ERROR declarative.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ERRORMSG= ERRORMSGLEN= @@ -1015,7 +1060,11 @@ EUR= EVALUATE=The EVALUATE directive provides a multi-branch method of choosing the source lines to include in a compilation group.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rldireva.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EVENT= EVENTBINDING= +EVENTERR= +EVENTCAPTURE=Event capture +EVENTMGR=Event manager EVENTNAME= +EVENTPROC=Event processing domain EVENTPROCESS= EVENTTYPE= EVENTUAL= @@ -1034,9 +1083,9 @@ EXEC= EXECKEY= EXECUTABLE= EXECUTE= -EXHIBIT= EXECUTIONSET= EXEC_CICS= +EXHIBIT= EXISTS= EXIT=To end a program, you must use an EXIT PROGRAM, STOP RUN, or GOBACK statement.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/migrate/igymch1644.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EXITPGM= @@ -1045,6 +1094,7 @@ EXITS= EXITTRACING= EXP= EXPECT= +EXPIRED= EXPIRYINT= EXPIRYINTMIN= EXPIRYTIME= @@ -1078,6 +1128,7 @@ FAULTCODELEN= FAULTCODESTR= FAULTSTRING= FAULTSTRLEN= +FC=File control and DL/I FCI= FCT= FD=The FD keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -1096,6 +1147,7 @@ FILE=The FILE keyword has several functions.
[Search IBM documentation](https FILECOUNT= FILELIMIT= FILENAME= +FILENOTFOUND= FILEPATH= FILLER=A data item that is not explicitly referred to in a program.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddelev.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. FILTERVALUE= @@ -1131,8 +1183,8 @@ FORTRAN= FOUND= FREE= FREEKB= -FREEMAIN= FREEMAIN64= +FREEMAIN= FREEPAGE= FREQUENCY= FREQUENCYHRS= @@ -1152,6 +1204,7 @@ FS= FSRT= FULL= FULLDATE= +FUNCERR= FUNCTION-ID=The FUNCTION-ID paragraph specifies the name by which the function is known and assigns selected function attributes to that function.
[Read more](https://www.ibm.com/docs/en/cobol-zos/6.4?topic=division-function-id-paragraph)
\u00A9 Copyright IBM Corporation 1994, 2024.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. FUNCTION-POINTER=The FUNCTION-POINTER phrase defines an item as a *function-pointer data item*. A function-pointer data item can contain the address of a procedure entry point.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddefnc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. FUNCTION=A function-identifier is a sequence of character strings and separators that uniquely references the data item that results from the evaluation of a function.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlreffun.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -1165,8 +1218,10 @@ F_CHAR= GAENTRYNAME= GALENGTH= GARBAGEINT= +GASET= GAUSECOUNT= GBPCACHE= +GC=CICS global catalog manager GCDSASIZE= GCHARS= GCODES= @@ -1182,11 +1237,13 @@ GENERICTCPS= GET= GETHINT= GETMAIN= +GETMAIN64= GETNEXT= GETVARIABLE= GET_ACCEL_ARCHIVE= GIVING=For arithmetic statements , the value of the identifier that follows the word GIVING is set equal to the calculated result of the arithmetic operation.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdsgiv.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. GLOBAL=The GLOBAL clause specifies that the file connector named by a file-name is a global name. A global file-name is available to the program that declares it and to every program that is contained directly or indirectly in that program.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfdeglo.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +GLOBALCATLG=CICS global catalog manager GMEXITOPT= GMMI= GMMLENGTH= @@ -1255,6 +1312,7 @@ HTTPVERSION= HTTPVNUM= I-O-CONTROL=The I-O-CONTROL paragraph of the input-output section specifies when checkpoints are to be taken and the storage areas to be shared by different files.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rliosioc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. I-O=Permits both input and output operations.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsopen.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +IC=Interval control ID= IDENTICAL= IDENTIFICATION=The identification division names the program, class, or method and identifies the factory definition and object definition.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlide.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -1266,19 +1324,25 @@ IDLEMINS= IDLESECS= IDNTYCLASS= IDPROP= +IE=ECI over TCP/IP domain IF=The IF directive provides for a one-way or two-way conditional compilation.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rldirif.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. IFNULL= IGNORE= IGNORED= +IGREQCD= +IGREQID= +ILLOGIC= IMAGCOPY= IMMEDIATE= IMPLICIT= IMPLICITLY= IMPLICIT_SCHEMA= IN= +INBFMH= INCLUDE= INCLUDING= INCLUSIVE= +INCOMPLETE= INCREMENT= INCREMENTED= INDEX=A data item defined with the INDEX phrase is an *index data item*.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddeind.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -1345,7 +1409,10 @@ INTOCODEPAGE= INTSTATUS= INVALID=You can include an INVALID KEY phrase in READ, START, WRITE, REWRITE, and DELETE statements for VSAM indexed and relative files. The INVALID KEY phrase is given control if an input or output error occurs due to a faulty index key.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tperr16.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. INVALIDCOUNT= +INVERRTERM= +INVEXITREQ= INVITE= +INVLDC= INVMPSZ= INVOKE=The INVOKE statement can create object instances of a COBOL or Javaâ„¢ class and can invoke a method defined in a COBOL or Java class.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsinvo.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. INVOKEBIND= @@ -1354,12 +1421,16 @@ INVOKERUN= INVOKETYPE= INVOKINGPROG= INVPARTN= +INVPARTNSET= INVREQ= +INVTSREQ= IO= +IOERR= IOTYPE= IPADDRESS= IPCONN: I P C O N N; IPCONN= +IPECI=ECI over TCP/IP domain IPFACILITIES= IPFACILITY= IPFACILTYPE= @@ -1368,6 +1439,8 @@ IPFLISTSIZE= IPRESOLVED= IRC= IS= +ISCINVREQ= +IS=Intersystem communication ISO= ISOLATEST= ISOLATION= @@ -1375,6 +1448,7 @@ ISSUE= ISSUER= ISUSERID= ITEM= +ITEMERR= ITEMNAME= ITERATE= IUTYPE= @@ -1384,6 +1458,7 @@ JAR= JAVA= JAVAHOME= JCT= +JIDERR= JIS= JNIENVPTR=The JNIENVPTR special register references the Java Native Interface (JNI) environment pointer. The JNI environment pointer is used in calling Java callable services.
JNIENVPTR is implicitly defined as USAGE POINTER, and cannot be specified as a receiving data item.
[Read more](https://www.ibm.com/docs/en/cobol-zos/6.3?topic=registers-jnienvptr)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. JOBLIST= @@ -1404,16 +1479,20 @@ JUSTIFY= JVMCLASS= JVMENDPOINT= JVMPROFILE= +JVMPROGRAM= JVMSERVER= JWT= KA= KANJI=The Kanji class test tests for valid Japanese graphic characters. This testing includes Katakana, Hiragana, Roman, and Kanji character sets.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tpnls13.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. KATAKANA= KATAKANAST= +KC=Task control +KE=Kernel KEEP= KEEPTIME= -KERBEROS= KEPT= +KERBEROS= +KERNEL=Kernel KEY=The KEY keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. KEYBOARD= KEYLENGTH= @@ -1439,6 +1518,12 @@ LASTCOLDTIME= LASTEMERTIME= LASTINITTIME= LASTMODTIME= +LASTRESET= +LASTRESETABS= +LASTRESETHRS= +LASTRESETMIN= +LASTRESETSEC= +LASTSECDTIME= LASTUSEDINT= LASTUSETIME= LASTWARMTIME= @@ -1446,10 +1531,10 @@ LASTWRITTIME= LAST_DAY= LAST_VALUE1= LAST_VALUE= -LATSECDTIME= LC= LCASE= LC_CTYPE= +LD=Program load manager LDC= LDCMNEM= LDCNUM= @@ -1461,12 +1546,14 @@ LEAST= LEAVE= LEAVEKB= LEFT=Specifies that the elementary item is to be positioned so that it will begin at the left character position of the natural boundary in which the elementary item is placed.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddesyn.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +LENGERR= LENGTH=The LENGTH function returns an integer equal to the length of the argument in national character positions for arguments of usage NATIONAL and in alphanumeric character positions or bytes for all other arguments. An alphanumeric character position and a byte are equivalent.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlinflen.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LENGTHLIST= LERUNOPTS= LESS=A general relation condition.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdsgen.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LEVEL= LEVELS= +LG=Log manager LIB= LIBRARY= LIBRARYDSN= @@ -1485,6 +1572,7 @@ LINEADDR= LINECOUNT= LINES=DATA DIVISION parameter.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfde.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LINK= +LINKABEND= LINKAGE=The LINKAGE SECTION describes data made available from another program or method.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rldadls.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LINKAUTH= LINKLEVEL= @@ -1497,14 +1585,18 @@ LISTSIZE= LITERALS= LLID= LM= +LM=Lock manager LN= LOAD= +LOADING= +LOADER=Program load manager LOADLIB= LOADPOINT= LOADTYPE= LOB= LOCAL-STORAGE=The LOCAL-STORAGE SECTION defines storage that is allocated and freed on a per-invocation basis.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rldadlss.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LOCAL= +LOCALCATLG=CICS local catalog manager LOCALCCSID= LOCALE= LOCALITY= @@ -1518,12 +1610,14 @@ LOCATORS= LOCK=The compiler ensures that this file cannot be opened again during this execution of the object program. If the file is a tape unit, it will be rewound and unloaded.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsclosa.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LOCKED= LOCKMAX= +LOCKMGR=Lock manager LOCKS= LOCKSIZE= LOG10= LOG= LOGDEFER= LOGGED= +LOGGER=Log manager LOGMESSAGE= LOGMODE= LOGONLOGMODE= @@ -1546,6 +1640,7 @@ LOW_VALUE= LOW_VALUES= LPAD= LPASTATUS= +LSRPOOL= LSRPOOLNUM= LTERM= LTRIM= @@ -1555,6 +1650,7 @@ MAID= MAIN= MAINTAINED= MAJORVERSION= +MANAGEDPLAT=Managed platform domain MANUAL= MAP= MAPCOLUMN= @@ -1607,6 +1703,7 @@ MCC= MD= MDECK= MDT= +ME=Message manager MEDIATYPE= MEMBER= MEMBERNAME= @@ -1645,10 +1742,13 @@ MINUTES= MINVALUE= MIRRORLIFE= MIXED= +ML=Markup language domain MMDDYY= MMDDYYYY= +MN=Monitoring manager MOD= MODE=The MODE keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +MODELIDERR= MODENAME= MODIFIED= MODIFIERS= @@ -1668,6 +1768,7 @@ MONUSERID= MORE-LABELS= MORECHAR= MOVE=The MOVE statement transfers data from one area of storage to one or more other areas.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsmove.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +MP=Managed platform domain MQCONN= MQINI= MQMONITOR= @@ -1719,6 +1820,7 @@ NCNAME= NEGATIVE=Specifies a value less than 0.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdssig.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. NETID= NETNAME= +NETNAMEIDERR= NETUOWID= NETWORK= NETWORKID= @@ -1779,6 +1881,7 @@ NODEBUG= NODECK= NODEFER= NODEHOME= +NODEIDERR= NODEJSAPP= NODENAME= NODIAGTRUNC= @@ -1810,6 +1913,7 @@ NOHANDLE= NOHOOK= NOINCONVERT= NOIO= +NOJBUFSP= NOKBD= NOLENGTH= NOLIB= @@ -1822,10 +1926,12 @@ NOMDECK= NOMDT= NOMINVALUE= NONAME= +NOLOG= NONE= NONTERMREL= NONUM= NONUMBER= +NONVAL= NOOBJ= NOOBJECT= NOOFF= @@ -1838,6 +1944,8 @@ NOOPTIONS= NOORDER= NOOUTCONERT= NOP= +NOPASSBKRD= +NOPASSBKWR= NOPFD= NOPROLOG= NOPRT= @@ -1855,27 +1963,37 @@ NOSEPARATE= NOSEQ= NOSEQUENCE= NOSOURCE= +NOSPACE= NOSPAN= NOSPIE= +NOSPOOL= NOSQL= NOSQLC= NOSQLCCSID= NOSRVCONVERT= NOSSR= NOSSRANGE= +NOSTART= NOSTDTRUNC= +NOSTG= NOSUSPEND= NOT=A logical or relational operator.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdsabb.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +NOTALLOC= +NOTAUTH= NOTE= NOTERM= NOTERMINAL= NOTEST= +NOTFINISHED= +NOTFND= NOTHREAD= NOTIFICATION= NOTIFY= +NOTOPEN= NOTPURGEABLE= NOTRIG= NOTRUNCATE= +NOTSUPERUSER= NOUNDERSCORE= NOVBREF= NOWAIT= @@ -1885,6 +2003,7 @@ NOWRITE= NOX= NOXREF= NOZWB= +NQ=Enqueue domain NQNAME= NS= NSCONTAINER= @@ -1901,7 +2020,7 @@ NULTERM= NUM= NUMBER=Use the NUMBER compiler option if you have line numbers in your source code and want those numbers to be used in error messages and SOURCE, MAP, LIST, and XREF listings.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ui/up1050.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. NUMCIPHERS= -NUMDATAPRD= +NUMDATAPRED= NUMDSNAMES= NUMELEMENTS= NUMERIC-DATE= @@ -1925,6 +2044,7 @@ OBID= OBJ= OBJECT-COMPUTER=The OBJECT-COMPUTER paragraph specifies the system for which the object program is designated.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlconobj.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. OBJECT= +OBJECTTRAN=Object Transaction Service (OTS) domain OBOPERIDST= OCCUPANCY= OCCURS=To code a table, give the table a group name and define a subordinate item (the table element) to be repeated n times.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tptbl03.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -1966,6 +2086,7 @@ ONLY= OP= OPCLASS= OPEN=The OPEN statement initiates the processing of files. It also checks or writes labels, or both.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsopen.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +OPENERR= OPENSTATUS= OPERATION= OPERATOR= @@ -2005,6 +2126,7 @@ OSGISERVICE= OSGISTATUS= OSGIVERSION= OSLEVEL= +OT=Object Transaction Service (OTS) domain OTHER=An EVALUATE parameter.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rldireva.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. OTSTID= OTSTIMEOUT= @@ -2012,6 +2134,7 @@ OUT= OUTCOME= OUTDD= OUTDESCR= +OUTDESCRERR= OUTER= OUTIN= OUTLINE= @@ -2021,6 +2144,7 @@ OUTPUT=Permits output operations.
[Read more](https://www.ibm.com/support/kno OUTTOKEN= OUTTOKENLEN= OVER= +OVERFLOW= OVERFLOW=Whether the ON OVERFLOW condition is raised for errors other than "out of storage" errors depends on the setting of the CMPR2/NOCMPR2 option.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/migrate/igymch1612.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. OVERLAPS= OVERLAY= @@ -2035,6 +2159,7 @@ PA2= PA3:= PA3= PA= +PA=Parameter manager PACK= PACKADM= PACKAGE= @@ -2058,6 +2183,7 @@ PAGING= PARAGRAPH= PARALLEL= PARAMETER= +PARAMGR=Parameter manager PARMS= PARSE= PART= @@ -2067,9 +2193,11 @@ PARTIAL= PARTITION= PARTITIONED= PARTITIONING= +PARTITIONSET= PARTITIONSST= PARTN= PARTNER= +PARTNERIDERR= PARTNFAIL= PARTNPAGE= PARTNS= @@ -2084,6 +2212,7 @@ PASSWORD=The PASSWORD clause controls access to files.
[Read more](https://ww PASSWORDLEN= PATH= PATHLENGTH= +PC=Program control PCDSASIZE= PCT= PCTFREE= @@ -2098,15 +2227,6 @@ PERFORM=The PERFORM statement transfers control explicitly to one or more proced PERIOD= PERMANENT= PERMISSION= -PF1= -PF2= -PF3= -PF4= -PF5= -PF6= -PF7= -PF8= -PF9= PF10= PF11= PF12= @@ -2117,14 +2237,25 @@ PF16= PF17= PF18= PF19= +PF1= PF20= PF21= PF22= PF23= PF24= +PF2= +PF3= +PF4= +PF5= +PF6= +PF7= +PF8= +PF9= PF= PFD= PFXLENG= +PGMIDERR= +PG=Program manager PGMINTERFACE= PGMN= PGMNAME= @@ -2136,6 +2267,7 @@ PHRASELEN= PHSTARTTIME= PHTASKID= PHTRANSID= +PI=Pipeline manager domain PIC=The PICTURE clause specifies the general characteristics and editing requirements of an elementary item.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddepic.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. PICTURE=The PICTURE clause specifies the general characteristics and editing requirements of an elementary item.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddepic.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. PID= @@ -2143,6 +2275,7 @@ PIECESIZE= PINK= PIPE= PIPELINE= +PIPEMGR=Pipeline manager domain PIPLENGTH= PIPLIST= PLAN= @@ -2156,6 +2289,7 @@ POINTER=A data item defined with USAGE IS POINTER is a *pointer data item*, or * POLICY= POLICYRULE= POOL= +POOLERR= POOLNAME= POP= PORT= @@ -2199,17 +2333,23 @@ PROCEDURE=The PROCEDURE DIVISION is an optional division.
[Read more](https:/ PROCEDURES=The ALL PROCEDURES phrase can be specified only once in a program. Only the procedures contained in the outermost program will trigger execution of the debugging section.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlcdsused.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. PROCEED=An optional keyword for the ALTER statement.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsalte.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. PROCESS=With the CBL (PROCESS) statement, you can specify compiler options to be used in the compilation of the program. The CBL (PROCESS) statement is placed before the IDENTIFICATION DIVISION header of an outermost program.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlcdscbl.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +PROCESSBUSY= +PROCESSERR= PROCESSING= PROCESSTYPE= PROCLENGTH= PROCNAME= PROFILE= PROFILEDIR= +PROFILEIDERR= +PROGAUTO= PROGAUTOCTLG= PROGAUTOEXIT= PROGAUTOINST= +PROGMGR=Program manager PROGRAM-ID=The PROGRAM-ID paragraph specifies the name by which the program is known and assigns selected program attributes to that program.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlidepid.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. PROGRAM=The PROGRAM keyword is part of the EXIT PROGRAM statement and the PROGRAM COLLATING SEQUENCE clause.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +PROGRAMDEF= PROGSYMBOLST= PROGTYPE= PROLOG= @@ -2226,6 +2366,7 @@ PSDINTHRS= PSDINTMINS= PSDINTSECS= PSTYPE= +PT=Partner manager PTCOUNT= PTERM= PTHREADS= @@ -2245,6 +2386,8 @@ PURGECYCLES= PURGETHRESH= PUSH= PUT= +QBUSY= +QIDERR= QNAME= QUALIFIER= QUALLEN= @@ -2262,6 +2405,8 @@ QUEUELIMIT= QUIESCESTATE= QUOTE=Represents one or more occurrences of the apostrophe or quotation mark characters.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rllancon.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. QUOTES=Represents one or more occurrences of the apostrophe or quotation mark characters.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rllancon.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +QZERO= +RA=Resource manager adapters RADIANS= RAISE_ERROR= RAND= @@ -2295,6 +2440,7 @@ RECEIVER= RECFM= RECOMMEND= RECORD=The RECORD keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +RECORDBUSY= RECORDFORMAT= RECORDING=The RECORDING MODE clause specifies the format of the physical records in a QSAM file. The clause is ignored for a VSAM file.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfdermc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. RECORDLEN= @@ -2304,6 +2450,7 @@ RECORDSIZE= RECOVER= RECOVERDB= RECOVERY= +RECOVERY=Recovery manager RECOVSTATUS= RECURSIVE=An optional clause that allows COBOL programs to be recursively reentered.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlidepid.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. RED= @@ -2326,6 +2473,7 @@ REGEXP_INSTR1= REGEXP_LIKE1= REGEXP_REPLACE1= REGEXP_SUBSTR1= +REGIONSTAT=Region status REGIONUSERID= REGISTERS= REGR_AVGX= @@ -2374,6 +2522,7 @@ REPORTING= REPORTS= REQID= REQTYPE= +REQUESTSTRM=Request streams domain REQUESTTYPE= REQUIRED= RERUN=The RERUN clause specifies that checkpoint records are to be taken. Subject to the restrictions given with each phrase, more than one RERUN clause can be specified.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rliosrer.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -2388,9 +2537,12 @@ RESETMDT= RESID= RESIDENCY= RESIDENT= +RESIDERR= +RESIDLEN= RESIDLENGTH= RESIGNAL= RESLEN= +RESLIFEMGR=Resource life-cycle domain RESNAME= RESOLUTION= RESOLVE= @@ -2409,14 +2561,15 @@ RESTRICT= RESTYPE= RESULT= RESUME= +RESUNAVAIL= RESYNCMEMBER= -RESYNCNUMBER= RESYNCSTATUS= RETAIN= RETCODE= RETCORD= RETENTION= RETLOCKS= +RETPAGE= RETRIECE= RETRIEVAL= RETRIEVE= @@ -2436,17 +2589,23 @@ REVOKE= REWIND=WITH NO REWIND is a parameter in the OPEN and CLOSE statements.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. REWRITE=The REWRITE statement logically replaces an existing record in a direct-access file. When the REWRITE statement is executed, the associated direct-access file must be open in I-O mode.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsrewr.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. REXX_LANGUAGE= +RI=Resource manager interface (RMI) RID= RIDFLD= RIGHT=Specifies that the elementary item is to be positioned such that it will terminate on the right character position of the natural boundary in which it has been placed.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddesyn.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +RL=Resource life-cycle domain RLSACCESS= RLSSTATUS= +RM=Recovery manager +RMI=Resource manager interface (RMI) +RMIADAPTERS=Resource manager adapters RMIQFY= RMIST= RMODE= ROLE= ROLELENGTH= ROLLBACK= +ROLLEDBACK= ROLLUP= ROTATE= ROUND= @@ -2477,8 +2636,12 @@ RR= RRESOURCE= RRMS= RRN= +RRS=Resource recovery services RS= +RTEFAIL= +RS=Region status RTERMID= +RTESOME= RTIMEOUT= RTRANSID= RTRIM= @@ -2493,13 +2656,17 @@ RUNAWAYTYPE= RUNNING= RUNSTATUS= RUNTIME= +RX=Resource recovery services +RZ=Request streams domain SADDRLENGTH= SAME=The SAME keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SAVE= SAVEPOINT= SBCS= +SC=Storage control SCALE= SCANDELAY= +SCHEDULER=Scheduler services domain for BTS SCHEMALEVEL= SCHEME= SCHEMENAME= @@ -2533,6 +2700,7 @@ SECURITY=Level of confidentiality of the program. An optional paragraph in the I SECURITYMGR= SECURITYNAME= SECURITYST= +SEGIDERR= SEGMENT-LIMIT=The SEGMENT-LIMIT clause is syntax checked but has no effect on the execution of the program.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlconobj.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SEGMENT= SEGMENTLIST= @@ -2541,6 +2709,7 @@ SELECT=The SELECT clause identifies a file in the COBOL program to be associated SELECTIVE= SELECTIVITY= SELF= +SELNERR= SEND= SENDCOUNT= SENDER= @@ -2566,13 +2735,17 @@ SERVERPORT= SERVER_NAME= SERVICE= SERVSTATUS= +SESSBUSY= SESSION= +SESSIONERR= +SESSIONS= SESSIONTYPE= SESSION_USER= SESSTOKEN= SET=The SET statement is used to perform various operations.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsset.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SETS= SETTRANSID= +SH=Scheduler services domain for BTS SHARE= SHARED= SHARELOCKS= @@ -2600,14 +2773,18 @@ SINGLESTATUS= SINH= SIT= SIZE=The SIZE keyword appears in the SIZE ERROR phrase and the MEMORY SIZE clause.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +SJ=CICS JVM domain +SJVM=CICS JVM domain SKIP1= SKIP2= SKIP3= SKIP= SKIPCHAR= +SM=Storage manager SMALLINT= SNAMELENGTH= SNAPSHOT= +SO=Sockets SOAPFAULT= SOAPHTTPC= SOAPHTTPNC= @@ -2617,6 +2794,7 @@ SOAPLEVEL= SOAPRNUM= SOAPVNUM= SOCKETCLOSE= +SOCKETS=Sockets SOCKPOOLSIZE= SOME= SORT-CONTROL=The SORT-CONTROL special register is the name of an alphanumeric data item.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rllansc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -2646,6 +2824,8 @@ SPECIFIC= SPECIFTCPS= SPIE= SPIST= +SPOLBUSY= +SPOLERR= SPOOLCLOSE= SPOOLOPEN= SPOOLREAD= @@ -2679,6 +2859,7 @@ SSLCACHE= SSLTYPE= SSR= SSRANGE= +ST=Statistics manager STABILIZED= STACKED= STANDARD-1=When at least one file in the program is an ASCII-encoded file, the alphabet-name clause of the SPECIAL-NAMES paragraph must be specified; the alphabet-name must be associated with STANDARD-1 or STANDARD-2 (for ASCII or ISCII collating sequence or CODE SET, respectively).
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlascob.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -2736,6 +2917,7 @@ STORES= STORIES= STOSPACE= STREAMNAME= +STRELERR= STRFIELD= STRING=The STRING statement strings together the partial or complete contents of two or more data items or literals into one single data item.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsstri.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. STRINGFORMAT= @@ -2762,6 +2944,9 @@ SUBEVENT7= SUBEVENT8= SUBEVENT= SUBPOOL= +SUBRESID= +SUBRESIDLEN= +SUBRESTYPE= SUBSCHEMA-AREANAMES= SUBSCHEMA-BINDS= SUBSCHEMA-CONTROL= @@ -2780,6 +2965,7 @@ SUBTRACT=The SUBTRACT statement subtracts one numeric item, or the sum of two or SUM=The SUM function returns a value that is the sum of the arguments.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlinfsum.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SUMMARY= SUPPRESS=Use the NOSUPPRESS option to ignore the SUPPRESS phrase of all COPY statements in a program so that copybook information can appear in the listing.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/custom/igycchsup.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +SUPPRESSED= SUSPEND= SUSPENDED= SUSPENDTIME= @@ -2789,6 +2975,7 @@ SUSPSTATUS= SWITCH= SWITCHSTATUS= SYMBOL= +SYMBOLERR= SYMBOLIC=The SYMBOLIC CHARACTERS clause is applicable only to single-byte character sets. Each character represented is an alphanumeric character.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlconsym.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SYMBOLLIST= SYNC=The SYNCHRONIZED clause specifies the alignment of an elementary item on a natural boundary in storage.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddesyn.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -2800,6 +2987,7 @@ SYNCPOINT= SYNCPOINTST= SYNONYM= SYSADM= +SYSBUSY= SYSCTRL= SYSDEFLT= SYSDUMPCODE= @@ -2807,6 +2995,7 @@ SYSDUMPING= SYSEIB= SYSIBM= SYSID= +SYSIDERR= SYSOPR= SYSOUTCLASS= SYSTEM= @@ -2816,6 +3005,7 @@ SYSTEM_TIME= SYSTEM_USER= SYSVERSION= SZ= +SZ=Front-end programming interface S_CHAR= TABLE= TABLENAME= @@ -2836,14 +3026,18 @@ TASK= TASKDATAKEY= TASKDATALOC= TASKID= +TASKIDERR= TASKPRIORITY= TASKS= TASKSTARTST= +TASKSUBPOOL= +TC=Terminal control TCAMCONTROL= TCB= TCBLIMIT= TCBS= TCEXITSTATUS= +TCIDERR= TCLASS= TCPIP= TCPIPJOB= @@ -2857,13 +3051,16 @@ TDQUEUE= TELLERID= TEMPLATE= TEMPLATENAME= +TEMPLATERR= TEMPLATETYPE= TEMPORAL= TEMPORARY= TEMPSTORAGE= TERM= TERMCODE= +TERMERR= TERMID= +TERMIDERR= TERMINAL=Use TERMINAL to send progress and diagnostic messages to the SYSTERM ddname.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ui/up2070.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. TERMINATE= TERMMODEL= @@ -2889,10 +3086,13 @@ THREADWAIT= THRESHOLD= THROUGH=THROUGH is a parameter in the PERFORM with TIMES phrase and the CLASS clause.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. THRU=THRU is a parameter in the PERFORM with TIMES phrase and the CLASS clause.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +TI=Timer manager TIME=The conceptual data items DATE, DATE YYYYMMDD, DAY, DAY YYYYDDD, DAY-OF-WEEK, and TIME implicitly have USAGE DISPLAY. Because these are conceptual data items, they cannot be described in the COBOL program.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsaccec.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +TIMEDOUT= TIMEOUT= TIMEOUTINT= TIMER= +TIMERERR= TIMES=The TIMES phrase can be specified in a PERFORM statement or an OCCURS clause.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. TIMESEP= TIMESTAMP= @@ -2916,6 +3116,7 @@ TODAYS-DATE= TODAYS-NAME= TOFLENGTH= TOKEN= +TOKENERR= TOKENLEN= TOKENTYPE= TOLENGTH= @@ -2929,6 +3130,7 @@ TO_NUMBER= TO_TIMESTAMP= TPNAME= TPNAMELEN= +TR=Trace manager TRACE= TRACEDEST= TRACEFLAG= @@ -2943,10 +3145,13 @@ TRANCLASS= TRANDUMPCODE= TRANDUMPING= TRANISOLATE= +TRANMGR=Transaction manager TRANPRIORITY= TRANSACTION= +TRANSCLASS= TRANSFORM= TRANSID= +TRANSIDERR= TRANSLATE= TRANSLATION= TRANSMODE= @@ -2968,6 +3173,7 @@ TRUNCATED= TRUNC_TIMESTAMP= TRUSTED= TS= +TSIOERR= TSMAININUSE= TSMAINLIMIT= TSMODEL= @@ -2987,11 +3193,13 @@ TYPENAME= TYPENAMELEN= TYPENS= TYPENSLEN= +TYPETERM= TYPES= UCASE= UCTRANST= UDSASIZE= UE= +UE=User exit interface UNATTEND= UNBOUNDED= UNCOMMITTED= @@ -3017,6 +3225,8 @@ UOW= UOWDSNFAIL= UOWENQ= UOWLINK= +UOWLNOTFOUND= +UOWNOTFOUND= UOWSTATE= UP=When the format-2 SET statement is executed, the contents of the receiving field are increased by a value that corresponds to the number of occurrences represented by the value of identifier-3 or integer-2.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpssetb.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. UPDATE= @@ -3032,6 +3242,7 @@ URIMAPLIMIT= URL= URLLENGTH= URM= +US=User interface USA= USAGE-MODE= USAGE=The USAGE clause specifies the format in which data is represented in storage.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddeusa.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -3044,6 +3255,7 @@ USERAUTH= USERCORRDATA= USERDATAKEY= USERID= +USERIDERR= USERNAME= USERNAMELEN= USERPRIORITY= @@ -3089,18 +3301,23 @@ VFORMST= VIEW= VIRTUAL= VOLATILE= +VOLIDERR= VOLUME= VOLUMELENG= VOLUMES= VTAM= +W2=Web 2.0 domain WAIT= WAITCAUSE= WAITCICS= WAITFORDATA= WAITSTATE= +WB=Web domain WCC= WD= +WEB2=Web 2.0 domain WEB= +WEBRESTMGR=CICS Management Client Interface (CMCI) domain (previously called System Management RESTful API) WEBSERVICE= WEBSERVLIMIT= WEEK= @@ -3132,6 +3349,7 @@ WPMEDIA= WRAP= WRAPPED= WRAPPER= +WRBRK= WRITE-ONLY= WRITE=The WRITE statement releases a logical record to an output or input/output file.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpswrit.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. WRITEQ= @@ -3141,11 +3359,13 @@ WSAEPR= WSBIND= WSDIR= WSDLFILE= +WU=CICS Management Client Interface (CMCI) domain (previously called System Management RESTful API) W_CHAR= XCFGROUP= XCTL= XID= XLNSTATUS= +XM=Transaction manager XML= XMLAGG= XMLATTRIBUTES= @@ -3177,6 +3397,7 @@ XP= XRBA= XREF= XRFSTATUS= +XS=Transaction manager XSDBIND= XSLTRANSFORM= YEAR= diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessorTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessorTest.java index 676fc4e8e6..429351229e 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessorTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/implicitDialects/cics/processor/CICSImplicitVariablesProcessorTest.java @@ -32,13 +32,15 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; +import java.util.HashMap; +import java.util.LinkedList; + /** * Test for CICSImplicitVariablesProcessor */ @ExtendWith(MockitoExtension.class) class CICSImplicitVariablesProcessorTest { private static final int CICS_INTRODUCED_REGISTERS_COUNT = 72; - @Mock private ProcessingContext processingContext; @Mock private VariableAccumulator variableAccumulator; CICSImplicitVariablesProcessor processor; @@ -46,13 +48,13 @@ class CICSImplicitVariablesProcessorTest { @BeforeEach void init() { processor = new CICSImplicitVariablesProcessor(); + processingContext = new ProcessingContext(new LinkedList<>(), variableAccumulator, new HashMap<>()); } @Test void testLinkageSectionWhenCicsTranslateEnabled() { SectionNode sectionNode = new SectionNode(Locality.builder().build(), SectionType.LINKAGE); sectionNode.setParent(new ProgramNode(Locality.builder().build(), ProgramSubtype.Program, 0)); - when(processingContext.getVariableAccumulator()).thenReturn(variableAccumulator); assertNotNull(processingContext.getVariableAccumulator()); assertEquals(variableAccumulator, processingContext.getVariableAccumulator()); processor.accept(sectionNode, processingContext); @@ -61,7 +63,6 @@ void testLinkageSectionWhenCicsTranslateEnabled() { @Test void testWorkingSectionWhenCicsTranslateEnabled() { - doReturn(variableAccumulator).when(processingContext).getVariableAccumulator(); SectionNode sectionNode = new SectionNode(Locality.builder().build(), SectionType.WORKING_STORAGE); sectionNode.setParent(new ProgramNode(Locality.builder().build(), ProgramSubtype.Program, 0)); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAddSubevent.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAddSubevent.java index c74c97346e..561db49d2a 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAddSubevent.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAddSubevent.java @@ -14,12 +14,12 @@ */ package org.eclipse.lsp.cobol.usecases; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; - import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -37,7 +37,7 @@ public class TestCICSAddSubevent { private static final String ADD_EVENT_SUBEVENT = "ADD EVENT({$varFour}) SUBEVENT({$varFour})"; private static final String ADD_INVALID = - "{ADD | error} "; + "ADD "; private static final String ADD_EVENT_INVALID = "ADD {EVENT(100) | errorMissingSubevent} "; private static final String ADD_SUBEVENT_INVALID = @@ -54,13 +54,13 @@ void testAddSubEventValidOne() { void testAddInvalid() { Map expectedDiagnostic = ImmutableMap.of( - "error", + "end-exec-error", new Diagnostic( - new Range(new Position(13, 12), new Position(13, 20)), + new Range(), "Syntax error on 'END-EXEC'", DiagnosticSeverity.Error, ErrorSource.PARSING.getText())); - CICSTestUtils.errorTest(ADD_INVALID, expectedDiagnostic); + CICSTestUtils.errorTestWithEndExecError(ADD_INVALID, ImmutableList.of(), expectedDiagnostic); } @Test void testAddSubEventInvalid() { diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAsktime.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAsktime.java index e2939365b5..ca09eb4f1b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAsktime.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSAsktime.java @@ -14,12 +14,12 @@ */ package org.eclipse.lsp.cobol.usecases; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -37,7 +37,7 @@ public class TestCICSAsktime { private static final String ASKTIME_ABSTIME_VALID = "ASKTIME ABSTIME({$varFour})"; private static final String ASKTIME_INVALID = - "ASKTIME {ABSTIME | error} "; + "ASKTIME ABSTIME "; @Test void testAsktimeValid() { CICSTestUtils.noErrorTest(ASKTIME_VALID); @@ -50,12 +50,12 @@ void testAsktimeAbstimeValid() { void testAsktimeInvalid() { Map expectedDiagnostic = ImmutableMap.of( - "error", + "end-exec-error", new Diagnostic( - new Range(new Position(14, 12), new Position(14, 20)), + new Range(), "Syntax error on 'END-EXEC'", DiagnosticSeverity.Error, ErrorSource.PARSING.getText())); - CICSTestUtils.errorTest(ASKTIME_INVALID, expectedDiagnostic); + CICSTestUtils.errorTestWithEndExecError(ASKTIME_INVALID, ImmutableList.of(), expectedDiagnostic); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java index b3439fcf79..20ea936cfe 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSBif.java @@ -19,7 +19,6 @@ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; - import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -51,9 +50,9 @@ public class TestCICSBif { private static final String BIF_DIGEST_RECORD_RECORDLEN_DIGESTTYPE_RESULT_VALID = "BIF DIGEST RECORD(100) RECORDLEN(100) DIGESTTYPE({$varFour}) RESULT({$varFour})"; private static final String BIF_DIGEST_DIGESTTYPE_INVALID = - "BIF DIGEST {RECORD |errorResultMissing }(100) RECORDLEN(100) {HEX | errorDigestType} {BASE64 | errorDigestType2}"; + "BIF {_DIGEST RECORD(100) RECORDLEN(100) {HEX|errorDigestType} {BASE64|errorDigestType2}|errorResultMissing_}"; private static final String BIF_DIGEST_RESULT_MISSING_INVALID = - "BIF DIGEST RECORD(100) {RECORDLEN | errorResultMissing}(100)"; + "BIF {_DIGEST RECORD(100) RECORDLEN(100)|errorResultMissing_}"; @Test void testBifDeeditField() { @@ -104,19 +103,19 @@ void testBifDigestDigesttypeInvalid() { ImmutableMap.of( "errorResultMissing", new Diagnostic( - new Range(new Position(13, 12), new Position(17, 18)), + new Range(), "Missing required option: RESULT", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), "errorDigestType", new Diagnostic( - new Range(new Position(16, 12), new Position(16, 15)), + new Range(), "Exactly one option required, options are mutually exclusive: HEX or BINARY or BASE64 or DIGESTTYPE", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), "errorDigestType2", new Diagnostic( - new Range(new Position(17, 12), new Position(17, 18)), + new Range(), "Exactly one option required, options are mutually exclusive: HEX or BINARY or BASE64 or DIGESTTYPE", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()) @@ -129,7 +128,7 @@ void testBifDigestResultMissingInvalid() { ImmutableMap.of( "errorResultMissing", new Diagnostic( - new Range(new Position(13, 12), new Position(15, 26)), + new Range(), "Missing required option: RESULT", DiagnosticSeverity.Error, ErrorSource.PARSING.getText())); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java index 420b6db08c..ed7298538f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCancel.java @@ -19,7 +19,6 @@ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; - import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -55,10 +54,10 @@ public class TestCICSCancel { private static final String CANCEL_TRANSID_INVALID = "CANCEL {TRANSID(100) | errorTransid} "; private static final String CANCEL_ACQACTIVITY_ACQPROCESS_INVALID = - "CANCEL {ACQACTIVITY | errorAcqactivityAcqProcess} {ACQPROCESS | errorAcqactivityAcqProcess2} "; + "CANCEL {ACQACTIVITY|errorAcqactivityAcqProcess} {ACQPROCESS|errorAcqactivityAcqProcess2} "; private static final String CANCEL_ACTIVITY_ACQPROCESS_INVALID = - "CANCEL {ACTIVITY | errorActivityAcqProcess }(100) {ACQPROCESS | errorActivityAcqProcess2} "; + "CANCEL {ACTIVITY|errorActivityAcqProcess}(100) {ACQPROCESS|errorActivityAcqProcess2} "; @Test void testCancelActivityValid() { @@ -125,7 +124,7 @@ void testCancelAcqactivityAcqprocess() { ErrorSource.PARSING.getText()), "errorAcqactivityAcqProcess2", new Diagnostic( - new Range(new Position(14, 12), new Position(14, 22)), + new Range(), "Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS", DiagnosticSeverity.Error, ErrorSource.PARSING.getText())); @@ -143,7 +142,7 @@ void testCancelActivityAcqprocess() { ErrorSource.PARSING.getText()), "errorActivityAcqProcess2", new Diagnostic( - new Range(new Position(14, 12), new Position(14, 22)), + new Range(), "Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS", DiagnosticSeverity.Error, ErrorSource.PARSING.getText())); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java index 7563fb162d..e4df74789a 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCheck.java @@ -19,7 +19,6 @@ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -43,9 +42,9 @@ public class TestCICSCheck { private static final String CHECK_TIMER_VALID = "CHECK TIMER({$varFour}) STATUS({$varOne}) "; private static final String CHECK_ACTIVITY_ACQPROCESS_INVALID = - "CHECK COMPSTATUS({$varOne}) {ACTIVITY(100) ACQPROCESS | errorAcqprocess | errorAcqprocess2} "; + "CHECK COMPSTATUS({$varOne}) {ACTIVITY|errorAcqprocess}(100) {ACQPROCESS|errorAcqprocess2} "; private static final String CHECK_ACTIVITY_INVALID_COMPSTATUS = - "CHECK ACTIVITY ({$varOne}) {SUSPSTATUS(100) | errorMissingCompstatus }"; + "CHECK {_ACTIVITY ({$varOne}) SUSPSTATUS(100)|errorMissingCompstatus_}"; @Test void testCheckAcqprocessValid() { CICSTestUtils.noErrorTest(CHECK_ACQPROCESS_VALID); @@ -65,13 +64,13 @@ void testCheckActivityInvalid() { ImmutableMap.of( "errorAcqprocess", new Diagnostic( - new Range(new Position(14, 12), new Position(14, 20)), + new Range(), "Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), "errorAcqprocess2", new Diagnostic( - new Range(new Position(14, 25), new Position(14, 35)), + new Range(), "Exactly one option required, options are mutually exclusive: ACTIVITY or ACQACTIVITY or ACQPROCESS", DiagnosticSeverity.Error, ErrorSource.PARSING.getText())); @@ -84,7 +83,7 @@ void testCancelTransidInvalid() { ImmutableMap.of( "errorMissingCompstatus", new Diagnostic( - new Range(new Position(13, 12), new Position(15, 27)), + new Range(), "Missing required option: COMPSTATUS", DiagnosticSeverity.Error, ErrorSource.PARSING.getText())); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java index 30bac2ed33..2e2d12bb5a 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSConnectProcessStatement.java @@ -19,7 +19,6 @@ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; - import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -39,7 +38,7 @@ public class TestCICSConnectProcessStatement { "CONNECT PROCESS CONVID({$varFour}) PARTNER({$varFour}) " + "SYNCLEVEL({$varFour}) "; private static final String CONNECT_PROCESS_INVALID = - "CONNECT PROCESS SESSION({$varFour}) SYNCLEVEL({$varFour}) {PARTNER | errorMissingProc | errorPartner}(100)"; + "CONNECT {_PROCESS SESSION({$varFour}) SYNCLEVEL({$varFour}) {PARTNER|errorPartner}(100)|errorMissingProc_}"; private static final String CONNECT_PROCESS_PIPLENGTH_INVALID = "CONNECT {_PROCESS CONVID(100) PIPLENGTH(100) \n " + "SYNCLEVEL(100) PROCNAME(100)|errorPiplength_}"; @@ -58,13 +57,13 @@ void testConnectProcessSessionPartnerInvalid() { ImmutableMap.of( "errorMissingProc", new Diagnostic( - new Range(new Position(13, 12), new Position(16, 24)), + new Range(), "Missing required option: PROCNAME", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), "errorPartner", new Diagnostic( - new Range(new Position(16, 12), new Position(16, 19)), + new Range(), "Invalid option provided: PARTNER", DiagnosticSeverity.Error, ErrorSource.PARSING.getText() diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCreateSp.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCreateSp.java new file mode 100644 index 0000000000..534cebfba1 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSCreateSp.java @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + + import com.google.common.collect.ImmutableMap; + import org.eclipse.lsp.cobol.common.error.ErrorSource; + import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; + import org.eclipse.lsp4j.Diagnostic; + import org.eclipse.lsp4j.DiagnosticSeverity; + import org.eclipse.lsp4j.Range; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.params.ParameterizedTest; + import org.junit.jupiter.params.provider.MethodSource; + + import java.util.Map; + import java.util.stream.Stream; + +/** + * Test CICS Create System Command. Documentation link: Create System Commands + * + *

This class tests all variations of the Create System Commands found in the link above. + */ +public class TestCICSCreateSp { + + private static Stream getValidOptions() { + return Stream.of( + "CREATE ATOMSERVICE({$varFour}) NOLOG ATTRLEN({$varFour}) ATTRIBUTES({$varFour})", + "CREATE BUNDLE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE CONNECTION({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE DB2CONN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE DB2ENTRY({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE DB2TRAN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE DOCTEMPLATE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE DUMPCODE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE ENQMODEL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE FILE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE IPCONN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE JOURNALMODEL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE JVMSERVER({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE LIBRARY({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE LSRPOOL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE MAPSET({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE MQCONN({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE MQMONITOR({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE PARTITIONSET({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE PARTNER({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE PIPELINE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE PROCESSTYPE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE PROFILE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE PROGRAM({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE TCPIPSERVICE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE TDQUEUE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE TRANCLASS({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE TRANSACTION({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE TSMODEL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE TYPETERM({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE URIMAP({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE WEBSERVICE({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE SESSIONS({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE TERMINAL({$varFour}) NOLOG ATTRLEN({$varOne}) ATTRIBUTES({$varFour})", + "CREATE CONNECTION({$varFour}) ATTRLEN({$varOne}) ATTRIBUTES({$varFour}) NOLOG"); + }; + + private static final String CREATE_INVALID = + "CREATE CONNECTION({$varFour})" + + "{ATTRIBUTES|errorInvalidDiscard}(1)" + + "{DISCARD|errorInvalidDiscard2}"; + private static final String CREATE_BUNDLE_MISSING_ATTRIBUTES_INVALID = + "CREATE {_BUNDLE({$varFour}) NOLOG |error_}"; + private static final String CREATE_CONNECTION_MUTUALEX_INVALID = + "CREATE CONNECTION({$varFour}) {COMPLETE|error} {DISCARD|error2}"; + private static final String CREATE_DB2CONN_MUTUALEX_INVALID = + "CREATE DB2CONN({$varFour}) ATTRIBUTES({$varFour}) {LOG|error} {NOLOG|error2}"; + private static final String CREATE_DB2ENTRY_DISCARD_INVALID = + "CREATE DB2ENTRY({$varFour}) ATTRIBUTES({$varFour}) {DISCARD|error}"; + private static final String CREATE_DB2ENTRY_FILE_INVALID = + "CREATE NOHANDLE {DB2ENTRY|error}({$varFour}) ATTRIBUTES({$varFour}) {FILE|error2}({$varFour})"; + private static final String CREATE_DB2ENTRY_FILE_CASE_SENSITIVE_INVALID = + "CREATE NOHANDLE {DB2ENTRY|error}({$varFour}) ATTRIBUTES({$varFour}) {FILE|error2}({$varFour})" + + "{FiLe|error3}({$varFour})"; + @ParameterizedTest + @MethodSource("getValidOptions") + void testCreateSpAllValid(String valid) { + CICSTestUtils.noErrorTest(valid, "SP"); + } + @Test + void testCreateSpInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "errorInvalidDiscard", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorInvalidDiscard2", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(CREATE_INVALID, expectedDiagnostic, "SP"); + } + @Test + void testCreateBundleSpInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: ATTRIBUTES", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(CREATE_BUNDLE_MISSING_ATTRIBUTES_INVALID, expectedDiagnostic, "SP"); + } + @Test + void testCreateConnectionSpInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "error2", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: ATTRIBUTES or COMPLETE or DISCARD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + + CICSTestUtils.errorTest(CREATE_CONNECTION_MUTUALEX_INVALID, expectedDiagnostic, "SP"); + } + @Test + void testCreateDb2ConnSpInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: LOG or NOLOG or LOGMESSAGE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "error2", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: LOG or NOLOG or LOGMESSAGE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + + CICSTestUtils.errorTest(CREATE_DB2CONN_MUTUALEX_INVALID, expectedDiagnostic, "SP"); + } + @Test + void testCreateDb2EntrySpInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Invalid option provided: DISCARD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + + CICSTestUtils.errorTest(CREATE_DB2ENTRY_DISCARD_INVALID, expectedDiagnostic, "SP"); + } + @Test + void testCreateMutualExSpInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "error2", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + + CICSTestUtils.errorTest(CREATE_DB2ENTRY_FILE_INVALID, expectedDiagnostic, "SP"); + } + @Test + void testCreateMutualExCaseSensitiveSpInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "error2", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: DB2ENTRY or FILE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "error3", + new Diagnostic( + new Range(), + "Excessive options provided for: FiLe", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + + CICSTestUtils.errorTest(CREATE_DB2ENTRY_FILE_CASE_SENSITIVE_INVALID, expectedDiagnostic, "SP"); + } +} + diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java index c637c447ee..a4f09e1831 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndBrowse.java @@ -25,22 +25,12 @@ import java.util.Map; /** - * Test CICS ENDBR & ENDBROWSE commands. Documentation link: ENDBROWSE Command - * href="https://www.ibm.com/docs/en/cics-ts/6.x?topic=summary-endbr">ENDBR Command * - *

This class tests all variations of the ENDBR & ENDBROWSE command found in the link above. + *

This class tests all variations of the ENDBROWSE command found in the link above. */ public class TestCICSEndBrowse { - // ENDBR - private static final String ENDBR_FILE_VALID = "ENDBR FILE({$varFour})"; - private static final String ENDBR_DATASET_VALID = "ENDBR DATASET({$varFour})"; - private static final String ENDBR_FILE_DATASET_INVALID = "ENDBR {FILE|error1}({$varFour}) {DATASET|error2}({$varFour})"; - private static final String ENDBR_FILE_REQID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne})"; - private static final String ENDBR_FILE_SYSID_VALID = "ENDBR FILE({$varFour}) SYSID({$varOne})"; - private static final String ENDBR_FILE_REQID_SYSID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne}) SYSID({$varFive})"; - - // ENDBROWSE private static final String ENDBROWSE_ACTIVITY_VALID = "ENDBROWSE ACTIVITY BROWSETOKEN({$varOne})"; private static final String ENDBROWSE_ACTIVITY_INVALID = "ENDBROWSE ACTIVITY {ACTIVITY|error1} BROWSETOKEN({$varOne})"; private static final String ENDBROWSE_ACTIVITY_CONTAINER_INVALID = "ENDBROWSE {ACTIVITY|error1} {CONTAINER|error2} BROWSETOKEN({$varOne}) RETCODE({$varOne})"; @@ -50,51 +40,7 @@ public class TestCICSEndBrowse { private static final String ENDBROWSE_TIMER_VALID = "ENDBROWSE TIMER BROWSETOKEN({$varOne})"; private static final String ENDBROWSE_PROCESS_VALID = "ENDBROWSE PROCESS BROWSETOKEN({$varOne})"; - @Test - void testEndbrFileValid() { - CICSTestUtils.noErrorTest(ENDBR_FILE_VALID); - } - - @Test - void testEndbrDatasetValid() { - CICSTestUtils.noErrorTest(ENDBR_DATASET_VALID); - } - - @Test - void testEndbrFileDatasetInvalid() { - Map expectedDiagnostics = - ImmutableMap.of( - "error1", - new Diagnostic( - new Range(), - "Exactly one option required, options are mutually exclusive: FILE or DATASET", - DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()), - "error2", - new Diagnostic( - new Range(), - "Exactly one option required, options are mutually exclusive: FILE or DATASET", - DiagnosticSeverity.Error, - ErrorSource.PARSING.getText())); - CICSTestUtils.errorTest(ENDBR_FILE_DATASET_INVALID, expectedDiagnostics); - } - @Test - void testEndbrFileReqidValid() { - CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_VALID); - } - - @Test - void testEndbrFileSysidValid() { - CICSTestUtils.noErrorTest(ENDBR_FILE_SYSID_VALID); - } - - @Test - void testEndbrFileReqidSysidValid() { - CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_SYSID_VALID); - } - - - @Test + @Test void testEndbrowseActivityValid() { CICSTestUtils.noErrorTest(ENDBROWSE_ACTIVITY_VALID); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndbr.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndbr.java new file mode 100644 index 0000000000..a3305bbd75 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSEndbr.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +import java.util.Map; + +/** + * Test CICS ENDBR commands. Documentation link: ENDBR Command + * + *

This class tests all variations of the ENDBR command found in the link above. + */ +public class TestCICSEndbr { + private static final String ENDBR_FILE_VALID = "ENDBR FILE({$varFour})"; + private static final String ENDBR_INVALID = "ENDBR"; + private static final String ENDBR_DATASET_VALID = "ENDBR DATASET({$varFour})"; + private static final String ENDBR_FILE_DATASET_INVALID = "ENDBR {FILE|error1}({$varFour}) {DATASET|error2}({$varFour})"; + private static final String ENDBR_FILE_REQID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne})"; + private static final String ENDBR_FILE_SYSID_VALID = "ENDBR FILE({$varFour}) SYSID({$varOne})"; + private static final String ENDBR_FILE_REQID_SYSID_VALID = "ENDBR FILE({$varFour}) REQID({$varOne}) SYSID({$varFive})"; + + @Test + void testEndbrFileValid() { + CICSTestUtils.noErrorTest(ENDBR_FILE_VALID); + } + + @Test + void testEndbrInvalid() { + CICSTestUtils.errorTestWithEndExecError(ENDBR_INVALID, + ImmutableList.of("error1"), + ImmutableMap.of( + "error1", + new Diagnostic( + new Range(), + "Exactly one option required, none provided: FILE or DATASET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "end-exec-error", + new Diagnostic( + new Range(), + "Syntax error on 'END-EXEC'", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testEndbrDatasetValid() { + CICSTestUtils.noErrorTest(ENDBR_DATASET_VALID); + } + + @Test + void testEndbrFileDatasetInvalid() { + Map expectedDiagnostics = + ImmutableMap.of( + "error1", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: FILE or DATASET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "error2", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: FILE or DATASET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(ENDBR_FILE_DATASET_INVALID, expectedDiagnostics); + } + @Test + void testEndbrFileReqidValid() { + CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_VALID); + } + + @Test + void testEndbrFileSysidValid() { + CICSTestUtils.noErrorTest(ENDBR_FILE_SYSID_VALID); + } + + @Test + void testEndbrFileReqidSysidValid() { + CICSTestUtils.noErrorTest(ENDBR_FILE_REQID_SYSID_VALID); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java new file mode 100644 index 0000000000..56048907ab --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java @@ -0,0 +1,362 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Test CICS HANDLE commands. Documentation link: HANDLE Command + * + *

This class tests all variations of the HANDLE command: ABEND, AID, and CONDITION. + */ +public class TestCICSHandle { + private static final String HANDLE_ABEND_VALID = + "HANDLE ABEND PROGRAM({$varOne})"; + + private static final String HANDLE_ABEND_INVALID = + "HANDLE {CANCEL|errorOne}"; + + private static final String HANDLE_AID_VALID_ONE = + "HANDLE AID ANYKEY({@SEC1})"; + + private static final String HANDLE_AID_VALID_TWO = + "HANDLE AID PF1({@SEC1})"; + + private static final String HANDLE_AID_INVALID = + "HANDLE {_ANYKEY({@SEC1})|errorOne_}"; + + private static final String HANDLE_AID_VALID_THREE = + "HANDLE AID PF1({@SEC1}) PF3"; + + private static final String HANDLE_AID_INVALID_TWO = + "HANDLE {_AID CLEAR CLRPARTN ENTER OPERID ANYKEY PA1 PF1({@SEC1}) TRIGGER LIGHTPEN PA2 " + + "PA3 PF2 PF3 PF4 PF5 PF6 PF7 PF8 PF9 PF10 PF11|errorOne_}"; + + private static final String HANDLE_CONDITION_VALID = + "HANDLE CONDITION EOC({@SEC1})"; + + private static final String HANDLE_CONDITION_VALID_ONE = + "HANDLE CONDITION ERROR"; + + + private static final String HANDLE_CONDITION_VALID_TWO = + "HANDLE CONDITION"; + + + private static final String HANDLE_CONDITION_INVALID_ONE = + "HANDLE {ERROR|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_TWO = + "HANDLE CONDITION {CONDITION|errorOne} ERROR"; + + private static final String HANDLE_CONDITION_INVALID_THREE = + "HANDLE CONDITION NORMAL {NORMAL|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_WRBRK = + "HANDLE CONDITION WRBRK {WRBRK|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_INBFMH = + "HANDLE CONDITION INBFMH {INBFMH|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_ENDINPT = + "HANDLE CONDITION ENDINPT {ENDINPT|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_NONVAL = + "HANDLE CONDITION NONVAL {NONVAL|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_NOSTART = + "HANDLE CONDITION NOSTART {NOSTART|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_TERMIDERR = + "HANDLE CONDITION TERMIDERR {TERMIDERR|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_FILENOTFOUND = + "HANDLE CONDITION FILENOTFOUND {FILENOTFOUND|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_NOTFND = + "HANDLE CONDITION NOTFND {NOTFND|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_DUPKEY = + "HANDLE CONDITION DUPKEY {DUPKEY|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_INVREQ = + "HANDLE CONDITION INVREQ {INVREQ|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_IOERR = + "HANDLE CONDITION IOERR {IOERR|errorOne}"; + + @Test + void testHandleAbendValid() { + CICSTestUtils.noErrorTest(HANDLE_ABEND_VALID); + } + + @Test + void testHandleAbendInvalid() { + CICSTestUtils.errorTest( + HANDLE_ABEND_INVALID, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: ABEND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleAidValidOne() { + CICSTestUtils.noErrorTest(HANDLE_AID_VALID_ONE); + } + + @Test + void testHandleAidValidTwo() { + CICSTestUtils.noErrorTest(HANDLE_AID_VALID_TWO); + } + + @Test + void testHandleAidInvalid() { + CICSTestUtils.errorTest( + HANDLE_AID_INVALID, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: AID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleAidValidThree() { + CICSTestUtils.noErrorTest(HANDLE_AID_VALID_THREE); + } + + @Test + void testHandleAidInvalidThree() { + CICSTestUtils.errorTest( + HANDLE_AID_INVALID_TWO, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Too many options provided for: HANDLE AID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionValid() { + CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID); + } + + @Test + void testHandleConditionValidOne() { + CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID_ONE); + } + + @Test + void testHandleConditionValidTwo() { + CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID_TWO); + } + + @Test + void testHandleConditionInvalidOne() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_ONE, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: CONDITION", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidTwo() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_TWO, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: CONDITION", + DiagnosticSeverity.Warning, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidThree() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_THREE, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NORMAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidWrbrk() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_WRBRK, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: WRBRK", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidInbfmh() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_INBFMH, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: INBFMH", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidEndinpt() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_ENDINPT, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: ENDINPT", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidNonval() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_NONVAL, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NONVAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidNostart() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_NOSTART, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NOSTART", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidTermiderr() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_TERMIDERR, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: TERMIDERR", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidFilenotfound() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_FILENOTFOUND, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: FILENOTFOUND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidNotfnd() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_NOTFND, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NOTFND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidDupkey() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_DUPKEY, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: DUPKEY", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidInvreq() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_INVREQ, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: INVREQ", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidIoerr() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_IOERR, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: IOERR", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSIgnore.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSIgnore.java new file mode 100644 index 0000000000..763975e1b2 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSIgnore.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Test CICS IGNORE CONDITION command. Documentation link: IGNORE CONDITION Command + * + *

This class tests the IGNORE CONDITION command. + */ +public class TestCICSIgnore { + private static final String IGNORE_CONDITION_VALID_ONE = + "IGNORE CONDITION ERROR"; + + private static final String IGNORE_CONDITION_VALID_MULTIPLE = + "IGNORE CONDITION ERROR MAPFAIL PARTNFAIL"; + + private static final String IGNORE_CONDITION_INVALID_ONE = + "IGNORE {ERROR|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_TWO = + "IGNORE CONDITION {CONDITION|errorOne} ERROR"; + + private static final String IGNORE_CONDITION_INVALID_THREE = + "IGNORE CONDITION NORMAL {NORMAL|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_WRBRK = + "IGNORE CONDITION WRBRK {WRBRK|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_INBFMH = + "IGNORE CONDITION INBFMH {INBFMH|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_ENDINPT = + "IGNORE CONDITION ENDINPT {ENDINPT|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_NONVAL = + "IGNORE CONDITION NONVAL {NONVAL|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_NOSTART = + "IGNORE CONDITION NOSTART {NOSTART|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_TERMIDERR = + "IGNORE CONDITION TERMIDERR {TERMIDERR|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_FILENOTFOUND = + "IGNORE CONDITION FILENOTFOUND {FILENOTFOUND|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_NOTFND = + "IGNORE CONDITION NOTFND {NOTFND|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_DUPKEY = + "IGNORE CONDITION DUPKEY {DUPKEY|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_INVREQ = + "IGNORE CONDITION INVREQ {INVREQ|errorOne}"; + + private static final String IGNORE_CONDITION_INVALID_IOERR = + "IGNORE CONDITION IOERR {IOERR|errorOne}"; + + @Test + void testIgnoreConditionValidOne() { + CICSTestUtils.noErrorTest(IGNORE_CONDITION_VALID_ONE); + } + + @Test + void testIgnoreConditionValidMultiple() { + CICSTestUtils.noErrorTest(IGNORE_CONDITION_VALID_MULTIPLE); + } + + @Test + void testIgnoreConditionInvalidOne() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_ONE, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: CONDITION", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidTwo() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_TWO, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: CONDITION", + DiagnosticSeverity.Warning, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidThree() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_THREE, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NORMAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidWrbrk() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_WRBRK, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: WRBRK", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidInbfmh() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_INBFMH, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: INBFMH", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidEndinpt() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_ENDINPT, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: ENDINPT", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidNonval() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_NONVAL, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NONVAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidNostart() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_NOSTART, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NOSTART", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidTermiderr() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_TERMIDERR, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: TERMIDERR", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidFilenotfound() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_FILENOTFOUND, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: FILENOTFOUND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidNotfnd() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_NOTFND, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NOTFND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidDupkey() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_DUPKEY, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: DUPKEY", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidInvreq() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_INVREQ, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: INVREQ", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testIgnoreConditionInvalidIoerr() { + CICSTestUtils.errorTest( + IGNORE_CONDITION_INVALID_IOERR, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: IOERR", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java index a40f9f7e99..edebc29171 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquire.java @@ -38,10 +38,12 @@ public class TestCICSInquire { private static Stream getValidOptions() { return Stream.of( "ACTIVITYID({$varOne}) COMPSTATUS({$varOne}) MODE({$varOne}) SUSPSTATUS({$varOne}) ABCODE({$varOne}) ABPROGRAM({$varOne}) ACTIVITY({$varOne}) EVENT({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) PROGRAM({$varOne}) TRANSID({$varOne}) USERID({$varOne})", - "CONTAINER({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) DATALENTH({$varOne}) SET({$varOne})", + "CONTAINER({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) DATALENGTH({$varOne}) SET({$varOne})", "EVENT({$varOne}) ACTIVITYID({$varOne}) EVENTTYPE({$varOne}) FIRESTATUS({$varOne}) PREDICATE({$varOne}) COMPOSITE({$varOne}) TIMER({$varOne})", "PROCESS({$varOne}) PROCESSTYPE({$varOne}) ACTIVITYID({$varOne})", - "TIMER({$varOne}) ACTIVITYID({$varOne}) EVENT({$varOne}) ABSTIME({$varOne})"); + "TIMER({$varOne}) ACTIVITYID({$varOne}) EVENT({$varOne}) ABSTIME({$varOne})", + "TIMER({$varOne})", + "EVENT({$varOne})"); } private static final String CONTAINER_INVALID = diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java index 780b8ca51c..aad064eb20 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSInquireSP.java @@ -55,7 +55,7 @@ private static Stream getValidOptions() { "CAPDATAPRED NEXT CONTAINER({$varOne}) FIELDLENGTH({$varOne}) FIELDOFFSET({$varOne}) FILENAME({$varOne}) FILTERVALUE({$varOne}) LOCATION({$varOne}) STRUCTNAME({$varOne}) VARIABLENAME({$varOne}) OPERATOR({$varOne})", "CAPINFOSRCE START CAPTURESPEC({$varOne}) EVENTBINDING({$varOne})", "CAPOPTPRED NEXT FILTERVALUE({$varOne}) OPTIONNAME({$varOne}) OPERATOR({$varOne})", - "CAPTURESPEC({$varOne}) CAPTUREPOINT({$varOne}) CURRPGM({$varOne}) CURRTRANID({$varOne}) CURRUSERID({$varOne}) EVENTNAME({$varOne}) NUMDATAPRD({$varOne}) NUMINFOSRCE({$varOne}) NUMOPTPRED({$varOne}) PRIMPRED({$varOne}) EVENTBINDING({$varOne}) CAPTUREPTYPE({$varOne}) CURRPGMOP({$varOne}) CURRTRANIDOP({$varOne}) CURRUSERIDOP({$varOne}) PRIMPREDOP({$varOne}) PRIMPREDTYPE({$varOne})", + "CAPTURESPEC({$varOne}) CAPTUREPOINT({$varOne}) CURRPGM({$varOne}) CURRTRANID({$varOne}) CURRUSERID({$varOne}) EVENTNAME({$varOne}) NUMDATAPRED({$varOne}) NUMINFOSRCE({$varOne}) NUMOPTPRED({$varOne}) PRIMPRED({$varOne}) EVENTBINDING({$varOne}) CAPTUREPTYPE({$varOne}) CURRPGMOP({$varOne}) CURRTRANIDOP({$varOne}) CURRUSERIDOP({$varOne}) PRIMPREDOP({$varOne}) PRIMPREDTYPE({$varOne})", "CONNECTION({$varOne}) ACCESSMETHOD({$varOne}) ACQSTATUS({$varOne}) AUTOCONNECT({$varOne}) CHANGEAGENT({$varOne}) CONNSTATUS({$varOne}) CONNTYPE({$varOne}) CQP({$varOne}) EXITTRACING({$varOne}) INSTALLAGENT({$varOne}) PENDSTATUS({$varOne}) PROTOCOL({$varOne}) RECOVSTATUS({$varOne}) SERVSTATUS({$varOne}) XLNSTATUS({$varOne}) ZCPTRACING({$varOne}) AIDCOUNT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) GRNAME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) LINKSYSTEM({$varOne}) MEMBERNAME({$varOne}) NETNAME({$varOne}) NQNAME({$varOne}) RECEIVECOUNT({$varOne}) REMOTENAME({$varOne}) REMOTESYSNET({$varOne}) REMOTESYSTEM({$varOne}) SENDCOUNT({$varOne})", "CFDTPOOL({$varOne}) CONNSTATUS({$varOne})", "DB2CONN ACCOUNTREC({$varOne}) AUTHTYPE({$varOne}) CHANGEAGENT({$varOne}) COMAUTHTYPE({$varOne}) CONNECTERROR({$varOne}) CONNECTST({$varOne}) DROLLBACK({$varOne}) INSTALLAGENT({$varOne}) NONTERMREL({$varOne}) PRIORITY({$varOne}) RESYNCMEMBER({$varOne}) STANDBYMODE({$varOne}) THREADERROR({$varOne}) THREADWAIT({$varOne}) AUTHID({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) COMAUTHID({$varOne}) COMTHREADLIM({$varOne}) COMTHREADS({$varOne}) DB2GROUPID({$varOne}) DB2ID({$varOne}) DB2RELEASE({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MSGQUEUE1({$varOne}) MSGQUEUE2({$varOne}) MSGQUEUE3({$varOne}) PLAN({$varOne}) PLANEXITNAME({$varOne}) PURGECYCLEM({$varOne}) PURGECYCLES({$varOne}) REUSELIMIT({$varOne}) SIGNID({$varOne}) STATSQUEUE({$varOne}) TCBLIMIT({$varOne}) TCBS({$varOne}) THREADLIMIT({$varOne}) THREADS({$varOne})", @@ -73,7 +73,7 @@ private static Stream getValidOptions() { "EPADAPTINSET EPADAPTERSET({$varOne}) EPADAPTER({$varOne})", "EVENTBINDING({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) EPADAPTERRES({$varOne}) INSTALLAGENT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) EPADAPTER({$varOne}) EPADAPTERSET({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) USERTAG({$varOne})", "EVENTPROCESS EPSTATUS({$varOne}) SCHEMALEVEL({$varOne})", - "EXCI({$varOne}) TASK({$varOne}) UTIL({$varOne})", + "EXCI({$varOne}) NEXT TASK({$varOne}) UTIL({$varOne})", "EXITPROGRAM({$varOne}) EXIT({$varOne}) ENTRYNAME({$varOne}) GAENTRYNAME({$varOne}) GALENGTH({$varOne}) GAUSECOUNT({$varOne}) NUMEXITS({$varOne}) QUALIFIER({$varOne}) TALENGTH({$varOne}) USECOUNT({$varOne}) APIST({$varOne}) CONCURRENTST({$varOne}) CONNECTST({$varOne}) FORMATEDFST({$varOne}) INDOUBTST({$varOne}) PURGEABLEST({$varOne}) SHUTDOWNST({$varOne}) SPIST({$varOne}) STARTSTATUS({$varOne}) TASKSTARTST({$varOne}) ENTRY({$varOne})", "FEATUREKEY({$varOne}) VALUE({$varOne}) FILEPATH({$varOne})", "FILE({$varOne}) ACCESSMETHOD({$varOne}) ADD({$varOne}) BLOCKFORMAT({$varOne}) BROWSE({$varOne}) CHANGEAGENT({$varOne}) DELETE({$varOne}) DISPOSITION({$varOne}) EMPTYSTATUS({$varOne}) ENABLESTATUS({$varOne}) EXCLUSIVE({$varOne}) FWDRECSTATUS({$varOne}) INSTALLAGENT({$varOne}) LOADTYPE({$varOne}) OBJECT({$varOne}) OPENSTATUS({$varOne}) RBATYPE({$varOne}) READ({$varOne}) READINTEG({$varOne}) RECORDFORMAT({$varOne}) RECOVSTATUS({$varOne}) RELTYPE({$varOne}) REMOTETABLE({$varOne}) RLSACCESS({$varOne}) TABLE({$varOne}) TYPE({$varOne}) UPDATE({$varOne}) UPDATEMODEL({$varOne}) BASEDSNAME({$varOne}) BLOCKKEYLEN({$varOne}) BLOCKSIZE({$varOne}) CFDTPOOL({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) DSNAME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) JOURNALNUM({$varOne}) KEYLENGTH({$varOne}) KEYPOSITION({$varOne}) LSRPOOLNUM({$varOne}) MAXNUMRECS({$varOne}) RECORDSIZE({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) STRINGS({$varOne}) TABLENAME({$varOne})", @@ -88,7 +88,7 @@ private static Stream getValidOptions() { "LIBRARY({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMINORVER({$varOne}) APPLMICROVER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) DSNAME01({$varOne}) DSNAME02({$varOne}) DSNAME03({$varOne}) DSNAME04({$varOne}) DSNAME05({$varOne}) DSNAME06({$varOne}) DSNAME07({$varOne}) DSNAME08({$varOne}) DSNAME09({$varOne}) DSNAME10({$varOne}) DSNAME11({$varOne}) DSNAME12({$varOne}) DSNAME13({$varOne}) DSNAME14({$varOne}) DSNAME15({$varOne}) DSNAME16({$varOne}) INSTALLUSRID({$varOne}) INSTALLTIME({$varOne}) NUMDSNAMES({$varOne}) PLATFORM({$varOne}) RANKING({$varOne}) SEARCHPOS({$varOne}) CHANGEAGENT({$varOne}) CRITICALST({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne}) DSNAMELIST({$varOne})", "MODENAME({$varOne}) CONNECTION({$varOne}) ACTIVE({$varOne}) AVAILABLE({$varOne}) MAXIMUM({$varOne}) MAXWINNERS({$varOne}) AUTOCONNECT({$varOne})", "MONITOR APPLNAMEST({$varOne}) COMPRESSST({$varOne}) CONVERSEST({$varOne}) EXCEPTCLASS({$varOne}) IDNTYCLASS({$varOne}) PERFCLASS({$varOne}) RESRCECLASS({$varOne}) RMIST({$varOne}) STATUS({$varOne}) SYNCPOINTST({$varOne}) TIME({$varOne}) DPLLIMIT({$varOne}) FILELIMIT({$varOne}) FREQUENCY({$varOne}) FREQUENCYHRS({$varOne}) FREQUENCYMINS({$varOne}) FREQUENCYSECS({$varOne}) TSQUEUELIMIT({$varOne}) URIMAPLIMIT({$varOne}) WEBSERVLIMIT({$varOne})", - "MQCONN CHANGEAGENT({$varOne}) CONNECTST({$varOne}) INSTALLAGENT({$varOne}) RESYNCNUMBER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MQNAME({$varOne}) MQQMGR({$varOne}) MQRELEASE({$varOne}) TASKS({$varOne}) TRIGMONTASKS({$varOne})", + "MQCONN CHANGEAGENT({$varOne}) CONNECTST({$varOne}) INSTALLAGENT({$varOne}) RESYNCMEMBER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MQNAME({$varOne}) MQQMGR({$varOne}) MQRELEASE({$varOne}) TASKS({$varOne}) TRIGMONTASKS({$varOne})", "MQINI({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INITQNAME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne})", "MQMONITOR({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne}) MONSTATUS({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) MONDATA({$varOne}) MONUSERID({$varOne}) QNAME({$varOne}) TASKID({$varOne}) TRANSACTION({$varOne}) USERID({$varOne})", "MVSTCB({$varOne}) NEXT SET({$varOne}) NUMELEMENTS({$varOne})", @@ -104,30 +104,30 @@ private static Stream getValidOptions() { "PROGRAM({$varOne}) APIST({$varOne}) CEDFSTATUS({$varOne}) CHANGEAGENT({$varOne}) COBOLTYPE({$varOne}) COPY({$varOne}) CONCURRENCY({$varOne}) DATALOCATION({$varOne}) DYNAMSTATUS({$varOne}) EXECKEY({$varOne}) EXECUTIONSET({$varOne}) HOLDSTATUS({$varOne}) INSTALLAGENT({$varOne}) LANGDEDUCED({$varOne}) LANGUAGE({$varOne}) LPASTATUS({$varOne}) PROGTYPE({$varOne}) REPLICATION({$varOne}) RESIDENCY({$varOne}) RUNTIME({$varOne}) SHARESTATUS({$varOne}) STATUS({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMINORVER({$varOne}) APPLMICROVER({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) JVMCLASS({$varOne}) JVMPROFILE({$varOne}) JVMSERVER({$varOne}) LENGTH({$varOne}) LIBRARY({$varOne}) LIBRARYDSN({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RESCOUNT({$varOne}) TRANSID({$varOne}) USECOUNT({$varOne}) ENTRYPOINT({$varOne}) LOADPOINT({$varOne})", "REQID({$varOne}) AFTER REQTYPE({$varOne}) FMHSTATUS({$varOne}) SET({$varOne}) TERMID({$varOne}) TRANSID({$varOne}) TIME({$varOne}) HOURS({$varOne}) MINUTES({$varOne}) SECONDS({$varOne}) LENGTH({$varOne}) RTRANSID({$varOne}) RTERMID({$varOne}) QUEUE({$varOne}) USERID({$varOne})", "RRMS OPENSTATUS({$varOne})", - "SECDISCOVERY STATUS({$varOne}) CMD({$varOne}) DB2({$varOne}) DCT({$varOne}) FCT({$varOne}) HFS({$varOne}) JCT({$varOne}) PCT({$varOne}) PPT({$varOne}) PSB({$varOne}) RES({$varOne}) TRAN({$varOne}) TST({$varOne}) USER({$varOne}) LATSECDTIME({$varOne}) LASTWRITTIME({$varOne}) SECDCOUNT({$varOne}) NEWSECDCOUNT({$varOne})", + "SECDISCOVERY STATUS({$varOne}) CMD({$varOne}) DB2({$varOne}) DCT({$varOne}) FCT({$varOne}) HFS({$varOne}) JCT({$varOne}) PCT({$varOne}) PPT({$varOne}) PSB({$varOne}) RES({$varOne}) TRAN({$varOne}) TST({$varOne}) USER({$varOne}) LASTSECDTIME({$varOne}) LASTWRITTIME({$varOne}) SECDCOUNT({$varOne}) NEWSECDCOUNT({$varOne})", "SECRECORDING({$varOne}) ODADPTRID({$varOne}) ODADPTRDATA1({$varOne}) ODADPTRDATA2({$varOne}) ODADPTRDATA3({$varOne}) ODAPPLID({$varOne}) ODCLNTIPADDR({$varOne}) ODCLNTPORT({$varOne}) ODFACILNAME({$varOne}) ODFACILTYPE({$varOne}) ODIPFAMILY({$varOne}) ODLUNAME({$varOne}) ODNETID({$varOne}) ODNETWORKID({$varOne}) ODSERVERPORT({$varOne}) ODTCPIPS({$varOne}) ODTRANSID({$varOne}) ODUSERID({$varOne}) MAXIMUM({$varOne}) CURRENT({$varOne})", - "STATISTICS RECORDING({$varOne}) ENDOFDAY({$varOne}) ENDOFDAYHRS({$varOne}) ENDOFDAYMINS({$varOne}) ENDOFDAYSECS({$varOne}) INTERVAL({$varOne}) INTERVALHRS({$varOne}) INTERVALMINS({$varOne}) INTERVALSECS({$varOne}) NEXTTIME({$varOne}) NEXTTIMEHRS({$varOne}) NEXTTIMEMINS({$varOne}) NEXTTIMESECS({$varOne})", - "STORAGE ADDRESS({$varOne}) ELEMENT({$varOne}) ELEMENTLIST({$varOne}) LENGTHLIST({$varOne}) FLENGTH({$varOne}) NUMELEMENTS({$varOne}) TASK({$varOne})", - "STORAGE64 ELEMENT64({$varOne}) ELEMENTLIST({$varOne}) LENGTHLIST({$varOne}) ADRESS64({$varOne}) DSANAME({$varOne}) TASK({$varOne}) FLENGTH({$varOne}) NUMELEMENTS({$varOne})", + "STATISTICS RECORDING({$varOne}) ENDOFDAYHRS({$varOne}) ENDOFDAYMINS({$varOne}) ENDOFDAYSECS({$varOne}) INTERVALHRS({$varOne}) INTERVALMINS({$varOne}) INTERVALSECS({$varOne}) NEXTTIME({$varOne})", + "STORAGE ADDRESS({$varOne}) ELEMENT({$varOne}) FLENGTH({$varOne})", + "STORAGE64 ELEMENT64({$varOne}) ADDRESS64({$varOne}) DSANAME({$varOne}) FLENGTH({$varOne})", "STREAMNAME({$varOne}) STATUS({$varOne}) SYSTEMLOG({$varOne}) USECOUNT({$varOne})", - "SUBPOOL({$varOne}) DSANAME({$varOne})", + "SUBPOOL({$varOne}) NEXT DSANAME({$varOne})", "SYSDUMPCODE({$varOne}) CHANGEAGENT({$varOne}) DAEOPTION({$varOne}) DUMPSCOPE({$varOne}) INSTALLAGENT({$varOne}) SHUTOPTION({$varOne}) SYSDUMPING({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CURRENT({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) DSPLIST({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) JOBLIST({$varOne}) MAXIMUM({$varOne})", "SYSTEM ACTOPENTCBS({$varOne}) AIDCOUNT({$varOne}) AKP({$varOne}) CDSASIZE({$varOne}) CICSSYS({$varOne}) CICSTSLEVEL({$varOne}) DB2CONN({$varOne}) DFLTUSER({$varOne}) DSALIMIT({$varOne}) DSRTPROGRAM({$varOne}) DTRPROGRAM({$varOne}) ECDSASIZE({$varOne}) EDSALIMIT({$varOne}) EPCDSASIZE({$varOne}) EPUDSASIZE({$varOne}) ERDSASIZE({$varOne}) ESDSASIZE({$varOne}) EUDSASIZE({$varOne}) GCDSASIZE({$varOne}) GMMTEXT({$varOne}) GMMLENGTH({$varOne}) GSDSASIZE({$varOne}) GUDSASIZE({$varOne}) GMMTRANID({$varOne}) JOBNAME({$varOne}) LASTCOLDTIME({$varOne}) LASTEMERTIME({$varOne}) LASTINITTIME({$varOne}) LASTWARMTIME({$varOne}) LOGDEFER({$varOne}) MAXOPENTCBS({$varOne}) MAXTASKS({$varOne}) MEMLIMIT({$varOne}) MQCONN({$varOne}) MROBATCH({$varOne}) MVSSMFID({$varOne}) MVSSYSNAME({$varOne}) OPREL({$varOne}) OPSYS({$varOne}) OSLEVEL({$varOne}) PCDSASIZE({$varOne}) PLTPIUSR({$varOne}) PROGAUTOEXIT({$varOne}) PRTYAGING({$varOne}) PUDSASIZE({$varOne}) RDSASIZE({$varOne}) REGIONUSERID({$varOne}) RELEASE({$varOne}) RUNAWAY({$varOne}) SCANDELAY({$varOne}) SDSASIZE({$varOne}) SDTMEMLIMIT({$varOne}) SDTRAN({$varOne}) STARTUPDATE({$varOne}) TIME({$varOne}) UDSASIZE({$varOne}) SRRTASKS({$varOne}) CICSSTATUS({$varOne}) CMDPROTECT({$varOne}) COLDSTATUS({$varOne}) DEBUGTOOL({$varOne}) DUMPING({$varOne}) FORCEQR({$varOne}) HEALTHCHECK({$varOne}) INITSTATUS({$varOne}) MESSAGECASE({$varOne}) PROGAUTOCTLG({$varOne}) PROGAUTOINST({$varOne}) REENTPROTECT({$varOne}) RLSSTATUS({$varOne}) SECURITYMGR({$varOne}) SHUTSTATUS({$varOne}) SOSABOVEBAR({$varOne}) SOSABOVELINE({$varOne}) SOSBELOWLINE({$varOne}) SOSSTATUS({$varOne}) STARTUP({$varOne}) STOREPROTECT({$varOne}) TRANISOLATE({$varOne}) XRFSTATUS({$varOne})", - "TAG START NEXT END", + "TAG START", "TASK ACTIVITY({$varOne}) ACTIVITYID({$varOne}) ATTACHTIME({$varOne}) BRFACILITY({$varOne}) BRIDGE({$varOne}) CURRENTPROG({$varOne}) DB2PLAN({$varOne}) DTIMEOUT({$varOne}) FACILITY({$varOne}) IDENTIFIER({$varOne}) INDOUBTMINS({$varOne}) IPFLISTSIZE({$varOne}) PRIORITY({$varOne}) PROCESS({$varOne}) PROCESSTYPE({$varOne}) PROFILE({$varOne}) PROGRAM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RTIMEOUT({$varOne}) RUNAWAY({$varOne}) STARTCODE({$varOne}) SUSPENDTIME({$varOne}) SUSPENDTYPE({$varOne}) SUSPENDVALUE({$varOne}) RESNAME({$varOne}) TRANCLASS({$varOne}) TCLASS({$varOne}) TRANPRIORITY({$varOne}) TRANSACTION({$varOne}) TRPROF({$varOne}) TWASIZE({$varOne}) UOW({$varOne}) USERID({$varOne}) CMDSEC({$varOne}) DUMPING({$varOne}) FACILITYTYPE({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) ISOLATEST({$varOne}) PURGEABILITY({$varOne}) RESSEC({$varOne}) ROUTING({$varOne}) RUNSTATUS({$varOne}) SCRNSIZE({$varOne}) SRRSTATUS({$varOne}) STORAGECLEAR({$varOne}) TASKDATAKEY({$varOne}) TASKDATALOC({$varOne}) TCB({$varOne}) TRACING({$varOne}) IPFACILITIES({$varOne})", "TASK LIST DISPATCHABLE RUNNING SUSPENDED LISTSIZE({$varOne}) SET({$varOne}) SETTRANSID({$varOne})", "TCLASS({$varOne}) CURRENT({$varOne}) MAXIMUM({$varOne})", "TCPIP ACTSOCKETS({$varOne}) CRLPROFILE({$varOne}) MAXSOCKETS({$varOne}) OPENSTATUS({$varOne}) SSLCACHE({$varOne})", "TCPIPSERVICE({$varOne}) CERTIFICATE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CIPHERS({$varOne}) CLOSETIMEOUT({$varOne}) CONNECTIONS({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) GENERICTCPS({$varOne}) HOST({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) IPADDRESS({$varOne}) IPRESOLVED({$varOne}) MAXDATALEN({$varOne}) MAXPERSIST({$varOne}) NUMCIPHERS({$varOne}) OPTIONSPGM({$varOne}) PORT({$varOne}) REALM({$varOne}) SPECIFTCPS({$varOne}) TRANSID({$varOne}) URM({$varOne}) BACKLOG({$varOne}) ATTACHSEC({$varOne}) ATTLS({$varOne}) AUTHENTICATE({$varOne}) CHANGEAGENT({$varOne}) HOSTTYPE({$varOne}) INSTALLAGENT({$varOne}) IPFAMILY({$varOne}) OPENSTATUS({$varOne}) PRIVACY({$varOne}) PROTOCOL({$varOne}) SOCKETCLOSE({$varOne}) SSLTYPE({$varOne})", - "TDQUEUE({$varOne}) ATITERMID({$varOne}) ATITRANID({$varOne}) ATIUSERID({$varOne}) BLOCKSIZE({$varOne}) DATABUFFERS({$varOne}) DDNAME({$varOne}) DSNAME({$varOne}) INDIRECTNAME({$varOne}) MEMBER({$varOne}) NUMITEMS({$varOne}) RECORDLENGTH({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) TRIGGERLEVEL({$varOne}) ATIFACILITY({$varOne}) BLOCKFORMAT({$varOne}) DISPOSITION({$varOne}) EMPTYSTATUS({$varOne}) ENABLESTATUS({$varOne}) ERROROPTION({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) IOTYPE({$varOne}) OPENSTATUS({$varOne}) PRINTCONTROL({$varOne}) RECORDFORMAT({$varOne}) RECOVSTATUS({$varOne}) REWIND({$varOne}) SYSOUTCLASS({$varOne}) TYPE({$varOne})", + "TDQUEUE({$varOne}) CHANGEAGENT({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLAGENT({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) ATITERMID({$varOne}) ATITRANID({$varOne}) ATIUSERID({$varOne}) BLOCKSIZE({$varOne}) DATABUFFERS({$varOne}) DDNAME({$varOne}) DSNAME({$varOne}) INDIRECTNAME({$varOne}) MEMBER({$varOne}) NUMITEMS({$varOne}) RECORDLENGTH({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) TRIGGERLEVEL({$varOne}) ATIFACILITY({$varOne}) BLOCKFORMAT({$varOne}) DISPOSITION({$varOne}) EMPTYSTATUS({$varOne}) ENABLESTATUS({$varOne}) ERROROPTION({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) IOTYPE({$varOne}) OPENSTATUS({$varOne}) PRINTCONTROL({$varOne}) RECORDFORMAT({$varOne}) RECOVSTATUS({$varOne}) REWIND({$varOne}) SYSOUTCLASS({$varOne}) TYPE({$varOne})", "TEMPSTORAGE TSMAININUSE({$varOne}) TSMAINLIMIT({$varOne})", "TERMINAL({$varOne}) NETNAME({$varOne}) AIDCOUNT({$varOne}) ALTPAGEHT({$varOne}) ALTPAGEWD({$varOne}) ALTPRINTER({$varOne}) ALTSCRNHT({$varOne}) ALTSCRNWD({$varOne}) ALTSUFFIX({$varOne}) CONSOLE({$varOne}) CORRELID({$varOne}) DEFPAGEHT({$varOne}) DEFPAGEWD({$varOne}) DEFSCRNHT({$varOne}) DEFSCRNWD({$varOne}) GCHARS({$varOne}) GCODES({$varOne}) LINKSYSTEM({$varOne}) MAPNAME({$varOne}) MAPSETNAME({$varOne}) MODENAME({$varOne}) NATLANG({$varOne}) NEXTTRANSID({$varOne}) NQNAME({$varOne}) OPERID({$varOne}) PAGEHT({$varOne}) PAGEWD({$varOne}) PRINTER({$varOne}) REMOTENAME({$varOne}) REMOTESYSNET({$varOne}) REMOTESYSTEM({$varOne}) SCRNHT({$varOne}) SCRNWD({$varOne}) TASKID({$varOne}) TCAMCONTROL({$varOne}) TERMMODEL({$varOne}) TERMPRIORITY({$varOne}) TNADDR({$varOne}) TNPORT({$varOne}) TRANSACTION({$varOne}) USERAREALEN({$varOne}) USERID({$varOne}) USERNAME({$varOne}) ACCESSMETHOD({$varOne}) ACQSTATUS({$varOne}) ALTPRTCOPYST({$varOne}) APLKYBDST({$varOne}) APLTEXTST({$varOne}) ASCII({$varOne}) ATISTATUS({$varOne}) AUDALARMST({$varOne}) AUTOCONNECT({$varOne}) BACKTRANSST({$varOne}) COLORST({$varOne}) COPYST({$varOne}) CREATESESS({$varOne}) DATASTREAM({$varOne}) DEVICE({$varOne}) DISCREQST({$varOne}) DUALCASEST({$varOne}) EXITTRACING({$varOne}) EXTENDEDDSST({$varOne}) FMHPARMST({$varOne}) FORMFEEDST({$varOne}) HFORMST({$varOne}) HILIGHTST({$varOne}) KATAKANAST({$varOne}) LIGHTPENST({$varOne}) MSRCONTROLST({$varOne}) NATURE({$varOne}) OBFORMATST({$varOne}) OBOPERIDST({$varOne}) OUTLINEST({$varOne}) PAGESTATUS({$varOne}) PARTITIONSST({$varOne}) PRINTADAPTST({$varOne}) PROGSYMBOLST({$varOne}) PRTCOPYST({$varOne}) QUERYST({$varOne}) RELREQST({$varOne}) SECURITY({$varOne}) SERVSTATUS({$varOne}) SESSIONTYPE({$varOne}) SIGNONSTATUS({$varOne}) SOSIST({$varOne}) TERMSTATUS({$varOne}) TEXTKYBDST({$varOne}) TEXTPRINTST({$varOne}) TNIPFAMILY({$varOne}) TRACING({$varOne}) TTISTATUS({$varOne}) UCTRANST({$varOne}) VALIDATIONST({$varOne}) VFORMST({$varOne}) ZCPTRACING({$varOne}) USERAREA({$varOne})", "TRACEDEST CURAUXDS({$varOne}) TABLESIZE({$varOne}) AUXSTATUS({$varOne}) GTFSTATUS({$varOne}) INTSTATUS({$varOne}) SWITCHSTATUS({$varOne})", "TRACEFLAG SINGLESTATUS({$varOne}) SYSTEMSTATUS({$varOne}) TCEXITSTATUS({$varOne}) USERSTATUS({$varOne})", - "TRACETYPE SPECIAL STANDARD COMPID({$varOne}) FLAGSET({$varOne})", + "TRACETYPE DD({$varOne}) FLAGSET({$varOne})", "TRANCLASS({$varOne}) ACTIVE({$varOne}) MAXACTIVE({$varOne}) PURGETHRESH({$varOne}) QUEUED({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) PURGEACTION({$varOne})", "TRANDUMPCODE({$varOne}) CURRENT({$varOne}) MAXIMUM({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) DUMPSCOPE({$varOne}) SHUTOPTION({$varOne}) SYSDUMPING({$varOne}) TRANDUMPING({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne})", - "TRANSACTION({$varOne}) BREXIT({$varOne}) DTIMEOUT({$varOne}) FACILITYLIKE({$varOne}) INDOUBTMINS({$varOne}) OTSTIMEOUT({$varOne}) PRIORITY({$varOne}) PROFILE({$varOne}) PROGRAM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RTIMEOUT({$varOne}) RUNAWAY({$varOne}) TCLASS({$varOne}) TRANCLASS({$varOne}) TRPROF({$varOne}) TWASIZE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMICROVER({$varOne}) APPLMINORVER({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) AVAILSTATUS({$varOne}) CMDSEC({$varOne}) DUMPING({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) ISOLATEST({$varOne}) PURGEABILITY({$varOne}) RESSEC({$varOne}) ROUTING({$varOne}) ROUTESTATUS({$varOne}) RUNAWAYTYPE({$varOne}) SCRNSIZE({$varOne}) SHUTDOWN({$varOne}) STATUS({$varOne}) STORAGECLEAR({$varOne}) TASKDATAKEY({$varOne}) TASKDATALOC({$varOne}) TRACING({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne})", + "TRANSACTION({$varOne}) BREXIT({$varOne}) DTIMEOUT({$varOne}) FACILITYLIKE({$varOne}) INDOUBTMINS({$varOne}) OTSTIMEOUT({$varOne}) PRIORITY({$varOne}) PROFILE({$varOne}) PROGRAM({$varOne}) REMOTENAME({$varOne}) REMOTESYSTEM({$varOne}) RTIMEOUT({$varOne}) RUNAWAY({$varOne}) TRANCLASS({$varOne}) TRPROF({$varOne}) TWASIZE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMICROVER({$varOne}) APPLMINORVER({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) AVAILSTATUS({$varOne}) CMDSEC({$varOne}) DUMPING({$varOne}) INDOUBT({$varOne}) INDOUBTWAIT({$varOne}) ISOLATEST({$varOne}) PURGEABILITY({$varOne}) RESSEC({$varOne}) ROUTING({$varOne}) ROUTESTATUS({$varOne}) RUNAWAYTYPE({$varOne}) SCRNSIZE({$varOne}) SHUTDOWN({$varOne}) STATUS({$varOne}) STORAGECLEAR({$varOne}) TASKDATAKEY({$varOne}) TASKDATALOC({$varOne}) TRACING({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne})", "TSMODEL({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) EXPIRYINT({$varOne}) EXPIRYINTMIN({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) POOLNAME({$varOne}) PREFIX({$varOne}) REMOTEPREFIX({$varOne}) REMOTESYSTEM({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) LOCATION({$varOne}) RECOVSTATUS({$varOne}) SECURITYST({$varOne})", "TSPOOL({$varOne}) CONNSTATUS({$varOne})", "TSQUEUE({$varOne}) EXPIRYINT({$varOne}) EXPIRYINTMIN({$varOne}) FLENGTH({$varOne}) LASTUSEDINT({$varOne}) MAXITEMLEN({$varOne}) MINITEMLEN({$varOne}) NUMITEMS({$varOne}) TRANSID({$varOne}) POOLNAME({$varOne}) TSMODEL({$varOne}) LOCATION({$varOne}) RECOVSTATUS({$varOne})", @@ -136,11 +136,14 @@ private static Stream getValidOptions() { "UOWENQ NEXT DURATION({$varOne}) ENQFAILS({$varOne}) NETUOWID({$varOne}) QUALIFIER({$varOne}) QUALLEN({$varOne}) TASKID({$varOne}) TRANSID({$varOne}) RESOURCE({$varOne}) RESLEN({$varOne}) RELATION({$varOne}) STATE({$varOne}) TYPE({$varOne})", "UOWLINK({$varOne}) HOST({$varOne}) PORT({$varOne}) BRANCHQUAL({$varOne}) LINK({$varOne}) NETUOWID({$varOne}) RMIQFY({$varOne}) SYSID({$varOne}) UOW({$varOne}) URID({$varOne}) XID({$varOne}) PROTOCOL({$varOne}) RESYNCSTATUS({$varOne}) ROLE({$varOne}) TYPE({$varOne})", "URIMAP({$varOne}) ATOMSERVICE({$varOne}) CERTIFICATE({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CHARACTERSET({$varOne}) CIPHERS({$varOne}) CONVERTER({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) HFSFILE({$varOne}) HOST({$varOne}) HOSTCODEPAGE({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) IPRESOLVED({$varOne}) LOCATION({$varOne}) MEDIATYPE({$varOne}) NUMCIPHERS({$varOne}) PATH({$varOne}) PIPELINE({$varOne}) PORT({$varOne}) PROGRAM({$varOne}) SOCKETCLOSE({$varOne}) SOCKPOOLSIZE({$varOne}) TCPIPSERVICE({$varOne}) TEMPLATENAME({$varOne}) TRANSACTION({$varOne}) USERID({$varOne}) WEBSERVICE({$varOne}) APPLICATION({$varOne}) APPLMAJORVER({$varOne}) APPLMINORVER({$varOne}) APPLMICROVER({$varOne}) OPERATION({$varOne}) PLATFORM({$varOne}) ANALYZERSTAT({$varOne}) AUTHENTICATE({$varOne}) AVAILSTATUS({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) HOSTTYPE({$varOne}) INSTALLAGENT({$varOne}) IPFAMILY({$varOne}) REDIRECTTYPE({$varOne}) SCHEME({$varOne}) USAGE({$varOne})", - "VTAM GRNAME({$varOne}) PSDINTERVAL({$varOne}) PSDINTHRS({$varOne}) PSDINTMINS({$varOne}) PSDINTSECS({$varOne}) GRSTATUS({$varOne}) OPENSTATUS({$varOne}) PSTYPE({$varOne})", + "VTAM GRNAME({$varOne}) PSDINTHRS({$varOne}) PSDINTMINS({$varOne}) PSDINTSECS({$varOne}) GRSTATUS({$varOne}) OPENSTATUS({$varOne}) PSTYPE({$varOne})", "WEB GARBAGEINT({$varOne}) TIMEOUTINT({$varOne})", "WEBSERVICE({$varOne}) ARCHIVEFILE({$varOne}) BINDING({$varOne}) CCSID({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) CONTAINER({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) ENDPOINT({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) LASTMODTIME({$varOne}) MAPPINGLEVEL({$varOne}) MAPPINGRNUM({$varOne}) MAPPINGVNUM({$varOne}) MINRUNLEVEL({$varOne}) MINRUNRNUM({$varOne}) MINRUNVNUM({$varOne}) PIPELINE({$varOne}) PROGRAM({$varOne}) URIMAP({$varOne}) WSBIND({$varOne}) WSDLFILE({$varOne}) CHANGEAGENT({$varOne}) INSTALLAGENT({$varOne}) PGMINTERFACE({$varOne}) STATE({$varOne}) VALIDATIONST({$varOne}) XOPDIRECTST({$varOne}) XOPSUPPORTST({$varOne})", "WLMHEALTH ADJUSTMENT({$varOne}) HEALTH({$varOne}) HEALTHABSTIM({$varOne}) INTERVAL({$varOne}) OPENSTATUS({$varOne})", - "XMLTRANSFORM({$varOne})BUNDLE({$varOne}) CCSID({$varOne}) MAPPINGLEVEL({$varOne}) MAPPINGRNUM({$varOne}) MAPPINGVNUM({$varOne}) MINRUNLEVEL({$varOne}) MINRUNRNUM({$varOne}) MINRUNVNUM({$varOne}) XMLSCHEMA({$varOne}) XSDBIND({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) VALIDATIONST({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne})"); + "XMLTRANSFORM({$varOne}) BUNDLE({$varOne}) CCSID({$varOne}) MAPPINGLEVEL({$varOne}) MAPPINGRNUM({$varOne}) MAPPINGVNUM({$varOne}) MINRUNLEVEL({$varOne}) MINRUNRNUM({$varOne}) MINRUNVNUM({$varOne}) XMLSCHEMA({$varOne}) XSDBIND({$varOne}) CHANGEAGREL({$varOne}) CHANGETIME({$varOne}) CHANGEUSRID({$varOne}) DEFINESOURCE({$varOne}) DEFINETIME({$varOne}) INSTALLTIME({$varOne}) INSTALLUSRID({$varOne}) VALIDATIONST({$varOne}) CHANGEAGENT({$varOne}) ENABLESTATUS({$varOne}) INSTALLAGENT({$varOne})", + "UOWENQ NEXT ENQSCOPE({$varOne}) RESOURCE({$varOne}) RESLEN({$varOne}) UOW({$varOne})", + "UOWENQ START", + "UOWDSNFAIL START"); } private static final String INVALID_BROWSE_BRFACILITY = @@ -203,6 +206,316 @@ private static Stream getValidOptions() { private static final String BUNDLEPART_INVALID = "INQUIRE {_BUNDLEPART(1) BUNDLE(1)|errorOne_}"; + private static final String BUNDLEPART_BROWSE_WITH_PARAM_INVALID = "INQUIRE BUNDLEPART{(1)|errorOne} START BUNDLE(1)"; + + private static final String ENQ_VALID = "INQUIRE ENQ NEXT RESOURCE({$varOne}) RESLEN({$varOne}) UOW({$varOne})"; + + private static final String TRACETYPE_INVALID = "INQUIRE TRACETYPE {SPECIAL|errorOne} {FLAGSET|errorTwo}(1) {AP|errorThree}(1) {APPLICATION|errorFour}(1)"; + + private static final String TRANSACTION_INVALID = "INQUIRE TRANSACTION(1) {TCLASS|errorOne}(1) {TRANCLASS|errorTwo}(1)"; + + private static final String TCPIPSERVICE_VALID = "INQUIRE TCPIPSERVICE START"; + + private static final String TASKLIST_INVALID = "INQUIRE {_TASK LIST DISPATCHABLE RUNNING SETTRANSID(1) SUSPENDED|errorOne|errorTwo_}"; + + private static final String TASK_VALID = "INQUIRE TASK"; + + private static final String TAG_VALID = "INQUIRE TAG({$varOne}) NEXT"; + + private static final String TAG_INVALID = "INQUIRE {TAG|errorOne} NEXT"; + + private static final String SUBPOOL_VALID = "INQUIRE SUBPOOL START"; + + private static final String STORAGE64_INVALID = "INQUIRE STORAGE64 NUMELEMENTS(1) {DSANAME|errorOne}(1)"; + + private static final String STORAGE_INVALID = "INQUIRE STORAGE NUMELEMENTS(1) {ELEMENT|errorOne}(1)"; + + private static final String STATS_INVALID = "INQUIRE {_STATISTICS {ENDOFDAY|errorOne}(1) {ENDOFDAYHRS|errorTwo}(1) RECORDING(1)|errorThree|errorFour_}"; + + private static final String PROGRAM_INVALID = "INQUIRE {_PROGRAM(1) APPLICATION(1) APPLMAJORVER(1) APPLMICROVER(1) APPLMINORVER(1)|errorOne_}"; + + private static final String PROGRAM_VALID = "INQUIRE PROGRAM({$varOne})"; + + private static final String PROCESSTYPE_VALID = "INQUIRE PROCESSTYPE({$varOne})"; + + private static final String NETNAME_VALID = "INQUIRE NETNAME({$varOne}) NEXT TERMINAL({$varOne})"; + + private static final String MQCONN_VALID = "INQUIRE MQCONN RESYNCMEMBER({$varOne})"; + + private static final String SECDISCOVERY_VALID = "INQUIRE SECDISCOVERY STATUS({$varOne}) LASTSECDTIME({$varOne})"; + + private static final String XMLTRANS_INVALID = "INQUIRE {XMLTRANSFORM|errorOne}"; + + private static final String VTAM_INVALID = "INQUIRE VTAM {PSDINTERVAL|errorOne}(1) {PSDINTHRS|errorTwo}(1) PSDINTMINS(1) PSDINTSECS(1)"; + + private static final String TASKLIST_INVALID_LIST = "INQUIRE {_TASK LISTSIZE(1)|errorOne_}"; + + @Test + void testInvalidTaskListTwo() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: LIST", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(TASKLIST_INVALID_LIST, expectedDiagnostics, "SP"); + } + + @Test + void testInvalidVTAM() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: PSDINTHRS with PSDINTERVAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: PSDINTHRS with PSDINTERVAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorThree", + new Diagnostic( + new Range(), + "Invalid option or parameter provided: Missing required option parameter", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(VTAM_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testInvalidXMLTrans() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option or parameter provided: Missing required option parameter", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(XMLTRANS_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testLastSecD() { + CICSTestUtils.noErrorTest(SECDISCOVERY_VALID, "SP"); + } + + @Test + void testMQConn() { + CICSTestUtils.noErrorTest(MQCONN_VALID, "SP"); + } + + @Test + void testNetname() { + CICSTestUtils.noErrorTest(NETNAME_VALID, "SP"); + } + + @Test + void testProcesstype() { + CICSTestUtils.noErrorTest(PROCESSTYPE_VALID, "SP"); + } + + @Test + void testProgram() { + CICSTestUtils.noErrorTest(PROGRAM_VALID, "SP"); + } + + @Test + void testInvalidProgram() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: PLATFORM with APPLICATION", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(PROGRAM_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testInvalidStatistics() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: ENDOFDAY or ENDOFDAYHRS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: ENDOFDAY or ENDOFDAYHRS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorThree", + new Diagnostic( + new Range(), + "Missing required option: ENDOFDAYMINS with ENDOFDAYHRS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorFour", + new Diagnostic( + new Range(), + "Missing required option: ENDOFDAYSECS with ENDOFDAYHRS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(STATS_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testInvalidStorage() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option provided: ELEMENT with NUMELEMENTS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(STORAGE_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testInvalidS64() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option provided: DSANAME with NUMELEMENTS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(STORAGE64_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testSubPool() { + CICSTestUtils.noErrorTest(SUBPOOL_VALID, "SP"); + } + + @Test + void testInvalidTag() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option or parameter provided: Missing required option parameter", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(TAG_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testTagValid() { + CICSTestUtils.noErrorTest(TAG_VALID, "SP"); + } + + @Test + void testTaskValid() { + CICSTestUtils.noErrorTest(TASK_VALID, "SP"); + } + + @Test + void testInvalidTaskList() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: LISTSIZE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Missing required option for: SETTRANSID without SET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(TASKLIST_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testTCPIPServValid() { + CICSTestUtils.noErrorTest(TCPIPSERVICE_VALID, "SP"); + } + + @Test + void testInvalidTransaction() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: TCLASS and TRANCLASS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: TCLASS and TRANCLASS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(TRANSACTION_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testInvalidTracetype() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: FLAGSET or SPECIAL or STANDARD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: FLAGSET or SPECIAL or STANDARD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorThree", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: AP and APPLICATION", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorFour", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: AP and APPLICATION", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(TRACETYPE_INVALID, expectedDiagnostics, "SP"); + } + + @Test + void testENQValid() { + CICSTestUtils.noErrorTest(ENQ_VALID, "SP"); + } + + @Test + void testInvalidBundlepartBrowseWithParam() { + Map expectedDiagnostics = + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option or parameter provided: Parameter usage when browsing with START or END", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + CICSTestUtils.errorTest(BUNDLEPART_BROWSE_WITH_PARAM_INVALID, expectedDiagnostics, "SP"); + } + @Test void testInvalidBundlepartBrowseOnly() { Map expectedDiagnostics = diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java index 7757a15e19..bbef69a6f5 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSRelease.java @@ -14,12 +14,12 @@ */ package org.eclipse.lsp.cobol.usecases; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -35,7 +35,7 @@ public class TestCICSRelease { "RELEASE PROGRAM({$varOne})"; private static final String RELEASE_INVALID_NO_PROGRAM = - "{_RELEASE|errorOne|errorTwo_}"; + "RELEASE"; private static final String RELEASE_INVALID_EXTRA_OPTION = "RELEASE PROGRAM({$varOne}) {PROGRAM|errorOne}({$varOne})"; @@ -47,18 +47,19 @@ void testReleaseValid() { @Test void testReleaseInvalidNoProgram() { - CICSTestUtils.errorTest( + CICSTestUtils.errorTestWithEndExecError( RELEASE_INVALID_NO_PROGRAM, + ImmutableList.of("errorOne"), ImmutableMap.of( "errorOne", new Diagnostic( - new Range(new Position(13, 12), new Position(13, 12)), + new Range(), "Missing required option: PROGRAM", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), - "errorTwo", + "end-exec-error", new Diagnostic( - new Range(new Position(13, 12), new Position(13, 20)), + new Range(), "Syntax error on 'END-EXEC'", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java index 08e880168e..69be9abc31 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSReset.java @@ -14,12 +14,12 @@ */ package org.eclipse.lsp.cobol.usecases; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -37,7 +37,7 @@ public class TestCICSReset { "RESET ACTIVITY({$varOne})"; private static final String RESET_INVALID = - "RESET {|errorOne}"; + "RESET "; @Test void testResetAcqprocessValid() { @@ -51,12 +51,13 @@ void testResetActivityValid() { @Test void testResetInvalid() { - CICSTestUtils.errorTest( + CICSTestUtils.errorTestWithEndExecError( RESET_INVALID, + ImmutableList.of(), ImmutableMap.of( - "errorOne", + "end-exec-error", new Diagnostic( - new Range(new Position(14, 12), new Position(14, 20)), + new Range(), "Syntax error on 'END-EXEC'", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSignalEvent.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSignalEvent.java new file mode 100644 index 0000000000..b0bff9df6b --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSignalEvent.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Test CICS SIGNAL EVENT command. Documentation link: SIGNAL EVENT Command + * + *

This class tests the SIGNAL EVENT command. + */ +public class TestCICSSignalEvent { + private static final String SIGNAL_EVENT_VALID_MINIMAL = + "SIGNAL EVENT({$varOne})"; + + private static final String SIGNAL_FROM_INVALID = + "SIGNAL {FROM(123)|errorOne}"; + + private static final String SIGNAL_EVENT_VALID_FROMCHANNEL = + "SIGNAL EVENT({$varOne}) FROMCHANNEL({$varTwo})"; + + private static final String SIGNAL_EVENT_VALID_FROM = + "SIGNAL EVENT({$varOne}) FROM({$varTwo}) FROMLENGTH({$varThree})"; + + private static final String SIGNAL_EVENT_INVALID_BOTH_FROM = + "SIGNAL EVENT({$varOne}) {FROMCHANNEL|errorOne}({$varTwo}) {FROM|errorTwo}({$varThree})"; + + private static final String SIGNAL_EVENT_INVALID_FROMLENGTH_WITHOUT_FROM = + "SIGNAL {_EVENT({$varOne}) FROMLENGTH(123)|errorOne_}"; + + @Test + void testSignalEventValidMinimal() { + CICSTestUtils.noErrorTest(SIGNAL_EVENT_VALID_MINIMAL); + } + + @Test + void testSignalFromInvalid() { + CICSTestUtils.errorTest( + SIGNAL_FROM_INVALID, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: EVENT", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testSignalEventValidFromchannel() { + CICSTestUtils.noErrorTest(SIGNAL_EVENT_VALID_FROMCHANNEL); + } + + @Test + void testSignalEventValidFrom() { + CICSTestUtils.noErrorTest(SIGNAL_EVENT_VALID_FROM); + } + + @Test + void testSignalEventInvalidBothFrom() { + CICSTestUtils.errorTest( + SIGNAL_EVENT_INVALID_BOTH_FROM, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: FROMCHANNEL or FROM", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: FROMCHANNEL or FROM", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testSignalEventInvalidFromlengthWithoutFrom() { + CICSTestUtils.errorTest( + SIGNAL_EVENT_INVALID_FROMLENGTH_WITHOUT_FROM, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: FROM", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSStartbr.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSStartbr.java new file mode 100644 index 0000000000..7069a2ed49 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSStartbr.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Test CICS STARTBR command. Documentation link: STARTBR Command + * + *

This class tests the STARTBR command. + */ +public class TestCICSStartbr { + private static final String STARTBR_VALID_MINIMAL = + "STARTBR FILE({$varOne}) RIDFLD({$varTwo})"; + + private static final String STARTBR_DATASET_VALID = + "STARTBR DATASET({$varOne}) RIDFLD({$varTwo})"; + + private static final String STARTBR_INVALID_NO_KEYLENGTH = + "STARTBR {_FILE({$varOne}) RIDFLD({$varTwo}) GENERIC|errorOne_}"; + + private static final String STARTBR_VALID_FULL = + "STARTBR FILE({$varOne}) RIDFLD({$varTwo}) KEYLENGTH({$varThree}) GENERIC REQID({$varFour}) SYSID({$varFive}) DEBKEY GTEQ"; + + private static final String STARTBR_SYSID_INVALID = + "STARTBR {_FILE({$varOne}) RIDFLD({$varTwo}) SYSID({$varFive}) GTEQ|errorOne_}"; + + private static final String STARTBR_INVALID_NO_FILE = + "STARTBR {_RIDFLD({$varTwo}) KEYLENGTH({$varOne}) GENERIC|errorOne_}"; + + private static final String STARTBR_INVALID_NO_RIDFLD = + "STARTBR {_FILE({$varOne}) KEYLENGTH({$varTwo}) GENERIC|errorOne_}"; + + private static final String STARTBR_INVALID_MULTIPLE_POSITIONING = + "STARTBR FILE({$varOne}) RIDFLD({$varTwo}) {DEBKEY|errorOne} {RBA|errorTwo}"; + + private static final String STARTBR_INVALID_MULTIPLE_COMPARISON = + "STARTBR FILE({$varOne}) RIDFLD({$varTwo}) {GTEQ|errorOne} {EQUAL|errorTwo}"; + + @Test + void testStartbrValidMinimal() { + CICSTestUtils.noErrorTest(STARTBR_VALID_MINIMAL); + } + + @Test + void testStartbrDatasetValid() { + CICSTestUtils.noErrorTest(STARTBR_DATASET_VALID); + } + + @Test + void testStartbrInvalidNoKeylength() { + CICSTestUtils.errorTest( + STARTBR_INVALID_NO_KEYLENGTH, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: KEYLENGTH", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testStartbrSysidInvalid() { + CICSTestUtils.errorTest( + STARTBR_SYSID_INVALID, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, none provided: KEYLENGTH, RBA, RRN, or XRBA", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testStartbrValidFull() { + CICSTestUtils.noErrorTest(STARTBR_VALID_FULL); + } + + @Test + void testStartbrInvalidNoFile() { + CICSTestUtils.errorTest( + STARTBR_INVALID_NO_FILE, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, none provided: FILE or DATASET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testStartbrInvalidNoRidfld() { + CICSTestUtils.errorTest( + STARTBR_INVALID_NO_RIDFLD, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: RIDFLD", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testStartbrInvalidMultiplePositioning() { + CICSTestUtils.errorTest( + STARTBR_INVALID_MULTIPLE_POSITIONING, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: DEBKEY, DEBREC, RBA, RRN, or XRBA", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: DEBKEY, DEBREC, RBA, RRN, or XRBA", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testStartbrInvalidMultipleComparison() { + CICSTestUtils.errorTest( + STARTBR_INVALID_MULTIPLE_COMPARISON, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: GTEQ or EQUAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: GTEQ or EQUAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSyncPoint.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSyncPoint.java new file mode 100644 index 0000000000..9e476a4cd3 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSSyncPoint.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Test CICS SYNCPOINT commands. Documentation link: SYNCPOINT Command + * + *

This class tests all variations of the SYNCPOINT command: standard and ROLLBACK. + */ +public class TestCICSSyncPoint { + private static final String SYNCPOINT_STANDARD_VALID = + "SYNCPOINT"; + + private static final String SYNCPOINT_ROLLBACK_VALID = + "SYNCPOINT ROLLBACK"; + + private static final String SYNCPOINT_ROLLBACK_INVALID = + "SYNCPOINT ROLLBACK {ROLLBACK|errorOne}"; + + @Test + void testSyncpointStandardValid() { + CICSTestUtils.noErrorTest(SYNCPOINT_STANDARD_VALID); + } + + @Test + void testSyncpointRollbackValid() { + CICSTestUtils.noErrorTest(SYNCPOINT_ROLLBACK_VALID); + } + + @Test + void testSyncpointRollbackInvalid() { + CICSTestUtils.errorTest( + SYNCPOINT_ROLLBACK_INVALID, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: ROLLBACK", + DiagnosticSeverity.Warning, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSUpdate.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSUpdate.java new file mode 100644 index 0000000000..ad3b756e2e --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSUpdate.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Test CICS UPDATE COUNTER and UPDATE DCOUNTER commands. Documentation link: UPDATE COUNTER DCOUNTER Command + * + *

This class tests all variations of the UPDATE command: COUNTER and DCOUNTER. + */ +public class TestCICSUpdate { + private static final String UPDATE_COUNTER_VALID = + "UPDATE COUNTER({$varOne}) POOL({$varTwo}) VALUE({$varThree}) COMPAREMIN({$varFour}) COMPAREMAX({$varFive})"; + + private static final String UPDATE_COUNTER_INVALID = + "UPDATE {_POOL({$varTwo})|errorOne|errorTwo_}"; + + private static final String UPDATE_DCOUNTER_VALID = + "UPDATE DCOUNTER({$varOne}) POOL({$varTwo}) VALUE({$varThree}) COMPAREMIN({$varFour}) COMPAREMAX({$varFive})"; + + private static final String UPDATE_DCOUNTER_INVALID = + "UPDATE DCOUNTER({$varOne}) {DCOUNTER|errorOne}({$varOne}) POOL({$varTwo}) VALUE({$varThree})"; + + @Test + void testUpdateCounterValid() { + CICSTestUtils.noErrorTest(UPDATE_COUNTER_VALID); + } + + @Test + void testUpdateCounterInvalid() { + CICSTestUtils.errorTest( + UPDATE_COUNTER_INVALID, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Exactly one option required, none provided: COUNTER or DCOUNTER", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Missing required option: VALUE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testUpdateDcounterValid() { + CICSTestUtils.noErrorTest(UPDATE_DCOUNTER_VALID); + } + + @Test + void testUpdateDcounterInvalid() { + CICSTestUtils.errorTest( + UPDATE_DCOUNTER_INVALID, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: DCOUNTER", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java index e4aafab223..69fae1b536 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsDelayStatement.java @@ -21,7 +21,6 @@ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -82,9 +81,9 @@ void test_delayStatement_flow3() { private static final String DELAY_VALID_ALL = "DELAY FOR HOURS(100) MINUTES(20) SECONDS(10) MILLISECS(1)"; private static final String DELAY_FOR_UNTIL_INVALID = - "DELAY { FOR | error2 } HOURS(1) {UNTIL | error} "; + "DELAY {FOR|error2} HOURS(1) {UNTIL|error} "; private static final String DELAY_INTERVAL_TIME_INVALID = - "DELAY { INTERVAL | errorIntervalTime2 }(100) {TIME | errorIntervalTime }(100)"; + "DELAY {INTERVAL|errorIntervalTime2}(100) {TIME|errorIntervalTime}(100)"; private static final String DELAY_UNTIL_MILLISEC_INVALID = "DELAY UNTIL HOURS({$varFour}) {MILLISECS | errorMillisecs}(100)"; @@ -106,7 +105,7 @@ void testDelayForUntilInvalid() { ImmutableMap.of( "error", new Diagnostic( - new Range(new Position(15, 12), new Position(15, 17)), + new Range(), "Exactly one option required, options are mutually exclusive: INTERVAL, TIME, UNTIL, FOR", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), @@ -124,7 +123,7 @@ void testDelayIntervalTimeInvalid() { ImmutableMap.of( "errorIntervalTime", new Diagnostic( - new Range(new Position(14, 12), new Position(14, 16)), + new Range(), "Exactly one option required, options are mutually exclusive: INTERVAL, TIME, UNTIL, FOR", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java index 54cfe22b59..005079604f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java @@ -36,7 +36,7 @@ public class TestCicsExciGetContainerStatement { + "\n" + " PROCEDURE DIVISION.\n" + " EXEC CICS HANDLE CONDITION \n" - + " ERRORS \n" + + " ERROR \n" + " RESP({$RETURN-CODE})\n" + " END-EXEC.\n" + "\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExtractSP.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExtractSP.java new file mode 100644 index 0000000000..7fe8e32504 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExtractSP.java @@ -0,0 +1,388 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Test CICS EXTRACT System Programming commands. Documentation links: + * + * EXTRACT STATISTICS Command + * + * EXTRACT EXIT Command + *

This class tests all variations of the EXTRACT System Programming commands found in the links above. + */ +public class TestCicsExtractSP { + private static final String EXIT_ALL_OPTIONS = "EXTRACT EXIT PROGRAM({$varOne}) ENTRYNAME({$varTwo}) GALENGTH({$varThree}) GASET({$varFour})"; + private static final String EXIT_BARE = "EXTRACT PROGRAM({$varOne}) GASET({$varFour}) EXIT GALENGTH({$varThree})"; + + private static final String STATISTICS_ALL_OPTIONS = "EXTRACT STATISTICS RESTYPE({$varOne}) RESID({$varTwo}) RESIDLEN({$varThree}) SET({$varFour})" + + " SUBRESTYPE({$varFive}) SUBRESID({$varSix}) SUBRESIDLEN({$varOne}) APPLICATION({$varTwo}) APPLMAJORVER({$varThree}) APPLMINORVER({$varFour})" + + " APPLMICROVER({$varFive}) PLATFORM({$varSix}) LASTRESET({$varThree})"; + private static final String STATISTICS_SOME_ONE = "EXTRACT ASYNCSERVICE SUBRESID({$varSix}) SUBRESIDLEN({$varOne}) SET({$varFour}) STATISTICS SUBRESTYPE({$varFive})"; + private static final String STATISTICS_SOME_TWO = "EXTRACT RESID({$varTwo}) APPLMAJORVER({$varThree}) APPLICATION({$varTwo}) RESTYPE({$varOne}) STATISTICS APPLMINORVER({$varFour}) APPLMICROVER({$varFive}) SET({$varFour}) PLATFORM({$varSix})"; + private static final String STATISTICS_SOME_THREE = "EXTRACT RESIDLEN({$varThree}) STATISTICS LASTRESETMIN({$varFive}) LASTRESETHRS({$varSix}) SET({$varFour}) LASTRESETSEC({$varOne}) TASKSUBPOOL RESID({$varTwo})"; + private static final String STATISTICS_SOME_FOUR = "EXTRACT STATISTICS SET({$varFour}) BUNDLE RESID({$varTwo}) SUBRESID({$varSix}) POLICYRULE"; + private static final String STATISTICS_BARE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS"; + + private static final String EXIT_INVALID_MISSING_EXIT = "EXTRACT {_GASET({$varFour}) GALENGTH({$varThree}) PROGRAM({$varOne})|error_}"; + private static final String EXIT_INVALID_MISSING_PROGRAM = "EXTRACT {_EXIT ENTRYNAME({$varTwo}) GALENGTH({$varThree}) GASET({$varFour})|error_}"; + private static final String EXIT_INVALID_MISSING_GALENGTH = "EXTRACT {_GASET({$varFour}) EXIT PROGRAM({$varOne})|error_}"; + private static final String EXIT_INVALID_MISSING_GASET = "EXTRACT {_PROGRAM({$varOne}) EXIT GALENGTH({$varThree})|error_}"; + + private static final String STATISTICS_INVALID_MISSING_RESTYPE = "EXTRACT {_SET({$varFour}) STATISTICS|error_}"; + private static final String STATISTICS_INVALID_MISSING_SET = "EXTRACT {_RESTYPE({$varOne}) STATISTICS|error_}"; + private static final String STATISTICS_INVALID_MISSING_STATISTICS = "EXTRACT {_SET({$varFour}) RESTYPE({$varOne})|error_}"; + private static final String STATISTICS_INVALID_MISSING_RESID_ONE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {RESIDLEN|error}({$varThree})"; + private static final String STATISTICS_INVALID_MISSING_RESID_TWO = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {APPLMAJORVER|errorOne}({$varThree}) {APPLICATION|errorTwo}({$varTwo}) {APPLMINORVER|errorThree}({$varFour}) {APPLMICROVER|errorFour}({$varFive})"; + private static final String STATISTICS_INVALID_MISSING_SUBRESID_ONE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {SUBRESIDLEN|errorOne|errorTwo}({$varOne})"; + private static final String STATISTICS_INVALID_MISSING_SUBRESID_TWO = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {_SUBRESTYPE({$varFive})|error_}"; + private static final String STATISTICS_INVALID_MISSING_SUBRESTYPE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {SUBRESID|errorOne}({$varSix}) {SUBRESIDLEN|errorTwo}({$varOne})"; + private static final String STATISTICS_INVALID_APPLCONTEXT_ONE = "EXTRACT {_SET({$varFour}) RESTYPE({$varOne}) STATISTICS PLATFORM({$varSix}) RESID({$varTwo})|error_}"; + private static final String STATISTICS_INVALID_APPLCONTEXT_TWO = "EXTRACT {_SET({$varFour}) RESID({$varTwo}) RESTYPE({$varOne}) STATISTICS APPLICATION({$varSix}) APPLMAJORVER({$varThree}) APPLMINORVER({$varFour}) APPLMICROVER({$varFive})|error_}"; + private static final String STATISTICS_INVALID_LAST_TIME_ONE = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS LASTRESET({$varThree}) {LASTRESETMIN|errorOne}({$varFive}) {LASTRESETHRS|errorTwo}({$varSix}) {LASTRESETSEC|errorThree}({$varOne})"; + private static final String STATISTICS_INVALID_LAST_TIME_TWO = "EXTRACT SET({$varFour}) RESTYPE({$varOne}) STATISTICS {LASTRESET|errorOne}({$varThree}) {LASTRESETABS|errorTwo}({$varOne})"; + private static final String STATISTICS_INVALID_LAST_TIME_THREE = "EXTRACT {_SET({$varFour}) RESTYPE({$varOne}) STATISTICS LASTRESETHRS({$varOne})|error_}"; + private static final String STATISTICS_INVALID_DUPLICATE_RESTYPE_ONE = "EXTRACT SET({$varFour}) {_RESTYPE({$varOne})|error_} STATISTICS {_ATOMSERVICE|error_}"; + private static final String STATISTICS_INVALID_DUPLICATE_RESTYPE_TWO = "EXTRACT SET({$varFour}) {_BUNDLE|error_} STATISTICS {_ASYNCSERVICE|error_}"; + private static final String STATISTICS_INVALID_DUPLICATE_SUBRESTYPE = "EXTRACT SUBRESID({$varSix}) SET({$varFour}) RESTYPE({$varOne}) {SUBRESTYPE|error}({$varFive}) {CAPTURESPEC|error} STATISTICS"; + private static final String STATISTICS_WARNING_DUPLICATE_RESTYPE = "EXTRACT SET({$varFour}) STATISTICS ASYNCSERVICE {ASYNCSERVICE|warning}"; + + @Test + void testAllExitOptions() { + CICSTestUtils.noErrorTest(EXIT_ALL_OPTIONS, "SP"); + } + + @Test + void testExitBare() { + CICSTestUtils.noErrorTest(EXIT_BARE, "SP"); + } + + @Test + void testAllStatisticsOptions() { + CICSTestUtils.noErrorTest(STATISTICS_ALL_OPTIONS, "SP"); + } + + @Test + void testSomeStatisticsOptionsOne() { + CICSTestUtils.noErrorTest(STATISTICS_SOME_ONE, "SP"); + } + + @Test + void testSomeStatisticsOptionsTwo() { + CICSTestUtils.noErrorTest(STATISTICS_SOME_TWO, "SP"); + } + + @Test + void testSomeStatisticsOptionsThree() { + CICSTestUtils.noErrorTest(STATISTICS_SOME_THREE, "SP"); + } + + @Test + void testSomeStatisticsOptionsFour() { + CICSTestUtils.noErrorTest(STATISTICS_SOME_FOUR, "SP"); + } + + @Test + void testStatisticsBare() { + CICSTestUtils.noErrorTest(STATISTICS_BARE, "SP"); + } + + @Test + void testInvalidNoExit() { + CICSTestUtils.errorTest(EXIT_INVALID_MISSING_EXIT, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: EXIT", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidNoProgram() { + CICSTestUtils.errorTest(EXIT_INVALID_MISSING_PROGRAM, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: PROGRAM", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidNoGalength() { + CICSTestUtils.errorTest(EXIT_INVALID_MISSING_GALENGTH, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: GALENGTH", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidNoGaset() { + CICSTestUtils.errorTest(EXIT_INVALID_MISSING_GASET, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: GASET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidNoRestype() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_RESTYPE, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: RESTYPE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidNoSubresid() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SUBRESID_ONE, ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option provided: SUBRESIDLEN without SUBRESTYPE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Invalid option provided: SUBRESIDLEN without SUBRESID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidNoSubresidTwo() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SUBRESID_TWO, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Invalid option provided: SUBRESTYPE without SUBRESID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidLastTimeOne() { + CICSTestUtils.errorTest(STATISTICS_INVALID_LAST_TIME_ONE, ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option provided: LASTRESETMIN with LASTRESET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Invalid option provided: LASTRESETHRS with LASTRESET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorThree", + new Diagnostic( + new Range(), + "Invalid option provided: LASTRESETSEC with LASTRESET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidLastTimeTwo() { + CICSTestUtils.errorTest(STATISTICS_INVALID_LAST_TIME_TWO, ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option provided: LASTRESET with LASTRESETABS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Invalid option provided: LASTRESETABS with LASTRESET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidLastTimeThree() { + CICSTestUtils.errorTest(STATISTICS_INVALID_LAST_TIME_THREE, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "If one option is specified, all options must be present: LASTRESETHRS, LASTRESETMIN, LASTRESETSEC", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidMissingStatistics() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_STATISTICS, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: STATISTICS", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidMissingSet() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SET, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Missing required option: SET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidMissingResidOne() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_RESID_ONE, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Invalid option provided: RESIDLEN without RESID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidMissingResidTwo() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_RESID_TWO, ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option provided: APPLMAJORVER without RESID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Invalid option provided: APPLICATION without RESID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorThree", + new Diagnostic( + new Range(), + "Invalid option provided: APPLMINORVER without RESID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorFour", + new Diagnostic( + new Range(), + "Invalid option provided: APPLMICROVER without RESID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidMissingSubrestype() { + CICSTestUtils.errorTest(STATISTICS_INVALID_MISSING_SUBRESTYPE, ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Invalid option provided: SUBRESID without SUBRESTYPE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "errorTwo", + new Diagnostic( + new Range(), + "Invalid option provided: SUBRESIDLEN without SUBRESTYPE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidApplContextOne() { + CICSTestUtils.errorTest(STATISTICS_INVALID_APPLCONTEXT_ONE, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "If one option is specified, all options must be present: APPLICATION, APPLMAJORVER, APPLMINORVER, APPLMICROVER, PLATFORM", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidApplContextTwo() { + CICSTestUtils.errorTest(STATISTICS_INVALID_APPLCONTEXT_TWO, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "If one option is specified, all options must be present: APPLICATION, APPLMAJORVER, APPLMINORVER, APPLMICROVER, PLATFORM", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidDuplicateRestypeOne() { + CICSTestUtils.errorTest(STATISTICS_INVALID_DUPLICATE_RESTYPE_ONE, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Multiple RESTYPE options are not allowed", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidDuplicateRestypeTwo() { + CICSTestUtils.errorTest(STATISTICS_INVALID_DUPLICATE_RESTYPE_TWO, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Multiple RESTYPE options are not allowed", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void testInvalidDuplicateSubrestype() { + CICSTestUtils.errorTest(STATISTICS_INVALID_DUPLICATE_SUBRESTYPE, ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: SUBRESTYPE or CAPTURESPEC or POLICYRULE", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), "SP"); + } + + @Test + void tesWarningDuplicateRestype() { + CICSTestUtils.errorTest(STATISTICS_WARNING_DUPLICATE_RESTYPE, ImmutableMap.of( + "warning", + new Diagnostic( + new Range(), + "Excessive options provided for: ASYNCSERVICE", + DiagnosticSeverity.Warning, + ErrorSource.PARSING.getText())), "SP"); + } + +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsRewindCounter.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsRewindCounter.java new file mode 100644 index 0000000000..0d63e8720f --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsRewindCounter.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2025 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + + import com.google.common.collect.ImmutableMap; + import org.eclipse.lsp.cobol.common.error.ErrorSource; + import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; + import org.eclipse.lsp4j.Diagnostic; + import org.eclipse.lsp4j.DiagnosticSeverity; + import org.eclipse.lsp4j.Range; + import org.junit.jupiter.api.Test; + + import java.util.Map; + +/** + * Test CICS REWIND COUNTER command. Documentation link: REWIND COUNTER Command + * + *

This class tests all variations of the REWIND COUNTER command found in the link above. + */ +public class TestCicsRewindCounter { + private static final String REWIND_COUNTER_ALL_VALID = + "REWIND NOHANDLE COUNTER({$varFour}) POOL({$varFour}) INCREMENT({$varFour}) NOSUSPEND"; + private static final String REWIND_DCOUNTER_ALL_VALID = + "REWIND NOHANDLE DCOUNTER({$varFour}) POOL({$varFour}) INCREMENT({$varFour}) NOSUSPEND"; + private static final String REWIND_INVALID = + "REWIND {COUNTER|error}({$varFour}) {DCOUNTER|error2}({$varFour})"; + private static final String REWIND_COUNTER_INVALID = + "REWIND COUNTER({$varFour}) {COUNTER|error}({$varFour})"; + + @Test + void testRewindCounterValid() { + CICSTestUtils.noErrorTest(REWIND_COUNTER_ALL_VALID); + } + @Test + void testRewindDCounterValid() { + CICSTestUtils.noErrorTest(REWIND_DCOUNTER_ALL_VALID); + } + + @Test + void testRewindInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: COUNTER or DCOUNTER", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "error2", + new Diagnostic( + new Range(), + "Exactly one option required, options are mutually exclusive: COUNTER or DCOUNTER", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()) + ); + CICSTestUtils.errorTest(REWIND_INVALID, expectedDiagnostic); + } + @Test + void testRewindCounterInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error", + new Diagnostic( + new Range(), + "Excessive options provided for: COUNTER", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()) + ); + CICSTestUtils.errorTest(REWIND_COUNTER_INVALID, expectedDiagnostic); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java index 7c9e4bf0bd..a1d6cb3162 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsTest.java @@ -19,7 +19,6 @@ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -34,8 +33,8 @@ public class TestCicsTest { private static final String TEST_EVENT_VALID_ONE = "TEST EVENT({$varOne}) FIRESTATUS({$varTwo})"; private static final String TEST_EVENT_VALID_TWO = "TEST FIRESTATUS({$varTwo}) EVENT({$varOne})"; - private static final String TEST_EVENT_INVALID_ONE = "TEST {EVENT|error1}({$varOne})"; - private static final String TEST_EVENT_INVALID_TWO = "TEST {FIRESTATUS|error1}({$varTwo})"; + private static final String TEST_EVENT_INVALID_ONE = "TEST {_EVENT({$varOne})|error1_}"; + private static final String TEST_EVENT_INVALID_TWO = "TEST {_FIRESTATUS({$varTwo})|error1_}"; @Test @@ -54,7 +53,7 @@ void testCicsTestInvalidOne() { ImmutableMap.of( "error1", new Diagnostic( - new Range(new Position(12, 12), new Position(13, 25)), + new Range(), "Missing required option: FIRESTATUS", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); @@ -66,7 +65,7 @@ void testCicsTestInvalidTwo() { ImmutableMap.of( "error1", new Diagnostic( - new Range(new Position(12, 12), new Position(13, 30)), + new Range(), "Missing required option: EVENT", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java index 1f2f37e455..def1303b01 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsUnlock.java @@ -19,7 +19,6 @@ import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; @@ -70,7 +69,7 @@ void testInvalid() { CICSTestUtils.errorTest(INVALID, ImmutableMap.of( "error", new Diagnostic( - new Range(new Position(12, 12), new Position(13, 27)), + new Range(), "Missing required option: FILE", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java index db37ade89c..53341004d2 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsWSAEPR.java @@ -40,6 +40,7 @@ public class TestCicsWSAEPR { private static final String WSAEPR_CREATE_SOME_OPTIONS_VALID_THREE = "WSAEPR EPRINTO(1) EPRLENGTH(1) METADATA(2) CREATE METADATALEN(2)"; private static final String WSAEPR_CREATE_BARE_VALID = "WSAEPR CREATE EPRINTO(2) EPRLENGTH(1) METADATA(1)"; + private static final String WSAEPR_CREATE_BARE_INVALID = "WSAEPR {CREATE|error1|error2|error3}"; private static final String WSAEPR_CREATE_INVALID_ONE = "WSAEPR CREATE {EPRINTO|error1}(1) EPRLENGTH(1) {EPRSET|error1}(1) ADDRESS(2)"; private static final String WSAEPR_CREATE_INVALID_TWO = "WSAEPR {REFPARMSLEN|error1}(2) CREATE EPRLENGTH(1) EPRSET(1) ADDRESS(2)"; @@ -72,6 +73,34 @@ void testWSAEPRCreateBareValid() { CICSTestUtils.noErrorTest(WSAEPR_CREATE_BARE_VALID); } + @Test + void testWSAEPRCreateBareInvalid() { + Map expectedDiagnostic = + ImmutableMap.of( + "error1", + new Diagnostic( + new Range(), + "Exactly one option required, none provided: EPRINTO or EPRSET", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText() + ), + "error2", + new Diagnostic( + new Range(), + "Missing required option: ADDRESS or REFPARMS or METADATA", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText() + ), + "error3", + new Diagnostic( + new Range(), + "Missing required option: EPRLENGTH", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText() + )); + CICSTestUtils.errorTest(WSAEPR_CREATE_BARE_INVALID, expectedDiagnostic); + } + @Test void testWSAEPRCreateInvalidOne() { Map expectedDiagnostic = diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java index a7768fa289..0fd1edef76 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java @@ -35,7 +35,7 @@ class TestExecCicsHandleAidClear { + " {#*10-EXIT}.\n" + " EXIT.\n" + " {#*NACT}.\n" - + " EXEC CICS HANDLE AID CLEAR() END-EXEC.\n" + + " EXEC CICS HANDLE AID CLEAR END-EXEC.\n" + " EXEC CICS HANDLE AID CLEAR({#10-EXIT}) END-EXEC.\n"; @Test diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java index d2a44d63be..129b17ce96 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSetUpDownBy.java @@ -53,6 +53,8 @@ class TestSetUpDownBy { + " SET {$IND1} {$IND2} {$IND3} DOWN BY 1.\n" + " SET {$IND1} {$INTVAL|1} DOWN BY -1.\n" + " SET {$NOT-A-TABLE|1} UP BY 1.\n" + + " SET {$NOT-A-TABLE|1} TO 4.\n" + + " SET {$INTVAL} TO {$IND3}.\n" + " SET {$NOT-A-TABLE|1} DOWN BY 1.\n" + " SET {$NOT-A-TABLE|1} {$IND1} UP BY 1.\n" + " SET {$IND1} UP BY {$INTVAL}.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCallStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCallStatement.java deleted file mode 100644 index 6f611b330d..0000000000 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCallStatement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * - */ - -package org.eclipse.lsp.cobol.usecases; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; -import org.junit.jupiter.api.Test; - -/** This test checks if sql CALL statement works correctly. */ -class TestSqlCallStatement { - private static final String TEXT = - " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. HELLO-SQL.\n" - + " DATA DIVISION.\n" - + " WORKING-STORAGE SECTION.\n" - + " PROCEDURE DIVISION.\n" - + " EXEC SQL\n" - + " CALL myProc USING DESCRIPTOR SQLD;\n" - + " END-EXEC."; - - @Test - void test() { - UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); - } -} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteImmediateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteImmediateStatement.java deleted file mode 100644 index 07af446a8c..0000000000 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteImmediateStatement.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * - */ - -package org.eclipse.lsp.cobol.usecases; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; -import org.junit.jupiter.api.Test; - -/** This test checks if sql EXECUTE IMMEDIATE statement works correctly. */ -class TestSqlExecuteImmediateStatement { - - private static final String TEXT = - " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. HELLO-SQL.\n" - + " DATA DIVISION.\n" - + " WORKING-STORAGE SECTION.\n" - + " PROCEDURE DIVISION.\n" - + " EXEC SQL\n" - + " EXECUTE IMMEDIATE \"DELETE FROM DSN8C10.DEPT WHERE ABC = 1\" \n" - + " END-EXEC.\n"; - - @Test - void test() { - UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); - } -} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlPrepareStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlPrepareStatement.java deleted file mode 100644 index 7c750e1e2b..0000000000 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlPrepareStatement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * - */ - -package org.eclipse.lsp.cobol.usecases; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; -import org.junit.jupiter.api.Test; - -/** This test checks if sql PREPARE statement works correctly. */ -class TestSqlPrepareStatement { - private static final String TEXT = - " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. HELLO-SQL.\n" - + " DATA DIVISION.\n" - + " WORKING-STORAGE SECTION.\n" - + " PROCEDURE DIVISION.\n" - + " EXEC SQL PREPARE DEPT_INSERT FROM\n" - + " 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)';\n" - + " END-EXEC.\n"; - - @Test - void test() { - UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); - } -} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java index a420879a53..64d165e542 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/common/CICSTestUtils.java @@ -17,6 +17,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; + +import lombok.NonNull; + import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; @@ -41,17 +44,22 @@ public class CICSTestUtils { + " 01 {$*varFive} PIC X VALUE 'NAME_TWO'.\n" + " 01 {$*varSix} PIC X VALUE 'NAME_THREE'.\n" + " PROCEDURE DIVISION.\n" - + " EXEC CICS \n" - + " END-EXEC."; + + " {@*SEC1} SECTION.\n" + + " DISPLAY \"Text: \".\n" + + " EXEC CICS "; + + private static final String END_EXEC = " END-EXEC."; + private static final String END_EXEC_ERROR = " {END-EXEC|end-exec-error}."; /** * Retrieves a formatted test string for CICS command testing * * @param components Components to add to the EXEC CICS block of the test string + * @param errorTags Error tags to inject before END-EXEC or null * @param compilerOptions Compiler options fo translator specification * @return Formatted test string */ - public static String getTestString(String components, String... compilerOptions) { + public static String getTestString(String components, List errorTags, String... compilerOptions) { List instances = Arrays.asList(components.split("\\s")); instances.replaceAll(String.join("", Collections.nCopies(12, " "))::concat); List compilerOptionsList = @@ -61,7 +69,14 @@ public static String getTestString(String components, String... compilerOptions) ArrayList base = new ArrayList(Arrays.asList(BASE_TEXT.split("\n"))); base.addAll(0, compilerOptionsList); - base.addAll(base.size() - 1, instances); + base.addAll(instances); + if (errorTags == null) + base.add(END_EXEC); + else if (errorTags.isEmpty()) + base.add(END_EXEC_ERROR); + else { + base.add(END_EXEC_ERROR.replace("{", "{|" + String.join("|", errorTags) + "}{")); + } return String.join("\n", base); } @@ -73,7 +88,7 @@ public static String getTestString(String components, String... compilerOptions) */ public static void noErrorTest(String newCommand, String... options) { UseCaseEngine.runTest( - getTestString(newCommand, options), ImmutableList.of(), ImmutableMap.of()); + getTestString(newCommand, null, options), ImmutableList.of(), ImmutableMap.of()); } /** @@ -86,6 +101,20 @@ public static void noErrorTest(String newCommand, String... options) { public static void errorTest( String newCommand, Map expectedDiagnostic, String... options) { UseCaseEngine.runTest( - getTestString(newCommand, options), ImmutableList.of(), expectedDiagnostic); + getTestString(newCommand, null, options), ImmutableList.of(), expectedDiagnostic); + } + + /** + * Runs a test with asserting error conditions passed as argument + * + * @param newCommand Error command to execute + * @param errorTags Error tags to inject before END-EXEC + * @param expectedDiagnostic Errors to match + * @param options Compiler options fo translator specification + */ + public static void errorTestWithEndExecError( + String newCommand, @NonNull List errorTags, Map expectedDiagnostic, String... options) { + UseCaseEngine.runTest( + getTestString(newCommand, errorTags, options), ImmutableList.of(), expectedDiagnostic); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllAlterStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllAlterStatements.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllAlterStatements.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllAlterStatements.java index 167006fc5f..4388b17749 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllAlterStatements.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllAlterStatements.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllCreateStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllCreateStatements.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllCreateStatements.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllCreateStatements.java index 18e3067166..493800bc1f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllCreateStatements.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllCreateStatements.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllDescribeStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllDescribeStatements.java similarity index 80% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllDescribeStatements.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllDescribeStatements.java index 9a42bcbcd5..6e4eb76414 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllDescribeStatements.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllDescribeStatements.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -47,22 +47,22 @@ class TestSqlAllDescribeStatements { + " EXEC SQL\n"; private static final String DESCRIBE_CURSOR = - TEXT + " DESCRIBE CURSOR C1 INTO SQLDA\n" + " END-EXEC."; + TEXT + " DESCRIBE CURSOR C1 INTO :{$HOSTVAR}\n" + " END-EXEC."; private static final String DESCRIBE_INPUT = - TEXT + " DESCRIBE INPUT STMT1_NAME INTO SQLDA;\n" + " END-EXEC."; + TEXT + " DESCRIBE INPUT STMT1_NAME INTO :{$HOSTVAR};\n" + " END-EXEC."; private static final String DESCRIBE_OUTPUT = TEXT - + " DESCRIBE OUTPUT STMT1_NAME INTO SQLDA USING LABELS;\n" + + " DESCRIBE OUTPUT STMT1_NAME INTO :{$HOSTVAR} USING LABELS;\n" + " END-EXEC."; private static final String DESCRIBE_PROCEDURE = - TEXT + " DESCRIBE PROCEDURE MyProc INTO procDesc;\n" + " END-EXEC."; + TEXT + " DESCRIBE PROCEDURE MyProc INTO :{$HOSTVAR};\n" + " END-EXEC."; private static final String DESCRIBE_TABLE = TEXT - + " DESCRIBE TABLE {$HOSTVAR} INTO tabDesc USING BOTH;\n" + + " DESCRIBE TABLE :{$HOSTVAR} INTO :{$HOSTVAR} USING BOTH;\n" + " END-EXEC."; private static Stream textsToTest() { diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllGrantStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllGrantStatements.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllGrantStatements.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllGrantStatements.java index e1d1ac5571..09b09967f8 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllGrantStatements.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllGrantStatements.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllRevokeStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllRevokeStatements.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllRevokeStatements.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllRevokeStatements.java index ed8a319069..e83427fcc9 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllRevokeStatements.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllRevokeStatements.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllSetStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllSetStatements.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllSetStatements.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllSetStatements.java index e1d72ad162..d7bc67ce39 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllSetStatements.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllSetStatements.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -226,7 +226,7 @@ class TestSqlAllSetStatements { TEXT + " SET CURRENT TEMPORAL BUSINESS_TIME = NULL\n" + " END-EXEC."; private static final String SET_ENCRYPTION_PASSWORD = - TEXT + " SET ENCRYPTION PASSWORD = :hv1\n" + " END-EXEC."; + TEXT + " SET ENCRYPTION PASSWORD = :{$hv1}\n" + " END-EXEC."; private static final String SET_ENCRYPTION_PASSWORD2 = TEXT diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllocateCursorStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllocateCursorStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllocateCursorStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllocateCursorStatement.java index d248439434..073b15fcd4 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAllocateCursorStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAllocateCursorStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAnalysisDisabled.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAnalysisDisabled.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAnalysisDisabled.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAnalysisDisabled.java index e16ca13f35..28d012fb1d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAnalysisDisabled.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAnalysisDisabled.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import static org.eclipse.lsp.cobol.implicitDialects.sql.Db2SqlDialect.SQL_BACKEND_SETTING; import static org.eclipse.lsp.cobol.test.engine.UseCaseUtils.DOCUMENT_URI; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAssociateLocatorsStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAssociateLocatorsStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAssociateLocatorsStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAssociateLocatorsStatement.java index 498702e471..8b95a0413b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlAssociateLocatorsStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlAssociateLocatorsStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlBeginDeclareSectionStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlBeginDeclareSectionStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlBeginDeclareSectionStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlBeginDeclareSectionStatement.java index 595c48ed50..16a371571e 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlBeginDeclareSectionStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlBeginDeclareSectionStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCallStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCallStatement.java new file mode 100644 index 0000000000..199f2a27a1 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCallStatement.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.usecases.sql; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** This test checks if sql CALL statement works correctly. */ +class TestSqlCallStatement { + private static final String TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. HELLO-SQL.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " PROCEDURE DIVISION.\n" + + " EXEC SQL\n" + + " CALL myProc USING DESCRIPTOR SQLD;\n" + + " END-EXEC."; + + /** + * compile output + * 000035 EXEC SQL + * + * ==000035==> IGYPS0226-E DSNH104I DSNHSM2V LINE 35 COL 38 ILLEGAL SYMBOL "SQLD". SOME SYMBOLS + * THAT MIGHT BE LEGAL ARE: : + * + * 000036 CALL myProc USING DESCRIPTOR SQLD + * 000037 END-EXEC. + */ + @Disabled("Compilation error") + @Test + void test() { + UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); + } + + public static final String VALID_TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. HELLO-SQL.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " EXEC SQL INCLUDE {~SQLCA} END-EXEC.\n" + + " 01 {$*SQLD}.\n" + + " 49 {$*SQL-STMT-LEN} PIC S9(4) COMP.\n" + + " 49 {$*SQL-STMT-TEXT} PIC X(100).\n" + + " PROCEDURE DIVISION.\n" + + " EXEC SQL\n" + + " CALL myProc USING DESCRIPTOR :{$SQLD}\n" + + " END-EXEC."; + + @Test + void validTest() { + UseCaseEngine.runTest(VALID_TEXT, ImmutableList.of(), ImmutableMap.of()); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCaseStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCaseStatement.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCaseStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCaseStatement.java index 03c84f6635..faf3edb804 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCaseStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCaseStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCloseStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCloseStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCloseStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCloseStatement.java index 799ad7733e..f1babe18e5 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCloseStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCloseStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommentStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommentStatement.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommentStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommentStatement.java index 1fa229ae8c..a8f379eb7b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommentStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommentStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommitStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommitStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommitStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommitStatement.java index 0622ccd573..6188d3e544 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlCommitStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlCommitStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlConnectStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlConnectStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlConnectStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlConnectStatement.java index e556051744..cbe0a0ef31 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlConnectStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlConnectStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDeleteStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDeleteStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDeleteStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDeleteStatement.java index 0b3506e40c..0a4a8d161b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDeleteStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDeleteStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDropStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDropStatement.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDropStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDropStatement.java index 0f99610ca1..cc486bed76 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlDropStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlDropStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlEndDeclareSectionStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlEndDeclareSectionStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlEndDeclareSectionStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlEndDeclareSectionStatement.java index c926a1b0c1..4d41954ee3 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlEndDeclareSectionStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlEndDeclareSectionStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExchangeStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExchangeStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExchangeStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExchangeStatement.java index f5998652a8..d21dc35898 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExchangeStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExchangeStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteImmediateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteImmediateStatement.java new file mode 100644 index 0000000000..7f6d45f52c --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteImmediateStatement.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.usecases.sql; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** This test checks if sql EXECUTE IMMEDIATE statement works correctly. */ +class TestSqlExecuteImmediateStatement { + + private static final String TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. HELLO-SQL.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " PROCEDURE DIVISION.\n" + + " EXEC SQL\n" + + " EXECUTE IMMEDIATE \"DELETE FROM DSN8C10.DEPT WHERE ABC = 1\" \n" + + " END-EXEC.\n"; + + /* + COMPILATION FAILS + ----------------------- + 000035 EXEC SQL + + ==000035==> IGYPS0226-E DSNH104I DSNHSMS1 LINE 35 COL 75 ILLEGAL SYMBOL "'DELETE FROM + DSN8C10.DEPT WHERE ABC = 1'". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: : + + 000036 EXECUTE IMMEDIATE + 000037 'DELETE FROM DSN8C10.DEPT WHERE ABC = 1' + 000038 END-EXEC. + 000039 + */ + @Disabled("Compilation Fails") + @Test + void test() { + UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); + } + + public static final String VALID_TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. HELLO-SQL.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " EXEC SQL INCLUDE {~SQLCA} END-EXEC.\n" + + " 01 {$*SQL-STMT}.\n" + + " 49 {$*SQL-STMT-LEN} PIC S9(4) COMP.\n" + + " 49 {$*SQL-STMT-TEXT} PIC X(100).\n" + + " PROCEDURE DIVISION.\n" + + " MOVE 'DELETE FROM DSN8C10.DEPT WHERE ABC = 1' \n" + + " TO {$SQL-STMT-TEXT}.\n" + + "\n" + + " EXEC SQL\n" + + " EXECUTE IMMEDIATE :{$SQL-STMT}\n" + + " END-EXEC."; + + @Test + void validTest() { + UseCaseEngine.runTest(VALID_TEXT, ImmutableList.of(), ImmutableMap.of()); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteStatement.java index 238f862f03..73d583c950 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExecuteStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExecuteStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExplainStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExplainStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExplainStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExplainStatement.java index 8a5c32137e..6910bfff9a 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlExplainStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlExplainStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlFreeLocatorStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlFreeLocatorStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlFreeLocatorStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlFreeLocatorStatement.java index a8144df55a..9c7513f24d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlFreeLocatorStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlFreeLocatorStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGetDiagnosticsStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGetDiagnosticsStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGetDiagnosticsStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGetDiagnosticsStatement.java index b71577d1c4..e67f20d278 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGetDiagnosticsStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGetDiagnosticsStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGroupVariableUsage.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGroupVariableUsage.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGroupVariableUsage.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGroupVariableUsage.java index a807beb953..082cf4707c 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlGroupVariableUsage.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlGroupVariableUsage.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHoldLocatorStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHoldLocatorStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHoldLocatorStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHoldLocatorStatement.java index c28fc5476a..55714a5b5d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHoldLocatorStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHoldLocatorStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHostedVariableInNestedProgram.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHostedVariableInNestedProgram.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHostedVariableInNestedProgram.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHostedVariableInNestedProgram.java index dc2d93c2c4..565126bf17 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlHostedVariableInNestedProgram.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlHostedVariableInNestedProgram.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatement.java index 284b26f3ce..ee0c998ab1 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForDefinedFields.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForDefinedFields.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForDefinedFields.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForDefinedFields.java index a80d65c631..48a9f83294 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForDefinedFields.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForDefinedFields.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForImplicitlyDefinedCpy.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForImplicitlyDefinedCpy.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForImplicitlyDefinedCpy.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForImplicitlyDefinedCpy.java index 0b990a742b..e6cef93b84 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementForImplicitlyDefinedCpy.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementForImplicitlyDefinedCpy.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import static org.eclipse.lsp4j.DiagnosticSeverity.Error; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotDefinedCorrectly.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotDefinedCorrectly.java index 30df37b934..deb44a4ab0 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotDefinedCorrectly.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import static org.eclipse.lsp4j.DiagnosticSeverity.Error; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotFoundCopybook.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotFoundCopybook.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotFoundCopybook.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotFoundCopybook.java index bf9583a790..09e4b2c858 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotFoundCopybook.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementNotFoundCopybook.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import static org.eclipse.lsp4j.DiagnosticSeverity.Error; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementUsingRepeatedly.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementUsingRepeatedly.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementUsingRepeatedly.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementUsingRepeatedly.java index 6792eb7802..6efe7dbbcb 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementUsingRepeatedly.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlIncludeStatementUsingRepeatedly.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlInsertStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlInsertStatement.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlInsertStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlInsertStatement.java index 1302287b55..89af7b4ac9 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlInsertStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlInsertStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlKeywordAllowedAsCobolVarIdentifier.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlKeywordAllowedAsCobolVarIdentifier.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlKeywordAllowedAsCobolVarIdentifier.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlKeywordAllowedAsCobolVarIdentifier.java index f9729b638c..0f72f9d6a6 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlKeywordAllowedAsCobolVarIdentifier.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlKeywordAllowedAsCobolVarIdentifier.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLabelStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLabelStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLabelStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLabelStatement.java index f1ddfe06e3..d5c8a73325 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLabelStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLabelStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLockTableStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLockTableStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLockTableStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLockTableStatement.java index 6f4517de30..c4974ad887 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlLockTableStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlLockTableStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlMergeStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlMergeStatement.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlMergeStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlMergeStatement.java index 289c8b48bc..577b59032f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlMergeStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlMergeStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlOpenStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlOpenStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlOpenStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlOpenStatement.java index 14a5ce70dd..c028c7641b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlOpenStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlOpenStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlPrepareStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlPrepareStatement.java new file mode 100644 index 0000000000..e6954db740 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlPrepareStatement.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.usecases.sql; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** This test checks if sql PREPARE statement works correctly. */ +class TestSqlPrepareStatement { + + /** + * ----------------- + * COMPILE OUTPUT + * ------------------ + * 000035 EXEC SQL + * + * ==000035==> IGYPS0226-E DSNH104I DSNHSMS1 LINE 35 COL 72 ILLEGAL SYMBOL "'INSERT INTO + * DSN8C10.DEPT VALUES(?,?,?,?,?)'". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: : + * + * 000036 PREPARE DEPT_INSERT FROM + * 000037 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)' + * 000038 END-EXEC. + * 000039 + */ + private static final String TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. HELLO-SQL.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " PROCEDURE DIVISION.\n" + + " EXEC SQL PREPARE DEPT_INSERT FROM\n" + + " 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)';\n" + + " END-EXEC.\n"; + + public static final String VALID_TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. HELLO-SQL.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " EXEC SQL INCLUDE {~SQLCA} END-EXEC.\n" + + " 01 {$*SQL-STMT}.\n" + + " 49 {$*SQL-STMT-LEN} PIC S9(4) COMP.\n" + + " 49 {$*SQL-STMT-TEXT} PIC X(100).\n" + + " PROCEDURE DIVISION.\n" + + " MOVE 'INSERT INTO DSN8C10.DEPT VALUES(?,?,?,?,?)' \n" + + " TO {$SQL-STMT-TEXT}.\n" + + " EXEC SQL\n" + + " PREPARE sample FROM :{$SQL-STMT}\n" + + " END-EXEC."; + + @Disabled("Compilation error") + @Test + void test() { + UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); + } + + @Test + void validTest() { + UseCaseEngine.runTest(VALID_TEXT, ImmutableList.of(), ImmutableMap.of()); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRefreshTableStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRefreshTableStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRefreshTableStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRefreshTableStatement.java index 32479a524f..1ccf3f345b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRefreshTableStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRefreshTableStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseConnectionStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseConnectionStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseConnectionStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseConnectionStatement.java index eeb9ee5eaf..24a5ba88fb 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseConnectionStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseConnectionStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseSavepointStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseSavepointStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseSavepointStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseSavepointStatement.java index fee9b25370..1aa0e2aadb 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlReleaseSavepointStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlReleaseSavepointStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRenameStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRenameStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRenameStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRenameStatement.java index 6792017f7d..131a0bdd94 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRenameStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRenameStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRollbackStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRollbackStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRollbackStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRollbackStatement.java index 842ba6b51e..e9b7cc2e62 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlRollbackStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlRollbackStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSavepointStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSavepointStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSavepointStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSavepointStatement.java index c4ab61df68..2e3020573f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSavepointStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSavepointStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectIntoStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectIntoStatement.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectIntoStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectIntoStatement.java index b194f11a1c..efed2b6c72 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectIntoStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectIntoStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectStatement.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectStatement.java index eab6b00830..d3dd87092f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSelectStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSelectStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSignalStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSignalStatement.java similarity index 96% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSignalStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSignalStatement.java index f162bf9fef..31098be48b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSignalStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSignalStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSpecialNames.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSpecialNames.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSpecialNames.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSpecialNames.java index bc3231b7c8..95e0e5a0d5 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlSpecialNames.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlSpecialNames.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTransferOwnershipStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTransferOwnershipStatement.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTransferOwnershipStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTransferOwnershipStatement.java index 1a9dc30f92..9db784e151 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTransferOwnershipStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTransferOwnershipStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTruncateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTruncateStatement.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTruncateStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTruncateStatement.java index d9236286a0..2d738167c3 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlTruncateStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlTruncateStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlUpdateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlUpdateStatement.java similarity index 99% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlUpdateStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlUpdateStatement.java index 1567012038..fb4888cb85 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlUpdateStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlUpdateStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesIntoStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesIntoStatement.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesIntoStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesIntoStatement.java index 4984bb04d4..428dda35e7 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesIntoStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesIntoStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesStatement.java index b5f8009c1c..898933f615 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlValuesStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlValuesStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlVariableReferenceInCopybook.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlVariableReferenceInCopybook.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlVariableReferenceInCopybook.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlVariableReferenceInCopybook.java index 96562442e2..405fbe7088 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlVariableReferenceInCopybook.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlVariableReferenceInCopybook.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlWheneverStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlWheneverStatement.java similarity index 97% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlWheneverStatement.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlWheneverStatement.java index 11d999c897..27b7213c8d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlWheneverStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlWheneverStatement.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.usecases; +package org.eclipse.lsp.cobol.usecases.sql; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; diff --git a/server/engine/src/test/resources/cfast/case_conditional_perform.result.json b/server/engine/src/test/resources/cfast/case_conditional_perform.result.json index 7edf37900e..1760cd8a65 100644 --- a/server/engine/src/test/resources/cfast/case_conditional_perform.result.json +++ b/server/engine/src/test/resources/cfast/case_conditional_perform.result.json @@ -15,6 +15,7 @@ }, "children": [ { + "untilExit": false, "type": "inlineperform", "location": { "uri": "fake/path", diff --git a/server/engine/src/test/resources/cfast/case_exit_perform.result.json b/server/engine/src/test/resources/cfast/case_exit_perform.result.json index 0bbceefeed..3adefc8ced 100644 --- a/server/engine/src/test/resources/cfast/case_exit_perform.result.json +++ b/server/engine/src/test/resources/cfast/case_exit_perform.result.json @@ -15,6 +15,7 @@ }, "children": [ { + "untilExit": false, "type": "inlineperform", "location": { "uri": "fake/path", diff --git a/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.cbl b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.cbl new file mode 100644 index 0000000000..d064e9cedd --- /dev/null +++ b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.cbl @@ -0,0 +1,23 @@ + * Copyright (c) 2025 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + IDENTIFICATION DIVISION. + PROGRAM-ID. EVAL. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 WS-NUM1 PIC 9(9). + PROCEDURE DIVISION. + PERFORM UNTIL EXIT + GO TO PAR1 + END-PERFORM. + PAR1. + STOP RUN. \ No newline at end of file diff --git a/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.result.json b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.result.json new file mode 100644 index 0000000000..3a8991a250 --- /dev/null +++ b/server/engine/src/test/resources/cfast/case_inline-perform-until-exit.result.json @@ -0,0 +1,97 @@ +[ + { + "name": "EVAL", + "type": "program", + "location": { + "uri": "fake/path", + "start": { + "line": 18, + "character": 8 + }, + "end": { + "line": 23, + "character": 21 + } + }, + "children": [ + { + "untilExit": true, + "type": "inlineperform", + "location": { + "uri": "fake/path", + "start": { + "line": 19, + "character": 20 + }, + "end": { + "line": 21, + "character": 23 + } + } + }, + { + "targetName": [ + "PAR1" + ], + "type": "goto", + "location": { + "uri": "fake/path", + "start": { + "line": 20, + "character": 16 + }, + "end": { + "line": 20, + "character": 26 + } + } + }, + { + "type": "endinlineperform", + "location": { + "uri": "fake/path", + "start": { + "line": 19, + "character": 20 + }, + "end": { + "line": 21, + "character": 23 + } + } + }, + { + "snippet": " PAR1.\r\n STOP RUN.", + "name": "PAR1", + "type": "paragraph", + "location": { + "uri": "fake/path", + "start": { + "line": 22, + "character": 8 + }, + "end": { + "line": 23, + "character": 21 + } + }, + "children": [ + { + "type": "stop", + "location": { + "uri": "fake/path", + "start": { + "line": 23, + "character": 12 + }, + "end": { + "line": 23, + "character": 20 + } + } + } + ] + } + ] + } +] \ No newline at end of file diff --git a/server/engine/src/test/resources/cfast/case_perform-until-exit.cbl b/server/engine/src/test/resources/cfast/case_perform-until-exit.cbl new file mode 100644 index 0000000000..6806812b5b --- /dev/null +++ b/server/engine/src/test/resources/cfast/case_perform-until-exit.cbl @@ -0,0 +1,21 @@ + * Copyright (c) 2025 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + IDENTIFICATION DIVISION. + PROGRAM-ID. EVAL. + DATA DIVISION. + WORKING-STORAGE SECTION. + 01 WS-NUM1 PIC 9(9). + PROCEDURE DIVISION. + PERFORM PAR1 UNTIL EXIT. + PAR1. + STOP RUN. \ No newline at end of file diff --git a/server/engine/src/test/resources/cfast/case_perform-until-exit.result.json b/server/engine/src/test/resources/cfast/case_perform-until-exit.result.json new file mode 100644 index 0000000000..752b7ad079 --- /dev/null +++ b/server/engine/src/test/resources/cfast/case_perform-until-exit.result.json @@ -0,0 +1,67 @@ +[ + { + "name": "EVAL", + "type": "program", + "location": { + "uri": "fake/path", + "start": { + "line": 18, + "character": 8 + }, + "end": { + "line": 21, + "character": 21 + } + }, + "children": [ + { + "targetName": "PAR1", + "performUntilType": "UNTIL_EXIT", + "type": "perform", + "location": { + "uri": "fake/path", + "start": { + "line": 19, + "character": 12 + }, + "end": { + "line": 19, + "character": 35 + } + } + }, + { + "snippet": " PAR1.\r\n STOP RUN.", + "name": "PAR1", + "type": "paragraph", + "location": { + "uri": "fake/path", + "start": { + "line": 20, + "character": 8 + }, + "end": { + "line": 21, + "character": 21 + } + }, + "children": [ + { + "type": "stop", + "location": { + "uri": "fake/path", + "start": { + "line": 21, + "character": 12 + }, + "end": { + "line": 21, + "character": 20 + } + } + } + ] + } + ] + } +] \ No newline at end of file diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4 index c5b97676a2..35746aeb00 100644 --- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4 +++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4 @@ -1590,9 +1590,13 @@ performTimes ; performUntil - : performTestClause? UNTIL condition + : performTestClause? performUntilCondition ; +performUntilCondition + : UNTIL (EXIT | condition) + ; + performVarying : performTestClause performVaryingClause | performVaryingClause performTestClause? ; diff --git a/server/pom.xml b/server/pom.xml index 14c71c3fc8..d03e438998 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -19,7 +19,7 @@ - 1.0.11 + 1.0.12 8 8 1.10.0 diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java index 18576c3b77..38f8b79c25 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java +++ b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCasePreprocessorListener.java @@ -373,7 +373,7 @@ public void exitMultiTokenError(MultiTokenErrorContext ctx) { stop = closingOfMultiToken.getCharPositionInLine() + stopMarkLen - lineShifts[startLine]; start = stop - affectedTokens.length(); } else { - stop = closingOfMultiToken.getCharPositionInLine() + stopMarkLen; + stop = closingOfMultiToken.getCharPositionInLine() + stopMarkLen - lineShifts[stopLine]; start = ctx.getStart().getCharPositionInLine(); } lineShifts[startLine] += ctx.getStop().getText().length(); diff --git a/tests/test_files/project/settings/default.json b/tests/test_files/project/settings/default.json new file mode 100644 index 0000000000..9e26dfeeb6 --- /dev/null +++ b/tests/test_files/project/settings/default.json @@ -0,0 +1 @@ +{} \ No newline at end of file