Skip to main content

module lang::cobol85::\syntax::DataDivision

rascal-0.43.3
org.rascalmpl.cobol-air-0.1.2

The DATA DIVISION and its sections: FILE, WORKING-STORAGE, LINKAGE and COMMUNICATION.

Usage​

import lang::cobol85::\syntax::DataDivision;

Dependencies​

extend lang::cobol85::\syntax::FileDescriptionEntry;
extend lang::cobol85::\syntax::DataDescriptionEntry;
extend lang::cobol85::\syntax::CommunicationSection;

Description​

This module composes the data division from the file, working-storage, linkage and communication sections, which may come in any order; a checker rejects the orders COBOL does not allow. The FILE SECTION contains FD and SD entries, each followed by its record descriptions, and the clauses of an FD may also come from a copybook. The other sections contain data description entries from the DataDescriptionEntry module, and the communication section its CD entries. The REPORT SECTION is added to this division by the ReportSection module.

syntax DataDivision​

syntax DataDivision = dataDivision: 'DATA' 'DIVISION' "." DataSection*;

syntax DataSection​

syntax DataSection
= file: 'FILE' 'SECTION' "." FileSectionEntry*
| workingStorage: 'WORKING-STORAGE' 'SECTION' "." DataDescriptionEntry*
| linkage: 'LINKAGE' 'SECTION' "." DataDescriptionEntry*
| communication: CommunicationSection
;

syntax FileSectionEntry​

syntax FileSectionEntry
= fd: AltFdSd Id FileAndSortDescriptionEntryClause* "." DataDescriptionEntry+
| fdCopied: AltFdSd Id CopyStatement DataDescriptionEntry*
// the clauses come from a copybook
;

syntax CobwordKeywords​

keyword CobwordKeywords
= 'DATA'
| 'DIVISION'
| 'FILE'
| 'LINKAGE'
| 'SECTION'
| 'WORKING-STORAGE'
;