# GnuCOBOL compiler configuration
#
# Copyright (C) 2001-2012, 2014-2023 Free Software Foundation, Inc.
# Written by Keisuke Nishida, Roger While, Simon Sobisch, Edward Hart,
# Ron Norman
#
# 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/>.


# Value: any string
name: "IBM COBOL"

# Value: enum (see default.conf and cobc/cobc.h for details)
standard-define			2

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

# Value: int
tab-width:			8
text-column:			72
word-length:			30
literal-length:			160
numeric-literal-length:	31  # for ARITH(EXTENDED), otherwise 18
pic-length:				50

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

# Default assign type
# Value: 'dynamic', 'external'
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:			yes

# Adjust position of items following OCCURS DEPENDING
odoslide:			yes

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

# 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
#
binary-size:			2-4-8

# Numeric truncation according to ANSI
binary-truncate:		no

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

# Allow larger REDEFINES items other than 01 non-external
larger-redefines:		error

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

# 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:			yes

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

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

# 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:			yes

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

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

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

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

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

# 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:		yes

# 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 # TODO: "record"

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

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

alter-statement:			obsolete
comment-paragraphs:			obsolete
control-division:			unconformable
partial-replace-when-literal-src:	unconformable
call-overflow:				ok
data-records-clause:			obsolete
debugging-mode:				ok
use-for-debugging:			obsolete
listing-statements:			ok
title-statement:			ok
entry-statement:			ok
goto-statement-without-name:		obsolete
label-records-clause:			obsolete
memory-size-clause:			obsolete
move-noninteger-to-alphanumeric:	error
symbolic-constant:			unconformable
move-figurative-constant-to-numeric:	error
move-figurative-space-to-numeric:	error
move-figurative-quote-to-numeric:	error
multiple-file-tape-clause:		obsolete
next-sentence-phrase:			archaic
odo-without-to:				ok
padding-character-clause:		obsolete
section-segments:			ignore
stop-literal-statement:			obsolete
stop-identifier-statement:		unconformable
stop-error-statement:			unconformable
same-as-clause:				unconformable
type-to-clause:				unconformable
usage-type:					unconformable
synchronized-clause:			ok
sync-left-right:			skip
special-names-clause:			error
top-level-occurs-clause:		unconformable
value-of-clause:			obsolete
numeric-boolean:			unconformable
hexadecimal-boolean:			unconformable
national-literals:			ok
hexadecimal-national-literals:		unconformable
national-character-literals:		unconformable
acu-literals:			unconformable
hp-octal-literals:			unconformable
ebcdic-symbolic-characters:		no
word-continuation:			ok
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  # not verified yet
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:		unconformable
free-redefines-position:		unconformable
records-mismatch-record-clause	ok	# IBM: "if not matching use the record size"
record-delimiter:			ignore
sequential-delimiters:			unconformable
record-delim-with-fixed-recs:		unconformable
missing-statement:			warning		# not verified yet
missing-period:				warning #when format not in {fixed,free}, not verified yet
zero-length-literals:			unconformable
xml-generate-extra-phrases:		ok
continue-after:				unconformable
goto-entry:				unconformable
assign-variable:			unconformable
assign-using-variable:			unconformable
assign-ext-dyn:				unconformable
assign-disk-from:			unconformable
vsam-status:				ok
self-call-recursive:		skip
record-contains-depending-clause:	unconformable
defaultbyte: 0
picture-l:				unconformable

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