# GnuCOBOL compiler - list of reserved words
#
# Copyright (C) 2016-2017,2021-2023 Free Software Foundation, Inc.
# Written by Simon Sobisch, Edward Hart, 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/>.

# Word list for dialect: GCOS 7 (Bull)

# NOTE: the mapping for COMP* usages does not exactly match the GCOS
# specification, due to the former missing some of the representations
# required.  The mapping below associates each COMP* with the closest
# representation currently available.
#
# In addition, the mapping for COMP-9 (32bit floating-point), COMP-10
# (64bit floating-point), and COMP-15 (128bit floating-point) may not
# use the correct representations (which should be FLOAT_BINARY_*) as
# at the moment their support is limited in cobc.


# Reserved word list based on https://support.bull.com/ols/product/system/
# gcos7/gcos7-com/g7-dps7000/doc-com/docf/g/47X257TN23-mar2005/doc/05ula04.pdf

reserved:	ACCEPT
reserved:	ACCESS
reserved:	ACTUAL
#reserved:	AD			# SBS only
reserved:	ADD
reserved:	ADDRESS
reserved:	ADVANCING
reserved:	AFTER
reserved:	ALIAS
reserved:	ALL
reserved:	ALPHABET
reserved:	ALPHABETIC
reserved:	ALPHABETIC-LOWER
reserved:	ALPHABETIC-UPPER
reserved:	ALPHANUMERIC
reserved:	ALPHANUMERIC-EDITED
reserved:	ALSO
reserved:	ALTER
reserved:	ALTERING
reserved:	ALTERNATE
reserved:	AND
reserved:	ANSI
reserved:	ANY
reserved:	APPLY			# not supported yet
reserved:	ARE
reserved:	AREA
reserved:	AREAS
#reserved:	ARITHMETIC		# JOD only
reserved:	ASA
reserved:	ASCENDING
reserved:	ASCII*
reserved:	ASSIGN
reserved:	AT
reserved:	AUTHOR
reserved:	B-AND
reserved:	B-EXOR			# not supported yet
#reserved:	B-LESS			# JOD only
reserved:	B-NOT
reserved:	B-OR
reserved:	BECOMES			# not supported yet
reserved:	BEFORE
reserved:	BEGINNING		# not supported yet
reserved:	BINARY
reserved:	BIT
reserved:	BITS			# not supported yet
reserved:	BLANK
reserved:	BLOCK
reserved:	BOOLEAN
reserved:	BOTTOM
reserved:	BSN 			# not supported yet
reserved:	BY
reserved:	CALL
reserved:	CANCEL
reserved:	CATALOGUE-NAME	# not supported yet
reserved:	CATALOGUED		# not supported yet
reserved:	CD
reserved:	CF
reserved:	CH
reserved:	CHARACTER
reserved:	CHARACTERS
reserved:	CHECK			# not supported yet
reserved:	CHECKPOINT-FILE	# not supported yet
reserved:	CLASS
reserved:	CLOCK-UNITS		# not supported yet
reserved:	CLOSE
reserved:	COBOL
reserved:	CODE
reserved:	CODE-SET
reserved:	COLLATING
reserved:	COLUMN
reserved:	COMMA
#reserved:	COMMIT			# JOD only
reserved:	COMMON
reserved:	COMMUNICATION
reserved:	COMP=COMP-3
reserved:	COMP-1=BINARY-SHORT
reserved:	COMP-2=BINARY-LONG
reserved:	COMP-3
reserved:	COMP-4					# CHECKME: Does GCs COMP-4 match?
reserved:	COMP-5=PACKED-DECIMAL	# CHECKME: How to use "native integer" then?
reserved:	COMP-6					# CHECKME: GCs COMP-6 likely does not match.
reserved:	COMP-7				# not supported yet
reserved:	COMP-8=PACKED-DECIMAL
reserved:	COMP-9=FLOAT		# single precision
reserved:	COMP-10=FLOAT-LONG		# double precision
reserved:	COMP-11				# not supported yet
reserved:	COMP-12				# not supported yet
reserved:	COMP-13				# not supported yet
reserved:	COMP-14				# not supported yet
reserved:	COMP-15=FLOAT-EXTENDED	# quadruple precision
reserved:	COMPLE #=COMPLEMENTARY	# not supported yet
reserved:	COMPLEMENTARY			# not supported yet
reserved:	COMPUTATIONAL=COMP-3
reserved:	COMPUTATIONAL-1=BINARY-SHORT
reserved:	COMPUTATIONAL-2=BINARY-LONG
reserved:	COMPUTATIONAL-3=COMP-3
reserved:	COMPUTATIONAL-4=COMP-4		# CHECKME
reserved:	COMPUTATIONAL-5=PACKED-DECIMAL
reserved:	COMPUTATIONAL-6=COMP-6		# CHECKME
reserved:	COMPUTATIONAL-7  #=COMP-7 	# not supported yet
reserved:	COMPUTATIONAL-8=PACKED-DECIMAL
reserved:	COMPUTATIONAL-9=FLOAT
reserved:	COMPUTATIONAL-10=FLOAT-LONG
reserved:	COMPUTATIONAL-11 #=COMP-11	# not supported yet
reserved:	COMPUTATIONAL-12 #=COMP-12	# not supported yet
reserved:	COMPUTATIONAL-13 #=COMP-13	# not supported yet
reserved:	COMPUTATIONAL-14 #=COMP-14	# not supported yet
reserved:	COMPUTATIONAL-15=FLOAT-EXTENDED #=COMP-15
reserved:	COMPUTE
reserved:	CONFIGURATION
reserved:	CONNECT*
reserved:	CONSTANT		# COBOL 2002 != GCOS (unsupported)
reserved:	CONTAINS
reserved:	CONTENT
reserved:	CONTINUE
reserved:	CONTROL
reserved:	CONTROLS
reserved:	CONVERSION
reserved:	CONVERTING
reserved:	COPY
reserved:	CORR=CORRESPONDING
reserved:	CORRESPONDING
reserved:	COUNT
reserved:	CS-BASIC
reserved:	CS-GENERAL
reserved:	CURRENCY
reserved:	CURRENT*
reserved:	DATA
reserved:	DATE
reserved:	DATE-COMPILED
reserved:	DATE-WRITTEN
reserved:	DAY
reserved:	DAY-OF-WEEK
reserved:	DE
# note: the following are part of the register DEBUG-ITEM,
#       they are automatically unreserved if the register is
#       created, which happens on USE FOR DEBUGGING
reserved:	DEBUG-CONTENTS
reserved:	DEBUG-ITEM
reserved:	DEBUG-LINE
reserved:	DEBUG-NAME
reserved:	DEBUG-SUB-1
reserved:	DEBUG-SUB-2
reserved:	DEBUG-SUB-3
# debug-item end
reserved:	DEBUGGING
reserved:	DECIMAL-POINT
reserved:	DECLARATIVES
reserved:	DEFAULT			# COBOL 2002 != GCOS (unsupported)
reserved:	DELETE
reserved:	DELIMITED
reserved:	DELIMITER
reserved:	DEPENDING
reserved:	DESCENDING
reserved:	DESTINATION
reserved:	DETAIL
reserved:	DISABLE
reserved:	DISCONNECT*
reserved:	DISPLAY
reserved:	DISPLAY-1		# not supported
reserved:	DISPLAY-2		# not supported
reserved:	DISPLAY-3		# not supported
reserved:	DISPLAY-4		# not supported
reserved:	DIVIDE
reserved:	DIVISION
reserved:	DOWN
reserved:	DUPLICATES
reserved:	DYNAMIC
reserved:	EBCDIC*
reserved:	EGI
reserved:	ELSE
reserved:	EMI
reserved:	ENABLE
reserved:	END
reserved:	END-ADD
reserved:	END-CALL
reserved:	END-COMPUTE
reserved:	END-DELETE
reserved:	END-DIVIDE
reserved:	END-EVALUATE
reserved:	END-IF
reserved:	END-MULTIPLY
reserved:	END-OF-PAGE
reserved:	END-PERFORM
reserved:	END-READ
reserved:	END-RECEIVE
reserved:	END-RETURN
reserved:	END-REWRITE
reserved:	END-SEARCH
reserved:	END-START
reserved:	END-STRING
reserved:	END-SUBTRACT
reserved:	END-UNSTRING
reserved:	END-WRITE
reserved:	ENDING
reserved:	ENTER
reserved:	ENVIRONMENT
reserved:	EOP
reserved:	EQUAL
reserved:	EQUALS=EQUAL
reserved:	ERASE*
reserved:	ERROR
reserved:	ESCAPE
reserved:	ESI
reserved:	EVALUATE
reserved:	EVERY
reserved:	EXAMINE
reserved:	EXCEEDS=GREATER
reserved:	EXCEPTION
reserved:	EXCLUSIVE*
reserved:	EXIT
reserved:	EXTEND
reserved:	EXTERNAL
reserved:	FALSE
reserved:	FD
reserved:	FILE
reserved:	FILE-CONTROL
reserved:	FILE-ID
reserved:	FILES
reserved:	FILLER
reserved:	FINAL
reserved:	FIRST
reserved:	FLR
reserved:	FOOTING
reserved:	FOR
reserved:	FROM
reserved:	FUNCTION
reserved:	GCOS*
reserved:	GENERATE
reserved:	GIVING
reserved:	GLOBAL
reserved:	GO
reserved:	GREATER
reserved:	GROUP
reserved:	HEADING
reserved:	HIGH-VALUE
reserved:	HIGH-VALUES=HIGH-VALUE
reserved:	I-O
reserved:	I-O-CONTROL
reserved:	IDENTIFICATION
reserved:	IDS-II
reserved:	IF
reserved:	IN
reserved:	INDEX
reserved:	INDEX-1
reserved:	INDEX-2
reserved:	INDEXED
reserved:	INDICATE
reserved:	INITIAL
reserved:	INITIALIZE
reserved:	INITIATE
reserved:	INPUT
reserved:	INPUT-OUTPUT
reserved:	INSPECT
reserved:	INSTALLATION
reserved:	INTO
reserved:	INVALID
reserved:	INVOKING
reserved:	IS
reserved:	JUST=JUSTIFIED
reserved:	JUSTIFIED
reserved:	KEY
reserved:	KEY-LOCATION
reserved:	KEYED
reserved:	LABEL
reserved:	LAST
reserved:	LEADING
reserved:	LEFT
reserved:	LENGTH
reserved:	LESS
reserved:	LIMIT
reserved:	LIMITS
reserved:	LINAGE
reserved:	LINAGE-COUNTER
reserved:	LINE
reserved:	LINE-COUNTER
reserved:	LINES
reserved:	LINES-PER-PAGE
reserved:	LINKAGE
reserved:	LOCK
reserved:	LOCKS
reserved:	LOW-VALUE
reserved:	LOW-VALUES=LOW-VALUE
reserved:	MEMORY
reserved:	MERGE
reserved:	MESSAGE
reserved:	MODE
reserved:	MODULES
reserved:	MOVE
reserved:	MULTIPLE*
reserved:	MULTIPLY
reserved:	NATIVE
reserved:	NEGATIVE
reserved:	NEXT
reserved:	NO
reserved:	NOT
reserved:	NULL
reserved:	NUMBER
reserved:	NUMERIC
reserved:	NUMERIC-EDITED
reserved:	OBJECT			# COBOL 2002 != GCOS (unsupported)
reserved:	OBJECT-COMPUTER
reserved:	OBJECT-PROGRAM
reserved:	OCCURS
reserved:	OF
reserved:	OFF
reserved:	OMITTED
reserved:	ON
reserved:	OPEN
reserved:	OPERATIONAL
reserved:	OPTIONAL
reserved:	OR
reserved:	ORDER
reserved:	ORGANIZATION
reserved:	OTHER
reserved:	OUTPUT
reserved:	OVERFLOW
reserved:	OVERRIDING*
reserved:	PACKED-DECIMAL
reserved:	PADDING
reserved:	PAGE
reserved:	PAGE-COUNTER
reserved:	PERFORM
reserved:	PF
reserved:	PH
reserved:	PIC=PICTURE
reserved:	PICTURE
reserved:	PLUS
reserved:	POINTER
reserved:	POSITION
reserved:	POSITIVE
reserved:	PREVIOUS*
reserved:	PRIMARY
reserved:	PRINTING
reserved:	PROCEDURE
reserved:	PROCEDURES
reserved:	PROCEED
reserved:	PROCESS-AREA
reserved:	PROGRAM
reserved:	PROGRAM-ID
reserved:	PURGE
reserved:	QUEUE
reserved:	QUEUED*
reserved:	QUOTE
reserved:	QUOTES=QUOTE
reserved:	RANDOM
reserved:	RD
reserved:	READ
reserved:	RECEIVE
reserved:	RECORD
reserved:	RECORDS
reserved:	REDEFINES
reserved:	REEL
reserved:	REFERENCE
reserved:	REFERENCES
reserved:	RELATIVE
reserved:	RELEASE
reserved:	REMAINDER
reserved:	REMOVAL
reserved:	RENAMES
reserved:	REPLACE
reserved:	REPLACING
reserved:	REPORT
reserved:	REPORTING
reserved:	REPORTS
reserved:	RERUN
reserved:	RESERVE
reserved:	RESET
reserved:	RETENTION
reserved:	RETURN
reserved:	REVERSED
reserved:	REWIND
reserved:	REWRITE
reserved:	RF
reserved:	RH
reserved:	RIGHT
reserved:	ROLLBACK*
reserved:	ROUNDED
reserved:	RUN
reserved:	SAME
reserved:	SARF
reserved:	SD
reserved:	SEARCH
reserved:	SECONDARY
reserved:	SECTION
reserved:	SECURITY
reserved:	SEGMENT
reserved:	SEGMENT-LIMIT
reserved:	SELECT
reserved:	SELECTION
reserved:	SEND
reserved:	SENTENCE
reserved:	SEPARATE
reserved:	SEQUENCE
reserved:	SEQUENTIAL
reserved:	SET
reserved:	SIGN
reserved:	SIZE
reserved:	SORT
reserved:	SORT-MERGE
reserved:	SOURCE
reserved:	SOURCE-COMPUTER
reserved:	SPACE
reserved:	SPACES=SPACE
reserved:	SPECIAL-NAMES
reserved:	SSF
reserved:	STANDARD
reserved:	STANDARD-1
reserved:	STANDARD-2
reserved:	START
reserved:	STATION
reserved:	STATUS
reserved:	STOP
reserved:	STRING
reserved:	SUB-QUEUE-1
reserved:	SUB-QUEUE-2
reserved:	SUB-QUEUE-3
reserved:	SUB-SCHEMA
reserved:	SUBTRACT
reserved:	SUM
reserved:	SUPPRESS
reserved:	SYMBOLIC
reserved:	SYNC=SYNCHRONIZED
reserved:	SYNCHRONIZED
reserved:	SYSTEM
reserved:	TABLE
reserved:	TALLYING
reserved:	TAPE
#reserved:	TERMINAL	# standard system-name in GnuCOBOL
reserved:	TERMINATE
reserved:	TEST
reserved:	TEXT
reserved:	THAN
reserved:	THEN
reserved:	THROUGH=THRU
reserved:	THRU
reserved:	TIME
reserved:	TIMES
reserved:	TITLE
reserved:	TO
reserved:	TOP
reserved:	TRAILING
reserved:	TRANSFORM
reserved:	TRUE
reserved:	TYPE
reserved:	UNSEQUAL
reserved:	UNIT
reserved:	UNSTRING
reserved:	UNTIL
reserved:	UP
reserved:	UPON
reserved:	USAGE
reserved:	USE
reserved:	USING
reserved:	VALUE
reserved:	VALUES
reserved:	VARYING
reserved:	VIA
reserved:	VIRTUAL
reserved:	VLR
reserved:	WHEN
reserved:	WITH
reserved:	WORDS
reserved:	WORKING-STORAGE
reserved:	WRITE
reserved:	ZERO
reserved:	ZEROES=ZERO
reserved:	ZEROS=ZERO


# Internal registers

not-register:	DIALECT-ALL
register:	"ADDRESS\ OF"
register:	DEBUG-ITEM
register:	TALLY
# list of (non-standard) system names:
# TODO: deactivate all, only activate what is supported
#not-system-name:	DIALECT-ALL-SWITCHES
#system-name:	CONSOLE
#system-name:	ALTERNATE-CONSOLE
#system-name:	SYSIN
#system-name:	SYSOUT
#...
#
# unsupported - handle as reserved for better error handling

reserved:	CONSOLE-0
reserved:	CONSOLE-1
reserved:	CONSOLE-2
reserved:	CONSOLE-3
reserved:	SYSIN-X
reserved:	SYSIN-0
reserved:	SYSIN-1
reserved:	SYSIN-2
reserved:	SYSIN-3
reserved:	SYSOUT-X
reserved:	SYSOUT-0
reserved:	SYSOUT-1
reserved:	SYSOUT-2
reserved:	SYSOUT-3
reserved:	TEMP
reserved:	TERMINAL-X
reserved:	TERMINAL-0
reserved:	TERMINAL-1
reserved:	TERMINAL-2
reserved:	TERMINAL-3
reserved:	UFF


# Intrinsics functions

not-intrinsic-function:	DIALECT-ALL
intrinsic-function:	ACOS
intrinsic-function:	ANNUITY
intrinsic-function:	ASIN
intrinsic-function:	ATAN
intrinsic-function:	CHAR
intrinsic-function:	COS
intrinsic-function:	CURRENT-DATE
intrinsic-function:	DATE-OF-INTEGER
intrinsic-function:	DAY-OF-INTEGER
intrinsic-function:	FACTORIAL
intrinsic-function:	INTEGER
intrinsic-function:	INTEGER-OF-DATE
intrinsic-function:	INTEGER-OF-DAY
intrinsic-function:	INTEGER-PART
intrinsic-function:	LENGTH
intrinsic-function:	LOG
intrinsic-function:	LOG10
intrinsic-function:	LOWER-CASE
intrinsic-function:	MAX
intrinsic-function:	MEAN
intrinsic-function:	MEDIAN
intrinsic-function:	MIDRANGE
intrinsic-function:	MIN
intrinsic-function:	MOD
intrinsic-function:	NUMVAL
intrinsic-function:	NUMVAL-C
intrinsic-function:	ORD
intrinsic-function:	ORD-MAX
intrinsic-function:	ORD-MIN
intrinsic-function:	PRESENT-VALUE
intrinsic-function:	RANDOM
intrinsic-function:	RANGE
intrinsic-function:	REM
intrinsic-function:	REVERSE
intrinsic-function:	SIN
intrinsic-function:	SQRT
intrinsic-function:	STANDARD-DEVIATION
intrinsic-function:	SUM
intrinsic-function:	TAN
intrinsic-function:	UPPER-CASE
intrinsic-function:	VARIANCE
intrinsic-function:	WHEN-COMPILED
