Skip to main content

module lang::cobol85::\syntax::ConfigurationSection

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

The CONFIGURATION SECTION: SOURCE-COMPUTER, OBJECT-COMPUTER and SPECIAL-NAMES.

Usage​

import lang::cobol85::\syntax::ConfigurationSection;

Dependencies​

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

Description​

This module defines the paragraphs of the configuration section in the environment division. SOURCE-COMPUTER and OBJECT-COMPUTER take their clauses, such as WITH DEBUGGING MODE, MEMORY SIZE, PROGRAM COLLATING SEQUENCE and SEGMENT-LIMIT, in any order. SPECIAL-NAMES relates implementor names to mnemonic names and switch status conditions, and defines alphabets, symbolic characters, class names, the currency sign and DECIMAL-POINT IS COMMA. Alphabet definitions list single characters, ranges and characters of the same collating position. Clause orders and combinations that COBOL does not allow are accepted here and left to a checker.

syntax SpecialNamesParagraphClause​

syntax SpecialNamesParagraphClause
= decimalPoint: 'DECIMAL-POINT' 'IS'? 'COMMA'
| class: 'CLASS' Id 'IS'? LiteralThroughLiteral+
| symbolic: 'SYMBOLIC' 'CHARACTERS'? SymbolicCharacterMapping+ ('IN' Id)?
| currency: 'CURRENCY' 'SIGN'? 'IS'? Literal
| alphabet: 'ALPHABET' Id 'IS'? AlphabetType
;

syntax SymbolicCharacterMapping​

syntax SymbolicCharacterMapping = symbolicCharacter: Id+ Are? Integer+;

syntax Are​

syntax Are
= \is: 'IS'
| are: 'ARE'
;

syntax AlphabetType​

syntax AlphabetType
= native: 'NATIVE'
| ebcdic: 'EBCDIC'
| standard2: 'STANDARD-2'
| standard1: 'STANDARD-1'
| alphabetTypeOther: AlphabetTypeOther+
;

syntax AlphabetTypeOther​

syntax AlphabetTypeOther
= also: {Literal 'ALSO'}+
| through: Literal Through Literal
;

syntax SpecialNamesParagraphPhrase​

syntax SpecialNamesParagraphPhrase
= systemName: Id 'IS'? Id SpecialNamesParagraphStatusPhrase?
| status: Id SpecialNamesParagraphStatusPhrase
;

syntax SpecialNamesParagraphStatusPhrase​

syntax SpecialNamesParagraphStatusPhrase
= \on: 'ON' 'STATUS'? 'IS'? Expression ('OFF' 'STATUS'? 'IS'? Expression)?
| \off: 'OFF' 'STATUS'? 'IS'? Expression ('ON' 'STATUS'? 'IS'? Expression)?
;

syntax ComputerClause​

syntax ComputerClause
= memory: 'MEMORY' 'SIZE'? Integer MemorySizeType
| sequence: 'PROGRAM'? 'COLLATING'? 'SEQUENCE' 'IS'? Id
| segmentLimit: 'SEGMENT-LIMIT' 'IS'? PriorityNumber
| debugging: 'WITH'? 'DEBUGGING' 'MODE'
;

syntax MemorySizeType​

syntax MemorySizeType
= characters: 'CHARACTERS'
| modules: 'MODULES'
| words: 'WORDS'
;

syntax CobwordKeywords​

keyword CobwordKeywords
= 'ALPHABET'
| 'ALSO'
| 'ARE'
| 'CHARACTERS'
| 'CLASS'
| 'COLLATING'
| 'COMMA'
| 'CURRENCY'
| 'DEBUGGING'
| 'DECIMAL-POINT'
| 'EBCDIC'
| 'IN'
| 'IS'
| 'MEMORY'
| 'MODE'
| 'MODULES'
| 'NATIVE'
| 'OFF'
| 'ON'
| 'PROGRAM'
| 'SEGMENT-LIMIT'
| 'SEQUENCE'
| 'SIGN'
| 'SIZE'
| 'STANDARD-1'
| 'STANDARD-2'
| 'STATUS'
| 'SYMBOLIC'
| 'WITH'
| 'WORDS'
;