Closed mingodad closed 1 month ago
Using the tools at https://github.com/GuntherRademacher/ebnf-convert and https://github.com/GuntherRademacher/rr it's possible to generate an EBNF understood by https://github.com/GuntherRademacher/rr to generate a nice navigable railroad diagram (see bellow) from https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/blob/development/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4 .
// // EBNF to be viewd at // (IPV6) https://www.bottlecaps.de/rr/ui // (IPV4) https://rr.red-dove.com/ui // // Copy and paste this at one of the urls shown above in the 'Edit Grammar' tab // then click the 'View Diagram' tab. // /* converted on Thu Aug 15, 2024, 19:04 (UTC+02) by antlr_4-to-w3c v0.68-SNAPSHOT which is Copyright (c) 2011-2024 by Gunther Rademacher <grd@gmx.net> */ startRule ::= compilationUnit EOF compilationUnit ::= programUnit+ programUnit ::= identificationDivision environmentDivision? dataDivision? procedureDivision? programUnit* endProgramStatement? endProgramStatement ::= END PROGRAM programName DOT_FS commaSeparator ::= COMMACHAR | COMMASEPARATOR identificationDivision ::= ( IDENTIFICATION | ID ) DIVISION dot_fs programIdParagraph identificationDivisionBody* identificationDivisionBody ::= authorParagraph | installationParagraph | dateWrittenParagraph | dateCompiledParagraph | securityParagraph | remarksParagraph programIdParagraph ::= PROGRAM_ID DOT_FS? programName ( IS? ( COMMON | INITIAL | LIBRARY | DEFINITION | RECURSIVE ) PROGRAM? )? DOT_FS? authorParagraph ::= AUTHOR DOT_FS? optionalParagraphTermination installationParagraph ::= INSTALLATION DOT_FS? optionalParagraphTermination dateWrittenParagraph ::= DATE_WRITTEN DOT_FS? optionalParagraphTermination dateCompiledParagraph ::= DATE_COMPILED DOT_FS? optionalParagraphTermination securityParagraph ::= SECURITY DOT_FS? optionalParagraphTermination remarksParagraph ::= REMARKS DOT_FS? optionalParagraphTermination optionalParagraphTermination ::= ( ABORT | ACCEPT | ACCESS | ADD | ADDRESS | ADVANCING | AFTER | ALL | ALLOCATE | ALPHABET | ALPHABETIC | ALPHABETIC_LOWER | ALPHABETIC_UPPER | ALPHANUMERIC | ALPHANUMERIC_EDITED | ALSO | ALTER | ALTERNATE | AND | ANY | APPLY | ARE | AREA | AREAS | ASCENDING | ASCII | ASSIGN | ASSOCIATED_DATA | ASSOCIATED_DATA_LENGTH | ASTERISKCHAR | AT | ATTRIBUTE | ATTRIBUTES | BEFORE | BINARY | BLANK | BLOCK | BOOL | BOOLEAN | BOTTOM | BY | BYFUNCTION | BYTITLE | CALL | CANCEL | CAPABLE | CCSVERSION | CHAINING | CHANGED | CHANNEL | CHARACTER | CHARACTERS | CLASS | CLOCK_UNITS | CLOSE | CLOSE_DISPOSITION | CODE_SET | COLLATING | COLONCHAR | COMMA | COMMACHAR | COMMASEPARATOR | COMMITMENT | COMMON | COMP | COMPUTATIONAL | COMPUTATIONAL_1 | COMPUTATIONAL_2 | COMPUTATIONAL_3 | COMPUTATIONAL_4 | COMPUTATIONAL_5 | COMPUTE | COMP_1 | COMP_2 | COMP_3 | COMP_4 | COMP_5 | CONFIGURATION | CONTAINS | CONTENT | CONTINUE | CONTROL | CONVERTING | CORR | CORRESPONDING | COUNT | CR | CRUNCH | CURRENCY | CYCLE | DATA | DATE | DAY | DAY_OF_WEEK | DBCS | DEBUGGING | DECIMAL_POINT | DECLARATIVES | DEFAULT | DEFAULT_DISPLAY | DEFINITION | DELETE | DELIMITED | DELIMITER | DEPENDING | DESCENDING | DETAIL | DIALECT_IF | DISABLE | DISK | DISPLAY | DISPLAY_1 | DIVIDE | DIVISION | DOT_FS | DOUBLEASTERISKCHAR | DOWN | DUPLICATES | DYNAMIC | EBCDIC | EGCS | EGI | ELEMENT | ELSE | EMI | ENABLE | ENCODING | END_ACCEPT | END_ADD | END_CALL | END_COMPUTE | END_DELETE | END_DIVIDE | END_EVALUATE | END_IF | END_JSON | END_MULTIPLY | END_OF_PAGE | END_PERFORM | END_READ | END_RECEIVE | END_RETURN | END_REWRITE | END_SEARCH | END_START | END_STRING | END_SUBTRACT | END_UNSTRING | END_WRITE | END_XML | ENTRY | EOP | EQUAL | EQUALCHAR | ERROR | ESCAPE | ESI | EVALUATE | EVERY | EXCEPTION | EXCLUSIVE | EXHIBIT | EXIT | EXTEND | EXTERNAL | FALSE | FD | FIELD | FILE | FILE_CONTROL | FILLER | FINALCHARSTRING | FIRST | FOOTING | FOR | FREE | FROM | FUNCTION | FUNCTION_POINTER | GENERATE | GIVING | GLOBAL | GO | GOBACK | GREATER | GROUP_USAGE | HEX_NUMBERS | HIGH_VALUE | HIGH_VALUES | IDENTIFIER | IF | IMPLICIT | IN | INDEX | INDEXED | INITIAL | INITIALIZE | INITIALIZED | INITIATE | INPUT | INPUT_OUTPUT | INSPECT | INTEGER | INTEGERLITERAL | INTO | INTRINSIC | INVALID | IS | I_O | I_O_CONTROL | JSON | JUST | JUSTIFIED | KANJI | KEPT | KEY | KEYBOARD | LABEL | LAST | LEADING | LEFT | LENGTH | LESS | LESSTHANCHAR | LESSTHANOREQUAL | LEVEL_NUMBER | LEVEL_NUMBER_66 | LEVEL_NUMBER_77 | LEVEL_NUMBER_88 | LIBRARY | LIMIT | LINAGE | LINAGE_COUNTER | LINE | LINES | LINKAGE | LIST | LOC | LOCAL | LOCAL_STORAGE | LOCK | LOW_VALUE | LOW_VALUES | LPARENCHAR | MAX | MEMORY | MERGE | MESSAGE | METHOD | MINUSCHAR | MMDDYYYY | MODE | MODULES | MORETHANCHAR | MORETHANOREQUAL | MOVE | MULTIPLE | MULTIPLY | NAME | NAMED | NAMESPACE | NAMESPACE_PREFIX | NATIONAL | NATIONAL_EDITED | NATIVE | NEGATIVE | NETWORK | NEXT | NO | NONNUMERIC | NONNUMERICLITERAL | NOT | NOTEQUALCHAR | NULL | NULLS | NUMERIC | NUMERICLITERAL | NUMERIC_EDITED | OBJECT | OBJECT_COMPUTER | OCCURS | ODT | OF | OFF | OMITTED | ON | OPEN | OPTIONAL | OR | ORDER | ORDERLY | ORGANIZATION | OTHER | OUTPUT | OVERFLOW | PACKED_DECIMAL | PADDING | PAGE | PARAGRAPH | PARSE | PASSWORD | PERFORM | PIC | PICTURE | PICTUREIS | PLUSCHAR | POINTER | POINTER_32 | PORT | POSITION | POSITIVE | PRINTER | PROCEDURES | PROCEDURE_POINTER | PROCEED | PROCESSING | PROGRAM | PURGE | QUOTE | QUOTES | RANDOM | READ | READER | READY | RECEIVE | RECORD | RECORDING | RECORDS | RECURSIVE | REDEFINES | REEL | REFERENCE | REFERENCES | RELATIVE | RELEASE | RELOAD | REMAINDER | REMOTE | REMOVAL | REMOVE | RENAMES | REPLACING | REPORT | REPORTS | REPOSITORY | RERUN | RESERVE | RESET | RESUME | RETURN | RETURNING | REVERSED | REWIND | REWRITE | RIGHT | ROUNDED | RPARENCHAR | RUN | SAME | SAVE | SD | SEARCH | SECTION | SEGMENT | SEGMENT_LIMIT | SELECT | SEND | SENTENCE | SEPARATE | SEQUENCE | SEQUENTIAL | SERVICE | SET | SIGN | SIZE | SLASHCHAR | SORT | SORT_MERGE | SOURCE_COMPUTER | SPACE | SPACES | SPECIAL_NAMES | STANDARD | STANDARD_1 | STANDARD_2 | START | STATUS | STOP | STRING | SUBTRACT | SUM | SUPPRESS | SYMBOL | SYMBOLIC | SYNC | SYNCHRONIZED | TALLYING | TAPE | TERMINAL | TERMINATE | TEST | THAN | THEN | THREAD | THROUGH | THRU | TIME | TIMER | TIMES | TO | TODAYS_DATE | TODAYS_NAME | TOP | TRACE | TRAILING | TRUE | TYPE | UNBOUNDED | UNIT | UNSTRING | UNTIL | UP | UPON | USAGE | USE | USING | UTF_8 | U_CHAR | VALIDATING | VALUE | VALUES | VARYING | VIRTUAL | VOLATILE | WAIT | WHEN | WHEN_COMPILED | WITH | WORDS | WORKING_STORAGE | WRITE | WRITE_ONLY | XML | XML_DECLARATION | YEAR | YYYYDDD | YYYYMMDD | ZERO | ZEROES | ZEROS | ZERO_WIDTH_SPACE )* environmentDivision ::= ENVIRONMENT DIVISION dot_fs environmentDivisionBody* environmentDivisionBody ::= configurationSection | inputOutputSection | dialectSection configurationSection ::= CONFIGURATION SECTION dot_fs configurationSectionParagraph* configurationSectionParagraph ::= sourceComputerParagraph | objectComputerParagraph | specialNamesParagraph | repositoryParagraph repositoryParagraph ::= REPOSITORY DOT_FS ( classRepositoryClause | functionRepositoryClause )* DOT_FS? classRepositoryClause ::= CLASS className IS? literal functionRepositoryClause ::= FUNCTION functionName | intrinsicClause intrinsicClause ::= ( functionName* | ALL ) INTRINSIC sourceComputerParagraph ::= SOURCE_COMPUTER dot_fs ( computerName ( WITH? DEBUGGING MODE )? dot_fs )? objectComputerParagraph ::= OBJECT_COMPUTER dot_fs ( computerName objectComputerClause* dot_fs )? objectComputerClause ::= memorySizeClause | diskSizeClause | collatingSequenceClause | segmentLimitClause | characterSetClause memorySizeClause ::= MEMORY SIZE? ( integerLiteral | cobolWord ) ( WORDS | CHARACTERS | MODULES )? diskSizeClause ::= DISK SIZE? IS? ( integerLiteral | cobolWord ) ( WORDS | MODULES )? collatingSequenceClause ::= PROGRAM? COLLATING? SEQUENCE IS? alphabetName+ collatingSequenceClauseAlphanumeric? collatingSequenceClauseNational? collatingSequenceClauseAlphanumeric ::= FOR? ALPHANUMERIC IS? alphabetName collatingSequenceClauseNational ::= FOR? NATIONAL IS? alphabetName segmentLimitClause ::= SEGMENT_LIMIT IS? integerLiteral characterSetClause ::= CHARACTER SET dot_fs specialNamesParagraph ::= SPECIAL_NAMES dot_fs ( specialNameClause+ dot_fs )? specialNameClause ::= channelClause | odtClause | alphabetClause | classClause | currencySignClause | decimalPointClause | symbolicCharactersClause | environmentSwitchNameClause | environmentSwitchNameSpecialNamesStatusPhrase | defaultDisplaySignClause | defaultComputationalSignClause | reserveNetworkClause alphabetClause ::= ALPHABET ( alphabetClauseFormat1 | alphabetClauseFormat2 ) alphabetClauseFormat1 ::= alphabetName ( FOR ALPHANUMERIC )? IS? ( EBCDIC | ASCII | STANDARD_1 | STANDARD_2 | NATIVE | cobolWord | alphabetLiterals+ ) alphabetLiterals ::= literal ( alphabetThrough | ( ALSO? literal )* ) alphabetThrough ::= ( THROUGH | THRU ) literal alphabetClauseFormat2 ::= alphabetName FOR? NATIONAL IS? ( NATIVE | CCSVERSION literal ) channelClause ::= CHANNEL integerLiteral IS? mnemonicName classClause ::= CLASS className ( FOR? ( ALPHANUMERIC | NATIONAL ) )? IS? classClauseThrough+ classClauseThrough ::= classClauseFrom ( ( THROUGH | THRU ) classClauseTo )? classClauseFrom ::= literal | generalIdentifier classClauseTo ::= literal | generalIdentifier currencySignClause ::= CURRENCY SIGN? IS? literal ( WITH? PICTURE SYMBOL literal )? decimalPointClause ::= DECIMAL_POINT IS? COMMA defaultComputationalSignClause ::= DEFAULT ( COMPUTATIONAL | COMP )? ( SIGN IS? )? ( LEADING | TRAILING )? SEPARATE CHARACTER? defaultDisplaySignClause ::= DEFAULT_DISPLAY ( SIGN IS? )? ( LEADING | TRAILING ) ( SEPARATE CHARACTER? )? environmentSwitchNameClause ::= environmentName IS? mnemonicName environmentSwitchNameSpecialNamesStatusPhrase ::= ( ON | OFF ) STATUS? IS? condition odtClause ::= ODT IS? mnemonicName reserveNetworkClause ::= RESERVE WORDS? LIST? IS? NETWORK CAPABLE? symbolicCharactersClause ::= SYMBOLIC CHARACTERS? ( FOR? ( ALPHANUMERIC | NATIONAL ) )? symbolicCharacters+ ( IN alphabetName )? symbolicCharacters ::= symbolicCharacter+ ( IS | ARE )? integerLiteral+ inputOutputSection ::= INPUT_OUTPUT SECTION dot_fs inputOutputSectionParagraph* inputOutputSectionParagraph ::= fileControlParagraph | ioControlParagraph fileControlParagraph ::= FILE_CONTROL dot_fs fileControlEntry* fileControlEntry ::= selectClause fileControlClauses dot_fs fileControlClauses ::= fileControlClause* selectClause ::= SELECT OPTIONAL? fileName fileControlClause ::= assignClause | reserveClause | organizationClause | paddingCharacterClause | accessModeClause | recordClause | alternateRecordKeyClause | fileStatusClause | passwordClause | relativeKeyClause assignClause ::= ASSIGN TO? ( DISK | DISPLAY | KEYBOARD | PORT | PRINTER | READER | REMOTE | TAPE | VIRTUAL | ( DYNAMIC | EXTERNAL | VARYING )? assignmentName | literal )+ reserveClause ::= RESERVE ( NO | integerLiteral ) ALTERNATE? ( AREA | AREAS )? organizationClause ::= ( ORGANIZATION IS? )? ( RECORD? BINARY? | LINE ) ( SEQUENTIAL | RELATIVE | INDEXED ) paddingCharacterClause ::= PADDING CHARACTER? IS? ( qualifiedDataName | literal ) recordClause ::= RECORD ( recordDelimiterClause | recordKeyClause ) recordDelimiterClause ::= DELIMITER IS? ( STANDARD_1 | IMPLICIT | assignmentName ) accessModeClause ::= ACCESS MODE? IS? ( SEQUENTIAL | RANDOM | DYNAMIC | EXCLUSIVE ) recordKeyClause ::= KEY? IS? qualifiedDataName passwordClause? ( WITH? DUPLICATES )? alternateRecordKeyClause ::= ALTERNATE RECORD KEY? IS? qualifiedDataName passwordClause? ( WITH? DUPLICATES )? passwordClause ::= PASSWORD IS? dataName fileStatusClause ::= FILE? STATUS IS? qualifiedDataName qualifiedDataName? relativeKeyClause ::= RELATIVE KEY? IS? qualifiedDataName ioControlParagraph ::= I_O_CONTROL dot_fs ( fileName dot_fs )? ( ioControlClause+ dot_fs )? ioControlClause ::= rerunClause | sameClause | multipleFileClause | commitmentControlClause | applyWriteOnlyClause rerunClause ::= RERUN ( ON ( assignmentName | fileName ) )? EVERY ( rerunEveryRecords | rerunEveryOf | rerunEveryClock ) rerunEveryRecords ::= integerLiteral RECORDS rerunEveryOf ::= END? OF? ( REEL | UNIT ) OF fileName rerunEveryClock ::= integerLiteral CLOCK_UNITS? sameClause ::= SAME ( RECORD | SORT | SORT_MERGE )? AREA? FOR? fileName+ multipleFileClause ::= MULTIPLE FILE TAPE? CONTAINS? multipleFilePosition+ multipleFilePosition ::= fileName ( POSITION integerLiteral )? applyWriteOnlyClause ::= APPLY WRITE_ONLY ON? fileName+ commitmentControlClause ::= COMMITMENT CONTROL FOR? fileName endClause ::= DOT_FS dataDivision ::= DATA DIVISION dot_fs dataDivisionSection* dataDivisionSection ::= fileSection | workingStorageSection | linkageSection | localStorageSection | dialectSection dialectSection ::= dialectNodeFiller fileSection ::= FILE SECTION dot_fs fileDescriptionEntry* fileDescriptionEntry ::= fileDescriptionEntryClauses dataDescriptionEntry* | dialectNodeFiller fileDescriptionEntryClauses ::= ( FD | SD ) cobolWord fileDescriptionEntryClause* dot_fs fileDescriptionEntryClause ::= externalClause | globalClause | blockContainsClause | recordContainsClause | labelRecordsClause | valueOfClause | dataRecordsClause | linageClause | codeSetClause | reportClause | recordingModeClause externalClause ::= IS? EXTERNAL globalClause ::= IS? GLOBAL blockContainsClause ::= BLOCK CONTAINS? integerLiteral blockContainsTo? ( RECORDS | CHARACTERS )? blockContainsTo ::= TO integerLiteral recordContainsClause ::= RECORD ( recordContainsClauseFormat1 | recordContainsClauseFormat2 | recordContainsClauseFormat3 ) recordContainsClauseFormat1 ::= CONTAINS? integerLiteral CHARACTERS? recordContainsClauseFormat2 ::= IS? VARYING IN? SIZE? ( ( FROM? integerLiteral )? recordContainsTo? CHARACTERS? )? ( DEPENDING ON? qualifiedDataName )? recordContainsClauseFormat3 ::= CONTAINS? integerLiteral recordContainsTo CHARACTERS? recordContainsTo ::= TO integerLiteral labelRecordsClause ::= LABEL ( RECORD | RECORDS ) ( IS | ARE )? ( OMITTED | STANDARD | dataName* ) valueOfClause ::= VALUE OF valuePair+ valuePair ::= systemName IS? ( qualifiedDataName | literal ) dataRecordsClause ::= DATA ( RECORD | RECORDS ) ( IS | ARE )? qualifiedDataName+ linageClause ::= LINAGE IS? ( dataName | integerLiteral ) LINES? linageAt* linageAt ::= linageFootingAt | linageLinesAtTop | linageLinesAtBottom linageFootingAt ::= WITH? FOOTING AT? ( dataName | integerLiteral ) linageLinesAtTop ::= LINES? AT? TOP ( dataName | integerLiteral ) linageLinesAtBottom ::= LINES? AT? BOTTOM ( dataName | integerLiteral ) recordingModeClause ::= RECORDING MODE? IS? modeStatement modeStatement ::= cobolWord codeSetClause ::= CODE_SET IS? alphabetName reportClause ::= ( REPORT IS? | REPORTS ARE? ) reportName+ workingStorageSection ::= WORKING_STORAGE SECTION dot_fs dataDescriptionEntryForWorkingStorageSection* linkageSection ::= LINKAGE SECTION dot_fs dataDescriptionEntryForWorkingStorageAndLinkageSection* localStorageSection ::= LOCAL_STORAGE SECTION dot_fs dataDescriptionEntryForLocalStorageSection* dataDescriptionEntryForLocalStorageSection ::= dataDescriptionEntry dataDescriptionEntryForWorkingStorageSection ::= dataDescriptionEntryForWorkingStorageAndLinkageSection dataDescriptionEntryForWorkingStorageAndLinkageSection ::= dataDescriptionEntry dataDescriptionEntry ::= dataDescriptionEntryFormat1 | dataDescriptionEntryFormat2 | dataDescriptionEntryFormat1Level77 | dataDescriptionEntryFormat3 | dialectDescriptionEntry dataDescriptionEntryFormat1 ::= levelNumber entryName? ( dataGroupUsageClause | dataRedefinesClause | dataExternalClause | dataGlobalClause | dataPictureClause | dataUsageClause | dataValueClause | dataOccursClause | dataSignClause | dataSynchronizedClause | dataJustifiedClause | dataBlankWhenZeroClause | dataDynamicLengthClause | dataVolatileClause )* dot_fs levelNumber ::= LEVEL_NUMBER dataDescriptionEntryFormat2 ::= LEVEL_NUMBER_66 entryName? dataRenamesClause dot_fs dataDescriptionEntryFormat1Level77 ::= LEVEL_NUMBER_77 entryName? ( dataGroupUsageClause | dataRedefinesClause | dataExternalClause | dataGlobalClause | dataPictureClause | dataUsageClause | dataValueClause | dataOccursClause | dataSignClause | dataSynchronizedClause | dataJustifiedClause | dataBlankWhenZeroClause | dataDynamicLengthClause | dataVolatileClause )* dot_fs dataDescriptionEntryFormat3 ::= LEVEL_NUMBER_88 entryName? dataValueClause dot_fs dialectDescriptionEntry ::= dialectNodeFiller entryName ::= FILLER | dataName dataGroupUsageClause ::= GROUP_USAGE IS? ( NATIONAL | UTF_8 ) dataBlankWhenZeroClause ::= BLANK WHEN? ( ZERO | ZEROS | ZEROES ) dataExternalClause ::= IS? EXTERNAL ( BY literal )? dataGlobalClause ::= IS? GLOBAL dataJustifiedClause ::= ( JUSTIFIED | JUST ) RIGHT? dataOccursClause ::= OCCURS ( integerLiteral | UNBOUNDED ) dataOccursTo? TIMES? ( DEPENDING ON? qualifiedDataName )? dataOccursSort* ( INDEXED BY? LOCAL? indexName+ )? dataOccursTo ::= TO ( integerLiteral | UNBOUNDED ) dataOccursSort ::= ( ASCENDING | DESCENDING ) KEY? IS? qualifiedDataName+ dataPictureClause ::= ( PICTURE | PIC ) PICTUREIS? pictureString+ pictureString ::= charString dataDynamicLengthClause ::= DYNAMIC LENGTH? ( LIMIT IS? integerLiteral )? dataVolatileClause ::= VOLATILE dataRedefinesClause ::= REDEFINES dataName dataRenamesClause ::= RENAMES qualifiedVariableDataName thruDataName? thruDataName ::= ( THROUGH | THRU ) qualifiedVariableDataName qualifiedVariableDataName ::= dataName ( ( IN | OF ) dataName )? dataSignClause ::= ( SIGN IS? )? ( LEADING | TRAILING ) ( SEPARATE CHARACTER? )? dataSynchronizedClause ::= ( SYNCHRONIZED | SYNC ) ( LEFT | RIGHT )? dataUsageClause ::= ( USAGE IS? )? usageFormat usageFormat ::= ( BINARY | COMP | COMP_1 | COMP_2 | COMP_3 | COMP_4 | COMP_5 | COMPUTATIONAL | COMPUTATIONAL_1 | COMPUTATIONAL_2 | COMPUTATIONAL_3 | COMPUTATIONAL_4 | COMPUTATIONAL_5 | DISPLAY | DISPLAY_1 | NATIONAL | UTF_8 | PACKED_DECIMAL ) NATIVE? | INDEX | OBJECT REFERENCE cobolWord? | POINTER | POINTER_32 | PROCEDURE_POINTER | FUNCTION_POINTER dataValueClause ::= valueIsToken dataValueClauseLiteral valueIsToken ::= valueToken isAreToken? valueToken ::= VALUE | VALUES isAreToken ::= IS | ARE dataValueClauseLiteral ::= dataValueInterval ( COMMACHAR? dataValueInterval )* dataValueInterval ::= dataValueIntervalFrom dataValueIntervalTo? dataValueIntervalFrom ::= literal | cobolWord dataValueIntervalTo ::= thruToken literal thruToken ::= THROUGH | THRU procedureDivision ::= PROCEDURE DIVISION procedureDivisionUsingClause? procedureDivisionGivingClause? dot_fs procedureDeclaratives? procedureDivisionBody procedureDivisionUsingClause ::= ( USING | CHAINING ) procedureDivisionUsingParameter ( COMMACHAR? procedureDivisionUsingParameter )* procedureDivisionGivingClause ::= RETURNING dataName procedureDivisionUsingParameter ::= BY? ( REFERENCE | VALUE )? generalIdentifier procedureDeclaratives ::= DECLARATIVES dot_fs procedureDeclarative+ END DECLARATIVES dot_fs procedureDeclarative ::= procedureSectionHeader dot_fs useStatement dot_fs paragraphs procedureSectionHeader ::= sectionName SECTION integerLiteral? procedureDivisionBody ::= paragraphs procedureSection* procedureSection ::= procedureSectionHeader dot_fs paragraphs sentence ::= statement* ( endClause | dialectStatement ) | dialectStatement paragraph ::= paragraphDefinitionName dot_fs ( alteredGoTo | sentence* ) paragraphs ::= ( sentence | paragraph )* conditionalStatementCall ::= statement | dialectStatement statement ::= acceptStatement | addStatement | allocateStatement | alterStatement | callStatement | cancelStatement | closeStatement | computeStatement | continueStatement | deleteStatement | disableStatement | displayStatement | divideStatement | enableStatement | entryStatement | evaluateStatement | exhibitStatement | exitStatement | freeStatement | generateStatement | gobackStatement | goToStatement | ifStatement | initializeStatement | initiateStatement | inspectStatement | mergeStatement | moveStatement | multiplyStatement | openStatement | performStatement | purgeStatement | readStatement | readyResetTraceStatement | receiveStatement | releaseStatement | returnStatement | rewriteStatement | searchStatement | sendStatement | serviceReloadStatement | serviceLabelStatement | setStatement | sortStatement | startStatement | stopStatement | stringStatement | subtractStatement | terminateStatement | unstringStatement | writeStatement | xmlParseStatement | jsonStatement | xmlGenerate xmlGenerate ::= XML GENERATE xmlGenIdentifier1 FROM xmlGenIdentifier2 ( COUNT IN? xmlGenIdentifier3 )? ( WITH? ENCODING integerLiteral )? ( WITH? XML_DECLARATION )? ( WITH? ATTRIBUTES )? ( NAMESPACE IS? ( xmlGenIdentifier4 | literal ) )? ( NAMESPACE_PREFIX IS? ( xmlGenIdentifier5 | literal ) )? ( NAME OF? ( xmlGenIdentifier6 IS? literal )+ )? ( TYPE OF? ( xmlGenIdentifier7 IS? ( ATTRIBUTE | ELEMENT | CONTENT ) )+ )? ( SUPPRESS ( xmlGenIdentifier8 when_phrase? | generic_suppression_phrase )+ )? onExceptionClause? notOnExceptionClause? END_XML? xmlGenIdentifier1 ::= qualifiedDataName xmlGenIdentifier2 ::= qualifiedDataName xmlGenIdentifier3 ::= qualifiedDataName xmlGenIdentifier4 ::= qualifiedDataName xmlGenIdentifier5 ::= qualifiedDataName xmlGenIdentifier6 ::= qualifiedDataName xmlGenIdentifier7 ::= qualifiedDataName xmlGenIdentifier8 ::= qualifiedDataName jsonStatement ::= jsonParse | jsonGenerate jsonParse ::= JSON PARSE jsonIdentifier1 INTO jsonIdentifier2 ( WITH? DETAIL )? ( NAME OF? ( jsonIdentifier3 IS? ( literal | OMITTED ) )+ )? ( SUPPRESS jsonIdentifier4+ )? ( CONVERTING json_parse_phrase1 ( ALSO json_parse_phrase1 )* )? onExceptionClause? notOnExceptionClause? END_JSON? json_parse_phrase1 ::= jsonIdentifier5 FROM? JSON? ( BOOLEAN | BOOL ) callUsingPhrase1 jsonIdentifier1 ::= qualifiedDataName jsonIdentifier2 ::= qualifiedDataName jsonIdentifier3 ::= qualifiedDataName jsonIdentifier4 ::= qualifiedDataName jsonIdentifier5 ::= qualifiedDataName jsonConditionName ::= qualifiedDataName callUsingPhrase1 ::= USING? ( jsonConditionName ( AND? jsonConditionName )? | literal AND? literal ) jsonGenerate ::= JSON GENERATE jsonGenIdentifier1 FROM jsonGenIdentifier2 ( COUNT IN? jsonGenIdentifier3 )? ( NAME OF? ( jsonGenIdentifier4 IS? ( literal | OMITTED ) )+ )? ( SUPPRESS ( jsonGenIdentifier5 when_phrase? | generic_suppression_phrase )+ )? ( CONVERTING json_gen_phrase1 ( ALSO json_gen_phrase1 )* )? onExceptionClause? notOnExceptionClause? END_JSON? jsonGenIdentifier1 ::= qualifiedDataName jsonGenIdentifier2 ::= qualifiedDataName jsonGenIdentifier3 ::= qualifiedDataName jsonGenIdentifier4 ::= qualifiedDataName jsonGenIdentifier5 ::= qualifiedDataName jsonGenConditionName ::= qualifiedDataName jsonGenIdentifier6 ::= qualifiedDataName when_phrase ::= WHEN json_phrases ( OR? json_phrases )* generic_suppression_phrase ::= ( EVERY ( ( NUMERIC | NONNUMERIC ) generic_suppression_arguments? | generic_suppression_arguments ) )? when_phrase generic_suppression_arguments ::= ATTRIBUTE | CONTENT | ELEMENT json_phrases ::= ZERO | ZEROES | ZEROS | SPACE | SPACES | LOW_VALUE | LOW_VALUES | HIGH_VALUE | HIGH_VALUES json_gen_phrase1 ::= jsonGenIdentifier6 TO? JSON? ( BOOLEAN | BOOL ) USING? ( jsonGenConditionName | literal ) acceptStatement ::= ACCEPT generalIdentifier ( acceptFromDateStatement | acceptFromEscapeKeyStatement | acceptFromMnemonicStatement | acceptMessageCountStatement )? onExceptionClause? notOnExceptionClause? END_ACCEPT? dialectStatement ::= dialectNodeFiller | dialectIfStatment acceptFromDateStatement ::= FROM ( DATE YYYYMMDD? | DAY YYYYDDD? | DAY_OF_WEEK | TIME | TIMER | TODAYS_DATE MMDDYYYY? | TODAYS_NAME | YEAR | YYYYMMDD | YYYYDDD ) acceptFromMnemonicStatement ::= FROM mnemonicName acceptFromEscapeKeyStatement ::= FROM ESCAPE KEY acceptMessageCountStatement ::= MESSAGE? COUNT addStatement ::= ADD ( addToStatement | addToGivingStatement | addCorrespondingStatement ) onSizeErrorPhrase? notOnSizeErrorPhrase? END_ADD? addToStatement ::= addFrom ( COMMACHAR? addFrom )* TO addTo ( COMMACHAR? addTo )* addToGivingStatement ::= addFrom ( COMMACHAR? addFrom )* ( TO addToGiving ( COMMACHAR? addToGiving )* )? GIVING addGiving ( COMMACHAR? addGiving )* addCorrespondingStatement ::= ( CORRESPONDING | CORR ) generalIdentifier TO addTo addFrom ::= literal | generalIdentifier addTo ::= generalIdentifier ROUNDED? addToGiving ::= literal | generalIdentifier addGiving ::= generalIdentifier ROUNDED? alteredGoTo ::= GO TO? DOT_FS allocateStatement ::= ALLOCATE ( arithmeticExpression CHARACTERS | qualifiedDataName ) INITIALIZED? ( LOC integerLiteral )? ( RETURNING qualifiedDataName )? alterStatement ::= ALTER alterProceedTo+ alterProceedTo ::= procedureName TO ( PROCEED TO )? procedureName callStatement ::= CALL ( generalIdentifier | constantName ) callUsingPhrase? callGivingPhrase? onOverflowPhrase? onExceptionClause? notOnExceptionClause? END_CALL? constantName ::= literal callUsingPhrase ::= USING callUsingParameter ( commaSeparator? callUsingParameter )* callUsingParameter ::= callByReferencePhrase | callByValuePhrase | callByContentPhrase callByReferencePhrase ::= ( BY? REFERENCE )? callByReference callByReference ::= ( INTEGER | STRING )? literal | generalIdentifier | OMITTED callByValuePhrase ::= BY? VALUE ( literal | generalIdentifier ) callByContentPhrase ::= BY? CONTENT ( literal | generalIdentifier | OMITTED ) callGivingPhrase ::= ( GIVING | RETURNING ) generalIdentifier cancelStatement ::= CANCEL cancelCall+ cancelCall ::= libraryName ( BYTITLE | BYFUNCTION ) | literal | generalIdentifier closeStatement ::= CLOSE closeFile ( COMMACHAR? closeFile )* closeFile ::= fileName ( closeReelUnitStatement | closeRelativeStatement | closePortFileIOStatement )? closeReelUnitStatement ::= ( REEL | UNIT ) ( FOR? REMOVAL )? ( WITH? ( NO REWIND | LOCK ) )? closeRelativeStatement ::= WITH? ( NO REWIND | LOCK ) closePortFileIOStatement ::= ( WITH? NO | WITH ) WAIT ( USING closePortFileIOUsing+ )? closePortFileIOUsing ::= closePortFileIOUsingCloseDisposition | closePortFileIOUsingAssociatedData | closePortFileIOUsingAssociatedDataLength closePortFileIOUsingCloseDisposition ::= CLOSE_DISPOSITION OF? ( ABORT | ORDERLY ) closePortFileIOUsingAssociatedData ::= ASSOCIATED_DATA ( integerLiteral | generalIdentifier ) closePortFileIOUsingAssociatedDataLength ::= ASSOCIATED_DATA_LENGTH OF? ( integerLiteral | generalIdentifier ) computeStatement ::= COMPUTE computeStore+ ( EQUALCHAR | EQUAL ) COMMACHAR? arithmeticExpression COMMACHAR? onSizeErrorPhrase? COMMACHAR? notOnSizeErrorPhrase? END_COMPUTE? computeStore ::= generalIdentifier ROUNDED? continueStatement ::= CONTINUE deleteStatement ::= DELETE deleteFilenameClause deleteFilenameClause ::= fileName RECORD? invalidKeyPhrase? notInvalidKeyPhrase? END_DELETE? disableStatement ::= DISABLE ( INPUT TERMINAL? | I_O TERMINAL | OUTPUT ) cdName WITH? KEY ( literal | generalIdentifier ) displayStatement ::= DISPLAY displayOperand ( COMMACHAR? displayOperand )* displayAt? displayUpon? displayWith? displayOperand ::= literal | generalIdentifier displayAt ::= AT ( literal | generalIdentifier ) displayUpon ::= UPON cobolWord displayWith ::= WITH? NO ADVANCING divideStatement ::= DIVIDE ( literal | generalIdentifier ) ( divideIntoStatement | divideIntoGivingStatement | divideByGivingStatement ) divideRemainder? onSizeErrorPhrase? notOnSizeErrorPhrase? END_DIVIDE? divideIntoStatement ::= INTO divideInto+ divideIntoGivingStatement ::= INTO ( literal | generalIdentifier ) divideGivingPhrase divideRemainderPhrase? divideRemainderPhrase ::= REMAINDER generalIdentifier divideByGivingStatement ::= BY ( literal | generalIdentifier ) divideGivingPhrase divideGivingPhrase ::= GIVING divideGiving+ divideInto ::= generalIdentifier ROUNDED? divideGiving ::= generalIdentifier ROUNDED? divideRemainder ::= REMAINDER generalIdentifier enableStatement ::= ENABLE ( INPUT TERMINAL? | I_O TERMINAL | OUTPUT ) cdName WITH? KEY ( literal | generalIdentifier ) entryStatement ::= ENTRY literal ( USING generalIdentifier ( COMMACHAR? generalIdentifier )* )? evaluateStatement ::= EVALUATE evaluateSelect evaluateAlsoSelect* evaluateWhenPhrase+ evaluateWhenOther? END_EVALUATE? evaluateSelect ::= arithmeticExpression | condition evaluateAlsoSelect ::= ALSO evaluateSelect evaluateWhenPhrase ::= evaluateWhen+ ( COMMACHAR? conditionalStatementCall )* evaluateWhen ::= WHEN evaluateCondition evaluateAlsoCondition* evaluateCondition ::= ANY | NOT? evaluateValue evaluateThrough? | condition | booleanLiteral evaluateThrough ::= ( THROUGH | THRU ) evaluateValue evaluateAlsoCondition ::= ALSO evaluateCondition evaluateWhenOther ::= WHEN OTHER ( COMMACHAR? conditionalStatementCall )* evaluateValue ::= arithmeticExpression exhibitStatement ::= EXHIBIT NAMED? CHANGED? exhibitOperand+ exhibitOperand ::= literal | generalIdentifier freeStatement ::= FREE qualifiedDataName exitStatement ::= EXIT ( PROGRAM | SECTION | PARAGRAPH | PERFORM CYCLE? | METHOD )? generateStatement ::= GENERATE reportName gobackStatement ::= GOBACK goToStatement ::= GO TO? procedureName+ ( DEPENDING ON? generalIdentifier )? dialectIfStatment ::= DIALECT_IF dialectNodeFiller* ifThen ifElse? END_IF? ifStatement ::= IF ( condition | dialectNodeFiller* ) ifThen ifElse? END_IF? ifThen ::= THEN? ( NEXT SENTENCE | conditionalStatementCall+ ) ifElse ::= ELSE ( NEXT SENTENCE | conditionalStatementCall+ ) initializeStatement ::= INITIALIZE generalIdentifier ( COMMACHAR? generalIdentifier )* ( WITH? FILLER )? ( ( ALL | categoryName ) TO? VALUE )? ( THEN? initializeReplacingPhrase )? ( THEN? TO? DEFAULT )? categoryName ::= ALPHABETIC | ALPHANUMERIC | ALPHANUMERIC_EDITED | DBCS | EGCS | NATIONAL | NATIONAL_EDITED | NUMERIC | NUMERIC_EDITED initializeReplacingPhrase ::= REPLACING initializeReplacingBy+ initializeReplacingBy ::= categoryName DATA? BY ( literal | generalIdentifier ) initiateStatement ::= INITIATE reportName+ inspectStatement ::= INSPECT generalIdentifier ( inspectTallyingPhrase | inspectReplacingPhrase | inspectTallyingReplacingPhrase | inspectConvertingPhrase ) inspectTallyingPhrase ::= TALLYING inspectFor+ inspectReplacingPhrase ::= REPLACING ( inspectReplacingCharacters | inspectReplacingAllLeadings )+ inspectTallyingReplacingPhrase ::= TALLYING inspectFor+ inspectReplacingPhrase+ inspectConvertingPhrase ::= CONVERTING ( literal | generalIdentifier ) inspectTo inspectBeforeAfter* inspectFor ::= generalIdentifier FOR ( inspectCharacters | inspectAllLeadings )+ inspectCharacters ::= CHARACTERS inspectBeforeAfter* inspectReplacingCharacters ::= CHARACTERS inspectBy inspectBeforeAfter* inspectAllLeadings ::= ( ALL | LEADING ) inspectAllLeading+ inspectReplacingAllLeadings ::= ( ALL | LEADING | FIRST ) inspectReplacingAllLeading+ inspectAllLeading ::= ( literal | generalIdentifier ) inspectBeforeAfter* inspectReplacingAllLeading ::= ( literal | generalIdentifier ) inspectBy inspectBeforeAfter* inspectBy ::= BY ( literal | generalIdentifier ) inspectTo ::= TO ( literal | generalIdentifier ) inspectBeforeAfter ::= ( BEFORE | AFTER ) INITIAL? ( literal | generalIdentifier ) mergeStatement ::= MERGE fileName mergeOnKeyClause+ mergeCollatingSequencePhrase? mergeUsing* outputProcedurePhrase? mergeGivingPhrase* mergeOnKeyClause ::= ON? ( ASCENDING | DESCENDING ) KEY? qualifiedDataName+ mergeCollatingSequencePhrase ::= COLLATING? SEQUENCE IS? alphabetName+ mergeCollatingAlphanumeric? mergeCollatingNational? mergeCollatingAlphanumeric ::= FOR? ALPHANUMERIC IS alphabetName mergeCollatingNational ::= FOR? NATIONAL IS? alphabetName mergeUsing ::= USING fileName+ mergeGivingPhrase ::= GIVING mergeGiving+ mergeGiving ::= fileName ( LOCK | SAVE | NO REWIND | ( WITH REMOVE )? CRUNCH | RELEASE )? moveStatement ::= MOVE ALL? ( moveToStatement | moveCorrespondingToStatement ) moveToStatement ::= moveToSendingArea TO generalIdentifier ( COMMACHAR? generalIdentifier )* moveToSendingArea ::= literal | generalIdentifier moveCorrespondingToStatement ::= ( CORRESPONDING | CORR ) moveCorrespondingToSendingArea TO generalIdentifier ( COMMACHAR? generalIdentifier )* moveCorrespondingToSendingArea ::= generalIdentifier multiplyStatement ::= MULTIPLY ( literal | generalIdentifier ) BY ( multiplyRegular | multiplyGiving ) onSizeErrorPhrase? notOnSizeErrorPhrase? END_MULTIPLY? multiplyRegular ::= multiplyRegularOperand+ multiplyRegularOperand ::= generalIdentifier ROUNDED? multiplyGiving ::= multiplyGivingOperand GIVING multiplyGivingResult+ multiplyGivingOperand ::= literal | generalIdentifier multiplyGivingResult ::= generalIdentifier ROUNDED? openStatement ::= OPEN ( openInputStatement | openOutputStatement | openIOStatement | openExtendStatement )+ openInputStatement ::= INPUT openInput ( COMMACHAR? openInput )* openInput ::= fileName ( REVERSED | WITH? NO REWIND )? openOutputStatement ::= OUTPUT openOutput ( COMMACHAR? openOutput )* openOutput ::= fileName ( WITH? NO REWIND )? openIOStatement ::= I_O fileName ( COMMACHAR? fileName )* openExtendStatement ::= EXTEND fileName ( COMMACHAR? fileName )* performStatement ::= PERFORM ( performProcedureStatement | performInlineStatement ) performInlineStatement ::= performType? conditionalStatementCall* ( EXIT PERFORM CYCLE? )? END_PERFORM performProcedureStatement ::= procedureName through? performType? performType ::= performTimes | performUntil | performVarying performTimes ::= ( integerLiteral | generalIdentifier ) TIMES performUntil ::= performTestClause? UNTIL condition performVarying ::= performTestClause performVaryingClause | performVaryingClause performTestClause? performVaryingClause ::= VARYING performVaryingPhrase performAfter* performVaryingPhrase ::= ( literal | generalIdentifier ) performFrom performBy performUntil performAfter ::= AFTER performVaryingPhrase performFrom ::= FROM ( literal | generalIdentifier ) performBy ::= BY ( literal | generalIdentifier ) performTestClause ::= WITH? TEST ( BEFORE | AFTER ) purgeStatement ::= PURGE cdName+ readStatement ::= READ readFilenameClause readFilenameClause ::= fileName NEXT? RECORD? readInto? readWith? readKey? invalidKeyPhrase? notInvalidKeyPhrase? atEndPhrase? notAtEndPhrase? END_READ? readInto ::= INTO generalIdentifier readWith ::= WITH? ( ( KEPT | NO ) LOCK | WAIT ) readKey ::= KEY IS? qualifiedDataName readyResetTraceStatement ::= ( READY | RESET ) TRACE receiveStatement ::= RECEIVE ( receiveFromStatement | receiveIntoStatement ) onExceptionClause? notOnExceptionClause? END_RECEIVE? receiveFromStatement ::= dataName FROM receiveFrom ( receiveBefore | receiveWith | receiveThread | receiveSize | receiveStatus )* receiveFrom ::= THREAD dataName | ( LAST | ANY ) THREAD receiveIntoStatement ::= cdName ( MESSAGE | SEGMENT ) INTO? generalIdentifier receiveNoData? receiveWithData? receiveNoData ::= NO DATA conditionalStatementCall ( COMMACHAR? conditionalStatementCall )* receiveWithData ::= WITH DATA conditionalStatementCall ( COMMACHAR? conditionalStatementCall )* receiveBefore ::= BEFORE TIME? ( numericLiteral | generalIdentifier ) receiveWith ::= WITH? NO WAIT receiveThread ::= THREAD IN? dataName receiveSize ::= SIZE IN? ( numericLiteral | generalIdentifier ) receiveStatus ::= STATUS IN? generalIdentifier releaseStatement ::= RELEASE recordName ( FROM qualifiedDataName )? returnStatement ::= RETURN cobolReturn cobolReturn ::= fileName RECORD? returnInto? atEndPhrase notAtEndPhrase? END_RETURN? returnInto ::= INTO qualifiedDataName rewriteStatement ::= REWRITE recordName rewriteFrom? invalidKeyPhrase? notInvalidKeyPhrase? END_REWRITE? rewriteFrom ::= FROM generalIdentifier searchStatement ::= SEARCH ALL? qualifiedDataName searchVarying? atEndPhrase? searchWhen+ END_SEARCH? searchVarying ::= VARYING qualifiedDataName searchWhen ::= WHEN condition ( NEXT SENTENCE | conditionalStatementCall ( COMMACHAR? conditionalStatementCall )* ) sendStatement ::= SEND ( sendStatementSync | sendStatementAsync ) onExceptionClause? notOnExceptionClause? sendStatementSync ::= ( literal | generalIdentifier ) sendFromPhrase? sendWithPhrase? sendReplacingPhrase? sendAdvancingPhrase? sendStatementAsync ::= TO ( TOP | BOTTOM ) generalIdentifier sendFromPhrase ::= FROM generalIdentifier sendWithPhrase ::= WITH ( EGI | EMI | ESI | generalIdentifier ) sendReplacingPhrase ::= REPLACING LINE? sendAdvancingPhrase ::= ( BEFORE | AFTER ) ADVANCING? ( sendAdvancingPage | sendAdvancingLines | sendAdvancingMnemonic ) sendAdvancingPage ::= PAGE sendAdvancingLines ::= ( literal | generalIdentifier ) ( LINE | LINES )? sendAdvancingMnemonic ::= mnemonicName setStatement ::= SET ( setToOnOff+ | setToBoolean | setToStatement | setUpDownByStatement | setToEntry ) setToStatement ::= receivingField+ TO sendingField setUpDownByStatement ::= receivingField+ ( UP | DOWN ) BY sendingField setToBoolean ::= receivingField+ TO booleanLiteral setToOnOff ::= receivingField+ TO ( ON | OFF ) setToEntry ::= receivingField+ TO ENTRY sendingField receivingField ::= generalIdentifier sendingField ::= literal | generalIdentifier serviceLabelStatement ::= SERVICE LABEL serviceReloadStatement ::= SERVICE RELOAD generalIdentifier sortStatement ::= SORT fileName sortOnKeyClause+ sortDuplicatesPhrase? sortCollatingSequencePhrase? inputProcedurePhrase? sortUsing* outputProcedurePhrase? sortGivingPhrase* sortOnKeyClause ::= ON? ( ASCENDING | DESCENDING ) KEY? qualifiedDataName+ sortDuplicatesPhrase ::= WITH? DUPLICATES IN? ORDER? sortCollatingSequencePhrase ::= COLLATING? SEQUENCE IS? alphabetName+ sortCollatingAlphanumeric? sortCollatingNational? sortCollatingAlphanumeric ::= FOR? ALPHANUMERIC IS alphabetName sortCollatingNational ::= FOR? NATIONAL IS? alphabetName inputProcedurePhrase ::= INPUT PROCEDURE IS? procedureName through? through ::= ( THROUGH | THRU ) procedureName sortUsing ::= USING fileName+ outputProcedurePhrase ::= OUTPUT PROCEDURE IS? procedureName through? sortGivingPhrase ::= GIVING sortGiving+ sortGiving ::= fileName ( LOCK | SAVE | NO REWIND | ( WITH REMOVE )? CRUNCH | RELEASE )? startStatement ::= START fileName startKey? invalidKeyPhrase? notInvalidKeyPhrase? END_START? startKey ::= KEY IS? ( EQUAL TO? | EQUALCHAR | GREATER THAN? ( OR EQUAL TO? )? | MORETHANCHAR | NOT ( LESS THAN? | LESSTHANCHAR ) | MORETHANOREQUAL ) qualifiedDataName stopStatement ::= STOP ( RUN | literal | stopStatementGiving ) stopStatementGiving ::= RUN ( GIVING | RETURNING ) ( integerLiteral | generalIdentifier ) stringStatement ::= STRING stringSendingPhrase+ stringIntoPhrase stringWithPointerPhrase? onOverflowPhrase? notOnOverflowPhrase? END_STRING? stringSendingPhrase ::= ( COMMACHAR? stringSending )+ ( stringDelimitedByPhrase | stringForPhrase ) stringSending ::= literal | generalIdentifier stringDelimitedByPhrase ::= DELIMITED BY? ( SIZE | literal | generalIdentifier ) stringForPhrase ::= FOR ( literal | generalIdentifier ) stringIntoPhrase ::= INTO generalIdentifier stringWithPointerPhrase ::= WITH? POINTER qualifiedDataName subtractStatement ::= SUBTRACT ( subtractFromStatement | subtractFromGivingStatement | subtractCorrespondingStatement ) onSizeErrorPhrase? notOnSizeErrorPhrase? END_SUBTRACT? subtractFromStatement ::= subtractSubtrahend ( COMMACHAR? subtractSubtrahend )* FROM subtractMinuend ( COMMACHAR? subtractMinuend )* subtractFromGivingStatement ::= subtractSubtrahend ( COMMACHAR? subtractSubtrahend )* FROM subtractMinuendGiving GIVING subtractGiving ( COMMACHAR? subtractGiving )* subtractCorrespondingStatement ::= ( CORRESPONDING | CORR ) qualifiedDataName FROM subtractMinuendCorresponding subtractSubtrahend ::= literal | generalIdentifier subtractMinuend ::= generalIdentifier ROUNDED? subtractMinuendGiving ::= literal | generalIdentifier subtractGiving ::= generalIdentifier ROUNDED? subtractMinuendCorresponding ::= qualifiedDataName ROUNDED? terminateStatement ::= TERMINATE reportName unstringStatement ::= UNSTRING unstringSendingPhrase COMMACHAR? unstringIntoPhrase COMMACHAR? unstringWithPointerPhrase? COMMACHAR? unstringTallyingPhrase? COMMACHAR? onOverflowPhrase? COMMACHAR? notOnOverflowPhrase? END_UNSTRING? unstringSendingPhrase ::= generalIdentifier ( unstringDelimitedByPhrase unstringOrAllPhrase* )? unstringDelimitedByPhrase ::= DELIMITED BY? ALL? ( literal | generalIdentifier ) unstringOrAllPhrase ::= OR ALL? ( literal | generalIdentifier ) unstringIntoPhrase ::= INTO unstringInto ( COMMACHAR? unstringInto )* unstringInto ::= generalIdentifier unstringDelimiterIn? unstringCountIn? unstringDelimiterIn ::= DELIMITER IN? generalIdentifier unstringCountIn ::= COUNT IN? generalIdentifier unstringWithPointerPhrase ::= WITH? POINTER qualifiedDataName unstringTallyingPhrase ::= TALLYING IN? qualifiedDataName useStatement ::= USE ( useAfterClause | useDebugClause ) useAfterClause ::= GLOBAL? AFTER STANDARD? ( EXCEPTION | ERROR ) PROCEDURE ON? useAfterOn useAfterOn ::= INPUT | OUTPUT | I_O | EXTEND | fileName ( COMMACHAR? fileName )* useDebugClause ::= FOR? DEBUGGING ON? useDebugOn ( COMMACHAR? useDebugOn )* useDebugOn ::= ALL ( PROCEDURES | REFERENCES? OF? generalIdentifier ) | procedureName writeStatement ::= WRITE writeStatementClause writeStatementClause ::= recordName writeFromPhrase? writeAdvancingPhrase? writeAtEndOfPagePhrase? writeNotAtEndOfPagePhrase? invalidKeyPhrase? notInvalidKeyPhrase? END_WRITE? writeFromPhrase ::= FROM ( literal | generalIdentifier ) writeAdvancingPhrase ::= ( BEFORE | AFTER ) ADVANCING? ( writeAdvancingPage | writeAdvancingLines ) writeAdvancingPage ::= PAGE writeAdvancingLines ::= ( literal | generalIdentifier ) ( LINE | LINES )? writeAtEndOfPagePhrase ::= AT? ( END_OF_PAGE | EOP ) conditionalStatementCall ( COMMACHAR? conditionalStatementCall )* writeNotAtEndOfPagePhrase ::= NOT AT? ( END_OF_PAGE | EOP ) conditionalStatementCall ( COMMACHAR? conditionalStatementCall )* xmlParseStatement ::= XML PARSE qualifiedDataName xmlEncoding? xmlNational? xmlValidating? xmlProcessinProcedure through? onExceptionClause? notOnExceptionClause? END_XML? xmlEncoding ::= WITH? ENCODING integerLiteral xmlNational ::= RETURNING NATIONAL xmlValidating ::= VALIDATING WITH? ( qualifiedDataName | FILE literal ) xmlProcessinProcedure ::= PROCESSING PROCEDURE IS? procedureName atEndPhrase ::= AT? END ( COMMACHAR? conditionalStatementCall )+ notAtEndPhrase ::= NOT AT? END ( COMMACHAR? conditionalStatementCall )+ invalidKeyPhrase ::= INVALID KEY? ( COMMACHAR? conditionalStatementCall )+ notInvalidKeyPhrase ::= NOT INVALID KEY? ( COMMACHAR? conditionalStatementCall )+ onOverflowPhrase ::= ON? OVERFLOW ( COMMACHAR? conditionalStatementCall )+ notOnOverflowPhrase ::= NOT ON? OVERFLOW ( COMMACHAR? conditionalStatementCall )+ onSizeErrorPhrase ::= ON? SIZE ERROR ( COMMACHAR? conditionalStatementCall )+ notOnSizeErrorPhrase ::= NOT ON? SIZE ERROR ( COMMACHAR? conditionalStatementCall )+ onExceptionClause ::= ON? EXCEPTION ( COMMACHAR? conditionalStatementCall )+ notOnExceptionClause ::= NOT ON? EXCEPTION ( COMMACHAR? conditionalStatementCall )+ condition ::= NOT? ( simpleCondition | nestedCondition | dialectNodeFiller+ ) ( ( AND | OR ) NOT? ( simpleCondition | nestedCondition | relationCombinedComparison | dialectNodeFiller+ ) )* simpleCondition ::= arithmeticExpression ( relationCombinedComparison | fixedComparison )? nestedCondition ::= LPARENCHAR condition RPARENCHAR relationCombinedComparison ::= relationalOperator ( arithmeticExpression | LPARENCHAR arithmeticExpression ( ( AND | OR ) arithmeticExpression )+ RPARENCHAR ) fixedComparison ::= IS? NOT? ( NUMERIC | ALPHABETIC | ALPHABETIC_LOWER | ALPHABETIC_UPPER | DBCS | KANJI | POSITIVE | NEGATIVE | ZERO | className ) relationalOperator ::= ( IS | ARE )? ( NOT? ( ( GREATER | LESS ) THAN? | MORETHANCHAR | LESSTHANCHAR | EQUAL TO? | EQUALCHAR ) | NOTEQUALCHAR | ( GREATER | LESS ) THAN? OR EQUAL TO? | MORETHANOREQUAL | LESSTHANOREQUAL ) generalIdentifier ::= specialRegister | qualifiedDataName | functionCall functionCall ::= FUNCTION functionName ( LPARENCHAR argument ( COMMACHAR? argument )* RPARENCHAR )* referenceModifier? referenceModifier ::= LPARENCHAR characterPosition COLONCHAR length? RPARENCHAR characterPosition ::= arithmeticExpression length ::= arithmeticExpression argument ::= arithmeticExpression | TRAILING | LEADING qualifiedDataName ::= variableUsageName tableCall? referenceModifier? inData* tableCall ::= LPARENCHAR ( ALL | arithmeticExpression ) ( COMMACHAR? ( ALL | arithmeticExpression ) )* RPARENCHAR specialRegister ::= ( ADDRESS OF | LENGTH OF? ) generalIdentifier | LINAGE_COUNTER inData ::= ( IN | OF ) variableUsageName tableCall? referenceModifier? inSection ::= ( IN | OF ) sectionName alphabetName ::= cobolWord assignmentName ::= systemName cdName ::= cobolWord className ::= cobolWord computerName ::= systemName dataName ::= cobolWord variableUsageName ::= cobolWord environmentName ::= systemName fileName ::= cobolWord functionName ::= INTEGER | LENGTH | RANDOM | SUM | MAX | WHEN_COMPILED | cobolWord indexName ::= cobolWord libraryName ::= cobolWord mnemonicName ::= cobolWord paragraphName ::= cobolWord | integerLiteral paragraphDefinitionName ::= cobolWord | integerLiteral procedureName ::= paragraphName inSection? programName ::= literal | cobolWord | OR | AND recordName ::= qualifiedDataName reportName ::= qualifiedDataName sectionName ::= cobolWord | integerLiteral systemName ::= cobolWord symbolicCharacter ::= cobolWord figurativeConstant ::= ALL literal | HIGH_VALUE | HIGH_VALUES | LOW_VALUE | LOW_VALUES | NULL | NULLS | QUOTE | QUOTES | SPACE | SPACES | ZEROS | ZEROES booleanLiteral ::= TRUE | FALSE numericLiteral ::= NUMERICLITERAL | ZERO | integerLiteral integerLiteral ::= INTEGERLITERAL | LEVEL_NUMBER | LEVEL_NUMBER_66 | LEVEL_NUMBER_77 | LEVEL_NUMBER_88 literal ::= NONNUMERICLITERAL | figurativeConstant | numericLiteral | booleanLiteral | charString | dialectLiteral | utfLiteral | hexadecimalUtfLiteral dialectLiteral ::= dialectNodeFiller+ DOT_FS? utfLiteral ::= U_CHAR NONNUMERICLITERAL hexadecimalUtfLiteral ::= U_CHAR HEX_NUMBERS charString ::= FINALCHARSTRING arithmeticExpression ::= multDivs plusMinus* plusMinus ::= ( PLUSCHAR | MINUSCHAR ) multDivs multDivs ::= powers multDiv* multDiv ::= ( ASTERISKCHAR | SLASHCHAR ) powers powers ::= ( PLUSCHAR | MINUSCHAR )? basis power* power ::= DOUBLEASTERISKCHAR basis basis ::= dialectNodeFiller DOT_FS? | generalIdentifier | literal | LPARENCHAR arithmeticExpression RPARENCHAR cobolWord ::= IDENTIFIER | SYMBOL | INTEGER | ELEMENT | CHANNEL | PROCESS | REMOVE | WAIT | NAMESPACE_PREFIX | NAMESPACE | ATTRIBUTES | ATTRIBUTE | ANY | LIST | NAME | THREAD | U_CHAR | TYPE | allowedCobolKeywords allowedCobolKeywords ::= CR | FIELD | MMDDYYYY | PRINTER | DAY_OF_WEEK | REMARKS | RESUME | TIMER | TODAYS_DATE | TODAYS_NAME | YEAR | YYYYDDD | YYYYMMDD | WHEN_COMPILED | DISK | KEYBOARD | PORT | READER | REMOTE | VIRTUAL | LIBRARY | DEFINITION | PARSE | BOOL | ESCAPE | INITIALIZED | LOC | BYTITLE | BYFUNCTION | ABORT | ORDERLY | ASSOCIATED_DATA | ASSOCIATED_DATA_LENGTH | VOLATILE dialectNodeFiller ::= ZERO_WIDTH_SPACE+ DOT_FS? EOF? dot_fs ::= DOT_FS? <?TOKENS?> EOF ::= $
Hello! Thank you for a suggestion. There are no plans to use diagrams now.
Using the tools at https://github.com/GuntherRademacher/ebnf-convert and https://github.com/GuntherRademacher/rr it's possible to generate an EBNF understood by https://github.com/GuntherRademacher/rr to generate a nice navigable railroad diagram (see bellow) from https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/blob/development/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/CobolParser.g4 .