Skip to main content

module lang::cobol85::\syntax::CommunicationSection

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

The COMMUNICATION SECTION: CD entries for message input and output.

Usage​

import lang::cobol85::\syntax::CommunicationSection;

Dependencies​

extend lang::cobol85::\syntax::Expression;
extend lang::cobol85::\syntax::DataDescriptionEntry;

Description​

This module defines the communication description (CD) entries of the COMMUNICATION SECTION, for programs that exchange messages with a message control system. A CD entry is FOR INPUT, FOR INITIAL INPUT or FOR OUTPUT, and names the data items of its communication area: for input the symbolic queue and sub-queues, message date and time, source, text length, end key, status key and message count, and for output the destination count, text length, status key, destination table and error key. The input form can also list its eleven data names by position, without the clause keywords. Record descriptions may follow each CD entry. The statements that use these areas, such as SEND, RECEIVE, ENABLE and DISABLE, are in the Statement module.

syntax CommunicationSection​

syntax CommunicationSection = communicationSection: 'COMMUNICATION' 'SECTION' "." CommunicationDescriptionEntry+;

syntax CommunicationDescriptionEntry​

syntax CommunicationDescriptionEntry
= cd: 'CD' Id CommunicationDirection CommunicationDescriptionClause* "." DataDescriptionEntry*
// the input form can also list its eleven data names by position, without the clause keywords
| cdInput: 'CD' Id CommunicationInput AltDataNameFiller+ "." DataDescriptionEntry*
;

syntax CommunicationDirection​

syntax CommunicationDirection
= initialInput: 'FOR'? 'INITIAL' 'INPUT'
| input: 'FOR'? 'INPUT'
| output: 'FOR'? 'OUTPUT'
;

syntax CommunicationDescriptionClause​

syntax CommunicationDescriptionClause
// input clauses
= queue: 'SYMBOLIC'? 'QUEUE' 'IS'? Id
| subQueue1: 'SYMBOLIC'? 'SUB-QUEUE-1' 'IS'? Id
| subQueue2: 'SYMBOLIC'? 'SUB-QUEUE-2' 'IS'? Id
| subQueue3: 'SYMBOLIC'? 'SUB-QUEUE-3' 'IS'? Id
| date: 'MESSAGE'? 'DATE' 'IS'? Id
| time: 'MESSAGE'? 'TIME' 'IS'? Id
| source: 'SYMBOLIC'? 'SOURCE' 'IS'? Id
| text: 'TEXT' 'LENGTH' 'IS'? Id
| end: 'END' 'KEY' 'IS'? Id
| status: 'STATUS' 'KEY' 'IS'? Id
| count: 'MESSAGE'? 'COUNT' 'IS'? Id
// output clauses
| destinationCount: 'DESTINATION' 'COUNT' 'IS'? Id
| destinationTable: 'DESTINATION' 'TABLE' 'OCCURS' Integer 'TIMES' IndexedBy?
| error: 'ERROR' 'KEY' 'IS'? Id
| destination: 'SYMBOLIC'? 'DESTINATION' 'IS'? Id
;

syntax CommunicationInput​

syntax CommunicationInput
= initialInput: 'FOR'? 'INITIAL' 'INPUT'
| input: 'FOR'? 'INPUT'
;

syntax CobwordKeywords​

keyword CobwordKeywords
= 'CD'
| 'COMMUNICATION'
| 'COUNT'
| 'DATE'
| 'END'
| 'ERROR'
| 'FOR'
| 'INITIAL'
| 'INPUT'
| 'IS'
| 'KEY'
| 'LENGTH'
| 'MESSAGE'
| 'OCCURS'
| 'OUTPUT'
| 'QUEUE'
| 'SECTION'
| 'SOURCE'
| 'STATUS'
| 'SUB-QUEUE-1'
| 'SUB-QUEUE-2'
| 'SUB-QUEUE-3'
| 'SYMBOLIC'
| 'TEXT'
| 'TIME'
| 'TIMES'
;