# GnuCOBOL compiler configuration
#
# Copyright (C) 2001-2012, 2014-2021, 2023 Free Software Foundation, Inc.
# Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart,
# Ron Norman, David Declerck, Fabrice Le Fessant, Nicolas Berthier
#
# This file is part of GnuCOBOL.
#
# The GnuCOBOL compiler is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# GnuCOBOL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GnuCOBOL.  If not, see <https://www.gnu.org/licenses/>.

name: "GCOS"

# Value: enum (see default.conf and cobc/cobc.h for details)
standard-define			7 # Builds on COBOL-85

# Default source reference-format (see default.conf for details)
format:				cobol85

tab-width:			8
text-column:			72
word-length:			30
literal-length:			256
numeric-literal-length:		30
pic-length:			30

# Enable AREACHECK by default, for reference formats other than {fixed,free}
areacheck:			yes

assign-clause:			external

# If yes, file names are resolved at run time using
# environment variables.
# For example, given ASSIGN TO "DATAFILE", the file name will be
#  1. the value of environment variable 'DD_DATAFILE' or
#  2. the value of environment variable 'dd_DATAFILE' or
#  3. the value of environment variable 'DATAFILE' or
#  4. the literal "DATAFILE"
# If no, the value of the assign clause is the file name.
#
filename-mapping:		yes

# Alternate formatting of numeric fields
pretty-display:			no

# Allow complex OCCURS DEPENDING ON
complex-odo:			no

# Adjust position of items following OCCURS DEPENDING
odoslide:			no

# Allow REDEFINES to other than last equal level number
indirect-redefines:		no

# Binary byte size - defines the allocated bytes according to PIC
# Value:         signed  unsigned  bytes
#                ------  --------  -----
# '2-4-8'        1 -  4    same        2
#                5 -  9    same        4
#               10 - 18    same        8
#
# '1-2-4-8'      1 -  2    same        1
#                3 -  4    same        2
#                5 -  9    same        4
#               10 - 18    same        8
#
# '1--8'         1 -  2    1 -  2      1
#                3 -  4    3 -  4      2
#                5 -  6    5 -  7      3
#                7 -  9    8 -  9      4
#               10 - 11   10 - 12      5
#               12 - 14   13 - 14      6
#               15 - 16   15 - 16      7
#               17 - 18   17 - 18      8
#
# NOTE: binary size is different in GCOS (neither 2-4-8, 1-2-4-8, nor
# 1--8). It's close to 2-4-8, but with 48-bits only for integers
# between 10 and 14 digits (that would be 2-4-6-8 ?). We use 2-4-8 for
# now.
#
binary-size:			2-4-8

# Numeric truncation according to ANSI
binary-truncate:		yes

# Binary byte order
# Value: 'native', 'big-endian'
binary-byteorder:		big-endian

# Allow larger REDEFINES items
larger-redefines:		error

# Allow certain syntax variations (eg. REDEFINES position)
relax-syntax-checks:		yes

# Allow zero length reference-modification
# (only checked with active EC-BOUND-REF-MOD)
ref-mod-zero-length:		no

# Perform type OSVS - If yes, the exit point of any currently
# executing perform is recognized if reached.
perform-osvs:			no

# Compute intermediate decimal results like IBM OSVS
arithmetic-osvs:		no

# MOVE like IBM (mvc); left to right, byte by byte
move-ibm:			no

# SELECT RELATIVE KEY and ASSIGN fields must be in WORKING-STORAGE
select-working:			no

# LOCAL-STORAGE SECTION implies RECURSIVE attribute
local-implies-recursive:	no

# If yes, LINKAGE SECTION items remain allocated
# between invocations.
sticky-linkage:			no

# If yes, allow non-matching level numbers
relax-level-hierarchy:		no

# If yes, evaluate constant expressions at compile time
constant-folding:		yes

# Allow Hex 'F' for NUMERIC test of signed PACKED DECIMAL field
hostsign:			no

# If yes, set WITH UPDATE clause as default for ACCEPT dest-item,
# except if WITH NO UPDATE clause is used
accept-update:			no

# If yes, set WITH AUTO clause as default for ACCEPT dest-item,
# except if WITH TAB clause is used
accept-auto:			no

# If yes, DISPLAYs and ACCEPTs are, by default, done on the CRT (i.e., using
# curses).
console-is-crt:			no

# If yes, allow redefinition of the current program's name. This prevents its
# use in a prototype-format CALL/CANCEL statement.
program-name-redefinition:	yes

# If yes, NO ECHO/NO-ECHO/OFF is the same as SECURE (hiding input with
# asterisks, not spaces).
no-echo-means-secure:		no

# If yes, the first item in a field screen ACCEPT/DISPLAY (e.g. DISPLAY x UPON
# CRT) is located after the previous ACCEPT/DISPLAY (as though LINE 0 COL 0 had
# been specified).
line-col-zero-default:		no

# If yes, DISPLAY SPACES acts as ERASE EOS, DISPLAY X"01" acts as ERASE EOL,
# DISPLAY X"02" acts as BLANK SCREEEN and DISPLAY X"07" acts as BELL. Note
# DISPLAY LOW-VALUE is excluded from this; it will always just position the
# cursor.
display-special-fig-consts:	no

# If yes, COMP-1 is a signed 16-bit integer and any PICTURE clause is ignored.
binary-comp-1:			no

# If yes, POINTER is handled as BINARY-DOUBLE UNSIGNED instead of its own class
numeric-pointer:		no

# auto-adjust to zero like MicroFocus does
move-non-numeric-lit-to-numeric-is-zero: no

# If yes, implicitly define a variable for an ASSIGN DYNAMIC which does not
# match an existing data item.
implicit-assign-dynamic-var:	no

# If yes, ACCEPT and DISPLAY statements accept device names using mnemonics
device-mnemonics:		yes

# full clauses in XML PARSE - and adjusted XML-EVENTs
xml-parse-xmlss:		no # not supported at all

# What rules to apply to SCREEN SECTION items clauses
screen-section-rules:		std

# Whether DECIMAL-POINT IS COMMA has effect in XML/JSON GENERATE
dpc-in-data:			xml

# Bounds against which to check subscripts (full, max, record)
subscript-check:		max # not verified, may need "record"

# Functionality of JUSTIFY for INITIALIZE verb and initialization of storage
init-justify:		yes	# TODO: verify

# Dialect features
# Value: 'ok', 'warning', 'archaic', 'obsolete', 'skip', 'ignore', 'error',
#        'unconformable'

alter-statement:			obsolete
comment-paragraphs:			obsolete
control-division:			ok
partial-replace-when-literal-src:	skip # i.e, do not replace if results in spaces only
call-overflow:				archaic
data-records-clause:			obsolete
debugging-mode:				ok
use-for-debugging:			obsolete
listing-statements:			unconformable
title-statement:			unconformable
entry-statement:			unconformable
goto-statement-without-name:		obsolete
label-records-clause:			obsolete
memory-size-clause:			obsolete
symbolic-constant:			unconformable
move-noninteger-to-alphanumeric:	error
move-figurative-constant-to-numeric:	archaic
move-figurative-space-to-numeric:	error
move-figurative-quote-to-numeric:	ok
multiple-file-tape-clause:		obsolete
next-sentence-phrase:			archaic
odo-without-to:				unconformable
padding-character-clause:		ok
section-segments:			obsolete
stop-literal-statement:			obsolete
stop-identifier-statement:		unconformable
stop-error-statement:			ok
same-as-clause:				unconformable
type-to-clause:				unconformable
usage-type:				unconformable
synchronized-clause:			ok
sync-left-right:			ok
special-names-clause:			error
top-level-occurs-clause:		unconformable
value-of-clause:			obsolete
numeric-boolean:			ok
hexadecimal-boolean:			unconformable
national-literals:			unconformable
hexadecimal-national-literals:		unconformable
national-character-literals:		unconformable
acu-literals:				unconformable
hp-octal-literals:			unconformable
ebcdic-symbolic-characters:		yes
word-continuation:			archaic
not-exception-before-exception:		unconformable
accept-display-extensions:		unconformable
renames-uncommon-levels:		unconformable
constant-78:				unconformable
constant-01:				unconformable
perform-varying-without-by:		unconformable
reference-out-of-declaratives:		error
program-prototypes:			unconformable
call-convention-mnemonic:		unconformable
call-convention-linkage:		unconformable
using-optional:		unconformable
numeric-value-for-edited-item:		error
incorrect-conf-sec-order:		error
define-constant-directive:		error
free-redefines-position:		unconformable
records-mismatch-record-clause:		error
record-delimiter:			ok
sequential-delimiters:			ok
record-delim-with-fixed-recs:		unconformable
missing-statement:			error
missing-period:				error	# when format not in {fixed,free}
zero-length-literals:			unconformable
xml-generate-extra-phrases:		unconformable
continue-after:				unconformable
goto-entry:				unconformable
assign-variable:			unconformable
assign-using-variable:			unconformable
assign-ext-dyn:				unconformable
assign-disk-from:			unconformable
vsam-status:				unconformable
self-call-recursive:			skip
record-contains-depending-clause:	obsolete
defaultbyte:		0
picture-l:				ok

# use fixed word list, synonyms and exceptions specified there
reserved-words:		GCOS
