- 1 Getting started
- 2 Compile
- 3 Customize
- 4 Optimize
- 5 Debug
- 6 Non-standard extensions
- 7 System Routines
- 附录 A
- 附录 B
- 附录 E
- 附录 I
A.4 Compiler dialect configuration options
- -freserved-words=value
use of complete/fixed reserved words
- -ftab-width=1..12
number of spaces that are assumed for tabs
- -ftext-column=72..255
right margin column number for fixed-form reference-format
- -fpic-length=number
maximum number of characters allowed in the
PICTURE
character-string- -fword-length=1..63
maximum word-length for COBOL (= programmer defined) words
- -fliteral-length=number
maximum literal size in general
- -fnumeric-literal-length=1..38
maximum numeric literal size
- -fdefaultbyte=value
default initialization for fields without
VALUE
, may be one of; character in quotes; decimal 0..255 representing a character; "init" to initialize toPICTURE
/USAGE
; "none" to do no explicit initialization; default: "init"- -fformat=value
default reference-format, may be one of:
FIXED
,FREE
, COBOL85,VARIABLE
,XOPEN
,XCARD
,CRT
,TERMINAL
, COBOLX- -fbinary-size=value
binary byte size - defines the allocated bytes according to
PIC
, may be one of: 2-4-8, 1-2-4-8, 1–8- -fbinary-byteorder=value
binary byte order, may be one of: native, big-endian
- -fassign-clause=value
how to interpret
ASSIGN word
, may be one of:: as
ASSIGN DYNAMIC wordASSIGN EXTERNAL word
ordynamic
,external
,ibm
(= external),mf
(= dynamic)- -fscreen-section-rules=value
which compiler’s rules to apply to
SCREEN
SECTION
item clauses, may be one of: acu, gc, mf, rm, std, xopen- -fdpc-in-data=value
whether
DECIMAL
-POINT
IS
COMMA
has effect inXML
/JSON
GENERATE
, may be one of: none, xml, json, all- -ffilename-mapping
resolve file names at run time using environment variables
- -fpretty-display
alternate formatting of numeric fields
- -fbinary-truncate
numeric truncation according to ANSI
- -fcomplex-odo
allow complex
OCCURS
DEPENDING
ON
- -fodoslide
adjust items following
OCCURS
DEPENDING
(implies complex-odo)- -findirect-redefines
allow
REDEFINES
to other than last equal level number- -frelax-syntax-checks
allow certain syntax variations (e.g.
REDEFINES
position)- -fref-mod-zero-length
allow zero length reference-modification (only changed with
EC
-BOUND
-REF
-MOD
active)- -frelax-level-hierarchy
allow non-matching level numbers
- -fselect-working
require
ASSIGN
USING
items to be inWORKING
-STORAGE
- -flocal-implies-recursive
LOCAL
-STORAGE
SECTION
impliesRECURSIVE
attribute- -fsticky-linkage
LINKAGE
SECTION
items remain allocated between invocations- -fmove-ibm
MOVE
operates as on IBM (left to right, byte by byte)- -fperform-osvs
exit point of any currently executing perform is recognized if reached
- -farithmetic-osvs
limit precision in intermediate results to precision of final result (less accurate)
- -fconstant-folding
evaluate constant expressions at compile time
- -fhostsign
allow hexadecimal value ‘F’ for
NUMERIC
test of signedPACKED
DECIMAL
field- -fprogram-name-redefinition
program names don’t lead to a reserved identifier
- -faccept-update
set
WITH
UPDATE
clause as default forACCEPT
dest-item, instead ofWITH
NO
UPDATE
- -faccept-auto
set
WITH
AUTO
clause as default forACCEPT
dest-item, instead ofWITH
TAB
- -fconsole-is-crt
assume
CONSOLE
IS
CRT
if not set otherwise- -fno-echo-means-secure
NO
-ECHO
hides input with asterisks likeSECURE
- -fline-col-zero-default
assume a field
DISPLAY
starts atLINE 0
COL 0
(i.e. at the cursor), notLINE 1
COL 1
- -fdisplay-special-fig-consts
special behaviour of
DISPLAY
SPACE
/ALL
X'01'
/ALL
X'02'
/ALL
X'07'
- -fbinary-comp-1
COMP
-1 is a 16-bit signed integer- -fnumeric-pointer
POINTER
is a 64-bit unsigned integer- -fmove-non-numeric-lit-to-numeric-is-zero
imply zero in move of non-numeric literal to numeric items
- -fimplicit-assign-dynamic-var
implicitly define a variable if an
ASSIGN
DYNAMIC
does not match any data item- -fdevice-mnemonics
specifying device by mnemonic
- -fxml-parse-xmlss
XML
PARSE
XMLSS
- -fareacheck
check contents of Area A (when reference format supports Area A enforcement), enabled checks include:; division, section, paragraph names, level indicators (
FD
,SD
,RD
, andCD
), and toplevel numbers (01 and 77) must start in Area A;; statements must not start in Area A; and; separator periods must not be within Area A.- -fcomment-paragraphs=support
comment paragraphs in
IDENTIFICATION
DIVISION
(AUTHOR
,DATE
-WRITTEN
, ...)- -fcontrol-division=support
CONTROL
DIVISION
- -fpartial-replacing-with-literal=support
partial replacing with literal
- -fmemory-size-clause=support
MEMORY
-SIZE
clause- -fmultiple-file-tape-clause=support
MULTIPLE
-FILE
-TAPE
clause- -flabel-records-clause=support
LABEL
-RECORDS
clause- -fvalue-of-clause=support
VALUE
-OF
clause- -fdata-records-clause=support
DATA
-RECORDS
clause- -ftop-level-occurs-clause=support
OCCURS
clause on top-level- -fsame-as-clause=support
SAME
AS
clause- -ftype-to-clause=support
TYPE
TO
clause- -fusage-type=support
USAGE
type-name- -fsynchronized-clause=support
SYNCHRONIZED
clause- -fsync-left-right=support
LEFT
/RIGHT
phrases inSYNCHRONIZED
clause- -fspecial-names-clause=support
SPECIAL
-NAMES
clause- -fgoto-statement-without-name=support
GOTO
statement without name- -fstop-literal-statement=support
STOP
-literal statement- -fstop-identifier-statement=support
STOP
-identifier statement- -fstop-error-statement=support
STOP
ERROR
statement- -fdebugging-mode=support
DEBUGGING
MODE
and debugging indicator- -fuse-for-debugging=support
USE
FOR
DEBUGGING
- -fpadding-character-clause=support
PADDING
CHARACTER
clause- -fnext-sentence-phrase=support
NEXT
SENTENCE
phrase- -flisting-statements=support
listing-directive statements
EJECT
,SKIP1
,SKIP2
,SKIP3
- -ftitle-statement=support
listing-directive statement
TITLE
- -fentry-statement=support
ENTRY
statement- -fmove-noninteger-to-alphanumeric=support
move noninteger to alphanumeric
- -fmove-figurative-constant-to-numeric=support
move figurative constants to numeric
- -fmove-figurative-space-to-numeric=support
move figurative constant
SPACE
to numeric- -fmove-figurative-quote-to-numeric=support
move figurative constant
QUOTE
to numeric- -fodo-without-to=support
OCCURS
DEPENDING
ON
without to- -fsection-segments=support
section segments
- -falter-statement=support
ALTER
statement- -fcall-overflow=support
OVERFLOW
clause forCALL
- -fnumeric-boolean=support
boolean literals (
B'1010'
)- -fhexadecimal-boolean=support
hexadecimal-boolean literals (
BX
‘A’)- -fnational-literals=support
national literals (
N'UTF
-16 string’)- -fhexadecimal-national-literals=support
hexadecimal-national literals (
NX'265E'
)- -fnational-character-literals=support
non-standard national literals (
NC'UTF
-16 string’)- -fhp-octal-literals=support
HP
COBOL octal literals (%377)- -facu-literals=support
ACUCOBOL-GT literals (
#B
#O
#H
#X
)- -fword-continuation=support
continuation of COBOL words
- -fnot-exception-before-exception=support
NOT
ON
EXCEPTION
beforeON
EXCEPTION
- -faccept-display-extensions=support
extensions to
ACCEPT
andDISPLAY
- -frenames-uncommon-levels=support
RENAMES
of 01-, 66- and 77-level items- -flarger-redefines=support
allow larger
REDEFINES
items- -fsymbolic-constant=support
constants defined in
SPECIAL
-NAMES
- -fconstant-78=support
constant with level 78 item (note: has left to right precedence in expressions)
- -fconstant-01=support
constant with level 01
CONSTANT
AS
/FROM
item- -fperform-varying-without-by=support
PERFORM
VARYING
withoutBY
phrase (impliesBY 1
)- -freference-out-of-declaratives=support
references to sections not in
DECLARATIVES
from withinDECLARATIVES
- -fprogram-prototypes=support
CALL
/CANCEL
with program-prototype-name- -fcall-convention-mnemonic=support
specifying call-convention by mnemonic
- -fcall-convention-linkage=support
specifying call-convention by
WITH
...LINKAGE
- -fnumeric-value-for-edited-item=support
numeric literals in
VALUE
clause of numeric-edited items- -fincorrect-conf-sec-order=support
incorrect order of
CONFIGURATION
SECTION
paragraphs- -fdefine-constant-directive=support
allow >>
DEFINE
CONSTANT
varAS
literal- -ffree-redefines-position=support
REDEFINES
clause not following entry-name in definition- -frecords-mismatch-record-clause=support
record sizes does not match
RECORD
clause- -frecord-delimiter=support
RECORD
DELIMITER
clause- -fsequential-delimiters=support
BINARY
-SEQUENTIAL
andLINE
-SEQUENTIAL
phrases inRECORD
DELIMITER
- -frecord-delim-with-fixed-recs=support
RECORD
DELIMITER
clause on file with fixed-length records- -fmissing-statement=support
missing statement (e.g. empty
IF
/PERFORM
)- -fmissing-period=support
missing period in
PROCEDURE
DIVISION
(when reference format supports Area A enforcement)- -fzero-length-literals=support
zero-length literals, e.g. ” and ""
- -fxml-generate-extra-phrases=support
XML
GENERATE'
s phrases other thanCOUNT
IN
- -fcontinue-after=support
AFTER
phrase inCONTINUE
statement- -fgoto-entry=support
ENTRY
FOR
GOTO
andGOTO
ENTRY
statements- -fassign-variable=support
ASSIGN
[TO]
variable inSELECT
- -fassign-using-variable=support
ASSIGN
USING
/VARYING
variable inSELECT
- -fassign-ext-dyn=support
ASSIGN
EXTERNAL
/DYNAMIC
inSELECT
- -fassign-disk-from=support
ASSIGN
DISK
FROM
variable inSELECT
- -fvsam-status=support
VSAM
status inFILE
STATUS
- -fself-call-recursive=support
CALL
to ownPROGRAM
-ID
impliesRECURSIVE
attribute- -frecord-contains-depending-clause=support
DEPENDING
clause inRECORD
CONTAINS
- -fpicture-l=support
PICTURE
string with ‘L’ character where support is one of:ok
,
unconformablewarning
,,
errorarchaic
,,
ignoreobsolete
,,
skip- -fnot-reserved=word
word to be taken out of the reserved words list
- -freserved=word
word to be added to reserved words list
- -freserved=word:alias
word to be added to reserved words list as alias
- -fnot-register=word
special register to disable
- -fregister=word or word:definition, where definition uses backslash esca
special register to enable
Appendix B Reserved Words
The following list of reserved words was extracted from cobc --list-reserved
and shows the reserved words, an implementation
Please notice: This list is highly specific to the option -std=dialect and reserved word options (-freserved=word, -fno-reserved=word) in effect. You can get the list for a given dialect by calling cobc -std=dialect --list-reserved
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论