module lang::cobol85::\syntax::FileDescriptionEntry
rascal-0.43.3
org.rascalmpl.cobol-air-0.1.2
FD and SD entries: the clauses that describe files and sort files in the FILE SECTION.
Usage
import lang::cobol85::\syntax::FileDescriptionEntry;
Dependencies
extend lang::cobol85::\syntax::DataDescriptionEntry;
extend lang::cobol85::\syntax::ConfigurationSection;
extend lang::cobol85::\syntax::Lexical;
extend lang::cobol85::\syntax::Expression;
Description
This module defines the clauses of file description (FD) and sort-merge description (SD) entries: BLOCK CONTAINS, RECORD CONTAINS and RECORD VARYING, LABEL RECORDS, VALUE OF, DATA RECORDS, LINAGE with its FOOTING, TOP and BOTTOM phrases, CODE-SET, RECORDING MODE, EXTERNAL and GLOBAL. The clauses and the phrases of LINAGE may come in any order, and a checker rejects the combinations COBOL does not allow, for example clauses that are only valid for an FD. The REPORT clause of an FD is added by the ReportSection module.
syntax FileAndSortDescriptionEntryClause
syntax FileAndSortDescriptionEntryClause
= standard: 'LABEL' Records Are? 'STANDARD'
| omitted: 'LABEL' Records Are? 'OMITTED'
| label: 'LABEL' Records Are? Id+
| block: 'BLOCK' 'CONTAINS'? Integer ('TO' Integer)? AltCharactersRecords?
| linage: 'LINAGE' 'IS'? AltDataNameInteger 'LINES'? LinagePhrase*
| recording: 'RECORDING' 'MODE'? 'IS'? Id
| globalClause: GlobalClause
| record: 'RECORD' 'CONTAINS'? Integer ('TO' Integer)? 'CHARACTERS'?
// not ('FROM'? Integer)?: rascal 0.43.1-RC1 mishandles some sequence groups, see EnvironmentDivision.rsc
| varying: 'RECORD' 'IS'? 'VARYING' 'IN'? 'SIZE'? 'FROM'? Integer? ('TO' Integer)? 'CHARACTERS'? ('DEPENDING' 'ON'? Id)?
| \data: 'DATA' Records Are? Id+
| \value: 'VALUE' 'OF' ValueOfPhrase+
| codeSet: 'CODE-SET' 'IS'? Id
| externalClause: ExternalClause
;
syntax AltCharactersRecords
syntax AltCharactersRecords
= characters: 'CHARACTERS'
| records: 'RECORDS'
| record: 'RECORD'
;
syntax LinagePhrase
syntax LinagePhrase
= footing: 'WITH'? 'FOOTING' 'AT'? AltDataNameInteger 'LINES'?
| top: 'AT'? 'TOP' AltDataNameInteger 'LINES'?
| bottom: 'AT'? 'BOTTOM' AltDataNameInteger 'LINES'?
;
syntax AltDataNameInteger
syntax AltDataNameInteger
= dataName: Id
| integer: Integer
;
syntax ValueOfPhrase
syntax ValueOfPhrase = systemName: Id 'IS'? AltQualifiedDataNameLiteral;
syntax AltQualifiedDataNameLiteral
syntax AltQualifiedDataNameLiteral
= literal: Literal
| qualifiedDataName: QualifiedDataName
;
syntax AltFdSd
syntax AltFdSd
= fd: 'FD'
| sd: 'SD'
;
syntax CobwordKeywords
keyword CobwordKeywords
= 'AT'
| 'BLOCK'
| 'BOTTOM'
| 'CHARACTERS'
| 'CODE-SET'
| 'CONTAINS'
| 'DATA'
| 'DEPENDING'
| 'FD'
| 'FOOTING'
| 'FROM'
| 'IN'
| 'IS'
| 'LABEL'
| 'LINAGE'
| 'LINES'
| 'MODE'
| 'OF'
| 'OMITTED'
| 'ON'
| 'RECORD'
| 'RECORDING'
| 'RECORDS'
| 'SD'
| 'SIZE'
| 'STANDARD'
| 'TO'
| 'TOP'
| 'VALUE'
| 'VARYING'
| 'WITH'
;