Chapter 5. Compilation output. IBM Version 8.5
જાહેરાત
જાહેરાત
Chapter 5. Compilation output
The results of compilation depend on how error-free your source program is and on the compile-time options you specify. Results can include diagnostic messages, a return code, and other output saved to disk (for example, an object module and
from the compiler.
Using the compiler listing
During compilation, the compiler generates listings that contain information about the source program, the compilation, and the object module. The TERMINAL option sends diagnostics and statistics to your terminal. The IBM.PRINT
environment variable specifies the output directory for printable listing files (see
“IBM.PRINT” on page 23 for more information on the IBM.PRINT environment
variable). The following description of the listing refers to its appearance on a printed page.
This listing for CHIMES program highlights some of the more useful parts of the
compiler listing. Figure 3 on page 176 is similar to the compiler listing for that
program.
© Copyright IBM Corp. 1998, 2012
175
Using the compiler listing
5724-B67 IBM(R) PL/I for Windows 8.5
Options Specified
1
Environment:
Command: op
Line.File Process Statements
1.0
2.0
*PROCESS MACRO S A(F) X AG;
*PROCESS NOT(’^’) OR(’|’);
(Built:20120821)
Options Used
2
+
+
ADDEXT
AGGREGATE(DECIMAL)
ATTRIBUTES(FULL)
BIFPREC(31)
BLANK(’09’x)
CASERULES( KEYWORD( MIXED ) )
CHECK( NOCONFORMANCE NOSTORAGE )
CMPAT(LE)
CODEPAGE(00819)
NOCOMPILE(S)
NOCOPYRIGHT
CURRENCY(’$’)
NODBCS
DEFAULT(IBM ASSIGNABLE NOINITFILL NONCONNECTED LOWERINC
DESCRIPTOR DESCLIST DUMMY(ALIGNED) ORDINAL(MIN)
BYADDR RETURNS(BYVALUE) LINKAGE(OPTLINK) NORETCODE
NOINLINE REORDER NOOVERLAP NONRECURSIVE ALIGNED NULLSYS
BIN1ARG PSEUDODUMMY NULLSTRADDR NULLSTRPTR(NULL) EVENDEC
SHORT(HEXADEC) ASCII IEEE NATIVE NATIVEADDR E(IEEE))
DEPRECATE(
BUILTIN()
ENTRY()
INCLUDE()
VARIABLE()
STMT()
)
DEPRECATENEXT(
BUILTIN()
ENTRY()
INCLUDE()
VARIABLE()
STMT()
)
NODLLINIT
NOEXIT
EXTRN(SHORT)
FLAG(W)
FLOATINMATH(ASIS)
NOGONUMBER
NOGRAPHIC
NOIGNORE
IMPRECISE
INCAFTER(PROCESS(""))
CHIMES program compiler listing
Figure 3. CHIMES program compiler listing
2012.08.21 13:09:51 Page 1
176
PL/I for Windows Programming Guide
Using the compiler listing
2012.08.21 13:09:51 Page 2 5724-B67 IBM(R) PL/I for Windows
+
+
+
NOINCDIR
INCLUDE(EXT(’inc’ ’cpy’ ’mac’))
NOINITAUTO
NOINITBASED
NOINITCTL
NOINITSTATIC
NOINSOURCE
LANGLVL(NOEXT)
LIBS( SINGLE DYNAMIC )
LIMITS( EXTNAME(100) FIXEDBIN(31,31) FIXEDDEC(15,15) NAME(100) )
LINECOUNT(60)
NOLINEDIR
NOLIST
LISTVIEW(SOURCE)
MACRO
MARGINI(’ ’)
MARGINS(2,72)
MAXGEN(100000)
MAXMSG(W 250)
MAXNEST( BLOCK(17) DO(17) IF(17) )
MAXSTMT(4096)
MAXTEMP(50000)
NOMDECK
MSG(*)
NOMSGSUMMARY
NAMES(’@#$’ ’@#$’)
NATLANG(ENU)
NONEST
NOT(’^’)
NUMBER
OBJECT
NOOFFSET
NOONSNAP
OPTIMIZE(0)
OPTIONS(DOC)
OR(’|’)
PP( MACRO )
NOPPCICS
NOPPINCLUDE
PPLIST(KEEP)
NOPPMACRO
NOPPSQL
NOPPTRACE
PRECTYPE(ANS)
PREFIX(CONVERSION FIXEDOVERFLOW INVALIDOP OVERFLOW
NOSIZE NOSTRINGRANGE NOSTRINGSIZE NOSUBSCRIPTRANGE
UNDERFLOW ZERODIVIDE)
PROBE
NOPROCEED(S)
PROCESS(DELETE)
QUOTE(’"’)
REDUCE
RESEXP
RESPECT()
RULES(IBM BYNAME CONTROLLED NODECSIZE ELSEIF EVENDEC GOTO GLOBALDO
NOLAXBIF NOLAXCTL LAXDCL NOLAXDEF LAXENTRY LAXIF LAXINOUT LAXLINK
LAXMARGINS LAXNESTED LAXPUNC LAXQUAL LAXRETURN LAXSCALE LAXSEMI LAXSTG
NOLAXSTRZ MULTICLOSE PADDING PROCENDONLY RECURSIVE SELFASSIGN UNREF)
5724-B67 IBM(R) PL/I for Windows
+
+
NOSEMANTIC(S)
NOSNAP
NOSOSI
SOURCE
STATIC(SHORT)
NOSTMT
NOSTORAGE
NOSYNTAX(S)
SYSPARM(’’)
SYSTEM(WINDOWS)
TERMINAL
NOTEST
USAGE( HEX(SIZE) ROUND(IBM) SUBSTR(STRICT) UNSPEC(IBM) )
WIDECHAR(LITTLEENDIAN)
WINDOW(1950)
XINFO(NODEF NOXMI NOXML)
XML( CASE(UPPER) )
XREF(FULL)
CHIMES program compiler listing
2012.08.21 13:09:51 Page 3
Chapter 5. Compilation output
177
Using the compiler listing
5724-B67 IBM(R) PL/I for Windows
Compiler Source
Line.File
46.0
47.0
48.0
49.0
50.0
51.0
52.0
53.0
54.0
55.0
56.0
32.0
33.0
34.0
35.0
36.0
37.0
38.0
39.0
40.0
41.0
42.0
43.0
44.0
45.0
18.0
19.0
20.0
21.0
22.0
23.0
24.0
25.0
26.0
27.0
28.0
29.0
30.0
31.0
10.0
11.0
12.0
13.0
14.0
15.0
16.0
17.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
/********************************************************************/
/* */
/* NAME - CHIMES.PLI
/*
/* DESCRIPTION
/*
/*
/*
/*
/*
/*
/*
/*
5639-A83, 5639-A24 (C) Copyright IBM Corp. 1992,1996.
*/
*/
All Rights Reserved.
*/
US Government Users Restricted Rights-- Use, duplication or */ disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
/* DISCLAIMER OF WARRANTIES
*/
*/
*/
*/
/*
/*
/*
/*
/*
/*
/*
/*
Plays a tune using system API services
The following ’enclosed’ code is sample code created by IBM
Corporation. This sample code is not part of any standard
IBM product and is provided to you solely for the purpose of assisting you in the development of your applications.
The */ code is provided "AS IS", without warranty of any kind.
*/
IBM shall not be liable for any damages arising out of your */ use of the sample code, even if IBM has been advised of the */ possibility of such damages.
*/
/* */
/********************************************************************/
CHIMES: PROC OPTIONS(MAIN);
DCL ( REST VALUE( 0 ),
G4
C5
D5
VALUE( 392 ),
VALUE( 523 ),
VALUE( 587 ),
*/
*/
*/
*/
*/
*/
*/
/* Play a tune using DOSBEEP tones */
/* Declare Named Constants
E5 VALUE( 657 ),
WHOLE VALUE( 800 ) ) FIXED BIN(31);
*/
/* for note and rest tone */
/* values and timings.
*/
DCL NOTES(19,2) STATIC NONASGN FIXED BIN(31)
INIT( E5, (WHOLE/2), /* Declare tone and timing */
/* for each note of tune.
*/ C5, (WHOLE/2),
D5, (WHOLE/2),
G4, (WHOLE),
REST, (WHOLE/2),
G4, (WHOLE/2),
D5, (WHOLE/2),
/* Initial values may be */
/* restricted expressions */
/* using Named Constants */
/* previously defined in
/* this program.
*/
*/ E5, (WHOLE/2),
C5, (WHOLE),
REST, (WHOLE/2),
E5, (WHOLE/2),
C5, (WHOLE/2),
D5, (WHOLE/2),
G4, (WHOLE),
REST, (WHOLE/2),
G4, (WHOLE/2),
D5, (WHOLE/2),
E5, (WHOLE/2),
CHIMES program compiler listing
2012.08.21 13:09:51 Page 4
178
PL/I for Windows Programming Guide
Using the compiler listing
5724-B67 IBM(R) PL/I for Windows
Line.File
Line.File
73.0
88.0
89.0
90.0
91.0
92.0
93.0
94.0
95.0
96.0
97.0
65.0
66.0
67.0
68.0
69.0
70.0
71.0
72.0
57.0
58.0
59.0
60.0
61.0
62.0
64.0
DCL SLEEP
C5, (WHOLE) );
DCL I FIXED BIN(31);
/* Declare external APIs called by chimes. */
DCL BEEP ENTRY( FIXED BIN(31), FIXED BIN(31) ) /* tone, time */
EXT( ’Beep’ )
OPTIONS( BYVALUE
ENTRY( FIXED BIN(31) )
EXT( ’Sleep’ )
OPTIONS( BYVALUE
/* External name of function */
/* Pass parameters by value
LINKAGE(STDCALL));
LINKAGE(STDCALL) );
*/
/* Time duration only */
/* Play all of the notes and rests of the tune using a do loop.
DO I = LBOUND(NOTES,1) TO HBOUND(NOTES,1);
IF NOTES(I,1) ^= 0
THEN CALL BEEP( NOTES(I,1), NOTES(I,2) );
ELSE CALL SLEEP( NOTES(I,2) );
END;
END;
5724-B67 IBM(R) PL/I for Windows
*/
/* Note the use of ?for logical NOT */
2012.08.21 13:09:51 Page
2012.08.21 13:09:51 Page
64.0
33.0
29.0
34.0
35.0
32.0
BEEP
Attribute/Xref Table
4
C5
CHIMES
D5
E5
G4
+++++++ HBOUND
59.0
I
+++++++ LBOUND
38.0
31.0
70.0
36.0
NOTES
REST
SLEEP
WHOLE
CONSTANT EXTERNAL(’Beep’)
ENTRY( BYVALUE INONLY FIXED BIN(31,0),
BYVALUE INONLY FIXED BIN(31,0) )
OPTIONS( LINKAGE ( STDCALL ) )
Refs: 93.0
CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
CONSTANT EXTERNAL
ENTRY()
OPTIONS( LINKAGE ( OPTLINK ) )
CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
BUILTIN
Refs: 91.0
AUTOMATIC FIXED BIN(31,0)
Refs: 92.0 93.0 93.0 94.0
Sets: 91.0
BUILTIN
Refs: 91.0
STATIC NONASSIGNABLE DIM(1:19,1:2) FIXED BIN(31,0) INITIAL
Refs: 91.0 91.0 92.0 93.0 93.0 94.0
CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0
CONSTANT EXTERNAL(’Sleep’)
ENTRY( BYVALUE INONLY FIXED BIN(31,0) )
OPTIONS( LINKAGE ( STDCALL ) )
Refs: 94.0
CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0
38.0 38.0 38.0 38.0
CHIMES program compiler listing
6
5
Chapter 5. Compilation output
179
Using the compiler listing
5724-B67 IBM(R) PL/I for Windows
Line.File Dims
Aggregate Length Table
5
Offset Total Size Base Size Identifier
152 4 NOTES 38.0
2 0
5724-B67 IBM(R) PL/I for Windows
2012.08.21 13:09:51 Page 7
2012.08.21 13:09:51 Page 8
No Compiler Messages
File Reference Table
6
File
0
3
Component
Included From Name
C:\pliz\newfe\chimes.pli
Return Code Messages (Total/Suppressed)
MACRO
Compiler
0
0
End of compilation of CHIMES
CHIMES program compiler listing
0 / 0
0 / 0
Time
0 secs
1 secs
7
1
Options specified
This section of the compiler listing shows any compile-time options you specified. Options shown under
Install: are specified in your IBM.OPTIONS
environment variable. Options shown under
Command: indicate that these options were specified on the command line when you invoked the compiler
(there are no command options in this example). Options specified with the
*PROCESS or %PROCESS statement are shown below the command options.
2
Options used
The compiler listing includes a list of all compile-time options used, including the default options. If an option is marked with a plus sign (+), the default has been changed. If any compile-time options contradict each other, the compiler uses the one with the highest priority. The following list shows which options the compiler uses, beginning with the highest priority: v
Options specified with the *PROCESS or %PROCESS statement.
v
Options specified when you invoked the compiler with the PLI command.
v
Install options installed either at installation time or by the IBM.OPTIONS
environment variable (see “IBM.OPTIONS” on page 21 for more information
on the IBM.OPTIONS environment variable).
3
Using the NUMBER option
The statement numbers shown are generated by the NUMBER option. In this case, the statement begins on the 14th line in file 1. The File Reference Table at the bottom of the listing also shows that file 1 refers to D:\ibmpli\samples\ chimes.pli.
By generating these statement numbers during compilation, you can locate lines that need editing (indicated in messages, for example) without having to refer to the listing.
4
Attribute and cross-reference table
If you specify the ATTRIBUTES option, the compiler provides an attribute table containing a list of the identifiers in the source program together with their declared and default attributes in the compiler listing. The FULL attribute lists
180
PL/I for Windows Programming Guide
Using the compiler listing
all identifiers and attributes. If you specify the SHORT suboption for
ATTRIBUTES, unreferenced identifiers are not listed.
If you specify the XREF option, the compiler prints a cross-reference table containing a list of the identifiers in the source program together with the
Line.File
number (the statement number inside the file and the file number, respectively) in which they appear in the compiler listing.
An identifier appears in the Sets: part of the cross-reference table if it is: v The target of an assignment statement.
v Used as a loop control variable in DO loops.
v Used in the SET option of an ALLOCATE or LOCATE statement.
v
Used in the REPLY option of a DISPLAY statement.
If there are unreferenced identifiers, they are displayed in a separate table (not shown in this example).
If you specify ATTRIBUTES and XREF (as in this example), the two tables are combined.
Explicitly-declared variables are listed with the number of the DECLARE statement in which they appear. Implicitly-declared variables are indicated by asterisks and contextually declared variables (HBOUND and LBOUND in this example) are indicated by plus (+) signs. (Undeclared variables are also listed in a diagnostic message.)
The attributes INTERNAL and REAL are never included; they can be assumed unless the respective conflicting attributes, EXTERNAL and COMPLEX, are listed.
For a file identifier, the attribute FILE always appears, and the attribute
EXTERNAL appears if it applies; otherwise, only explicitly declared attributes are listed.
For an array, the dimension attribute is printed first. If the bound of an array is a restricted expression, the value of that expression is shown for the bound; otherwise an asterisk is shown.
If the length of a bit string or character string is a restricted expression, that value is shown, otherwise an asterisk is shown.
5
Aggregate length table
If you specified the AGGREGATE option, the compiler provides an aggregate length table in the compiler listing. The table shows how each aggregate in the
program is mapped. Table 5 shows the headings for the aggregate length table
columns and the description of each.
Table 5. Aggregate length table headings and description
Heading
Line.File
Offset
Total Size
Base Size
Identifier
Description
The statement number and file number in which the aggregate is declared
The byte offset of each element from the beginning of the aggregate
The total size in bytes of the aggregate
The size in bytes of the data type
The name of the aggregate and the element within the aggregate
6
File reference table
The
Included From
column of the File reference table indicates where the corresponding file from the
Name
column was included. The first entry in this
Chapter 5. Compilation output
181
Using the compiler listing
column is blank because the first file listed is the source file. Entries in the
Included From
column show the line number of the include statement followed by a period and the file number of the source file containing the include.
7
Component, return code, diagnostic messages, time
The last part of the compiler listing consists of the following headings:
Component
Shows you which component or processor is providing the information.
Either the macro facility, if invoked, or the compiler itself can provide you with informational messages.
Return code
Shows you the highest return code generated by the component, issued upon completion of compilation. Possible return codes are:
0 (Informational)
No warning messages detected (as in this example). The compiled program should run correctly. The compiler might inform you of a possible inefficiency in your code or some other condition of interest.
4 (Warning)
Indicates that the compiler found minor errors, but the compiler could correct them. The compiled program should run correctly, but might produce different results than expected or be significantly inefficient.
8 (Error)
Indicates that the compiler found significant errors, but the compiler could correct them. The compiled program should run correctly, but might produce different results than expected.
12 (Severe error)
Indicates that the compiler found errors that it could not correct. If the program was compiled and an object module produced, it should not be used.
16 (Unrecoverable error)
Indicates an error-forced termination of the compilation. An object module was not successfully created.
Note:
When coding CMD files for PL/I, you can use the return code to decide whether or not post-compilation procedures are performed.
Messages
Indicates: v
The number of messages issued, if any v
The number of messages suppressed, if any, because they were equal to or below the severity level set by the FLAG compile-time option.
Messages for the compiler, macro facility, SQL preprocessor, and run-time environment are listed and explained in
Messages and Codes
.
Only messages of the severity above that specified by the FLAG option are issued. The messages, statements, and return code appear on your screen unless you specify the NOTERMINAL compile-time option.
Time
Shows you the total time the component took to process your program.
182
PL/I for Windows Programming Guide
Compiler output files
Compiler output files
If you compile a program using default options, an object module is created in the current directory. By altering compile-time options, you can request other output to
be created in addition to the object module. Table 6 lists other possible compilation
outputs which are also located in the current directory by default.
All compiler output files use the same file name as the main program file. The file extensions are specified in the following table.
Table 6. Possible compilation disk outputs
Output File extension
Preprocessed source text DEK
Object module
Object listing
Template .DEF file
Message listing
OBJ
ASM
DEF
XML
How requested
(compile-time option)
DECK option of appropriate preprocessor
OBJECT
LIST
XINFO(DEF)
XINFO(XML)
How relocated
(environment variable)
IBM.DECK
IBM.OBJECT
IBM.PRINT
IBM.OBJECT
IBM.OBJECT
Note:
You always receive a .LST file containing the program listing.
Chapter 5. Compilation output
183
Compiler output files
184
PL/I for Windows Programming Guide
ડાઉનલોડ કરો
જાહેરાત