HP 3000 Manuals

LIST [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

LIST 

LIST is an HP Standard Option.

When the LIST compiler option is ON, the compiler produces a listing of
the source code.

The command line option -L also specifies this option.

Syntax 

$LIST {ON }$
      {OFF}

Default       ON.

Location      Anywhere.

The first column of the listing shows the source statement number.  This
number appears in the code offset table, is used by the symbolic
debugger, and is returned by the predefined function statement_number.

The second column of the listing shows a line number.  The line number is
provided by the editor if the source file is numbered; by the compiler if
the source file is unnumbered.  If the compiler numbers the lines, the
lines are numbered consecutively, starting with 1.  Included files are
numbered separately (see the second example below, and the paragraph
above it).

The third column of the listing shows the source statement nesting level
(if the line is part of a structured statement).  If the line was not
compiled (because it is a comment or is affected by the SKIP_TEXT
option), then ** replaces the number.

The end of the listing shows the processor time, elapsed time, the number
of lines compiled, the number of lines compiled per minute, and the
number of notes, warnings, and errors issued during the compilation.
Sample listings in this manual omit this information (except where the
example requires it).  Times and rates vary, depending on the operating
system, the memory configuration, system load, and the number of source
lines.

If the compiler issues a message for a source line, it appears beneath
that line in the listing in this form:

     ****  {NOTE}
           {WARNING}
           {ERROR} #ord_num [message] (message_num)

If the compiler can pinpoint the item in the source line that caused the
note, warning, or error, the listing indicates that item with a caret
(^).

The ord_num is the ordinal number of the note, warning, or error (it is
the ord_numth note, warning, or error in the compilation).  The
message_num is the number that identifies the message, and message is the
text that explains it.

Error and warning messages on multipage listings are chained; that is,
the first such message on a page gives the page number of the previous
such message.  If the listing has no error or warning messages, its last
page states this.

If LIST is OFF, and the compiler issues a message, it prints both the
name of the include file that contains the line, and a copy of the line
before issuing the message.

The LIST option must be ON for other options that affect the listing to
have any effect.

Example 

         PAGE   1 HEWLETT-PACKARD  ...  (C) HEWLETT-PACKARD CO. 1986 ...

             0    1.000   0
             0    2.000   0
             0    3.000   0   PROGRAM sort (infile,outfile,output);
             0    4.000   0
             0    5.000   0   VAR
             0    6.000   0      infile : text;
             1    7.000   0      outfile : text;
             2    8.000   0
            **    8.100   0   (* This line and the next three are not compiled:
            **    8.200   0   CONST
            **    8.300   0      max_array_size = 20000;
            **    8.400   0   *)
             2    9.000   0   CONST
             2   10.000   0      max_array_size := 4000;
                                                ^
         **** ERROR # 1            FOUND UNEXPECTED ":=" (025)
             3   11.000   0   TYPE
             3   12.000   0      data_type = integer;
             4   13.000   0
             4   14.000   0   VAR
             4   15.000   0      data_array = array [1..max_array_size] OF data_type;
                                            ^
         **** ERROR #2             FOUND UNEXPECTED "=" (025)
             5   16.000   0
             5   17.000   0      array_size : 0..max_array_size;
             6   18.000   0
             6   19.000   0   $PAGE$

         PAGE   2 HEWLETT-PACKARD  ...  (C) HEWLETT-PACKARD CO. 1986 ...
             0   20.000   0   PROCEDURE read_data;
             1   21.000   1   BEGIN
             1   22.000   1      reset(infile);
             2   23.000   1      array_size := 0;
             3   24.000   1
             3   25.000   1      WHILE ((NOT eof(infile))
             4   26.000   1            AND
             4   27.000   2            (array_size < max_array_size)) DO BEGIN
             4   28.000   2
             4   29.000   2            array_size := array_size + 1;
             5   30.000   2            readln(infile,data_array[array_size]);
             6   31.000   2      END;
             6   32.000   1
             6   33.000   2      IF (NOT eof(infile)) THEN BEGIN
             7   34.000   2         writeln('Too many data points for sort program.');
             8   35.000   2         writeln('Sorting partial list only.');
             9   36.000   2      END;
             9   37.000   1
             9   38.000   1      close(infile);
            10   39.000   1   END;
            10   40.000   0
             0   41.000   0   $PAGE$

         PAGE   3 HEWLETT-PACKARD  ...  (C) HEWLETT-PACKARD CO. 1986 ...

             0   42.000   0   PROCEDURE write_data;
             1   43.000   0   VAR
             1   44.000   0      index : 0..max_array_size;
             2   45.000   1   BEGIN
             2   46.000   1      rewrite(outfile);
             3   47.000   1
             3   48.000   1      FOR index := 1 TO array_size DO
             4   49.000   1         writeln(outfile,'data_array[index]);
             5   50.000   1
             5   51.000   1      close(outfile);
             6   52.000   1   END;
             6   53.000   0
             0   54.000   0   $PAGE$

         PAGE   4 HEWLETT-PACKARD  ...  (C) HEWLETT-PACKARD CO. 1986 ...

             6   55.000   1   BEGIN
             6   56.000   1      writeln('starting sort');
             7   57.000   1
             7   58.000   1      read_data;
             8   59.000   1      sort_data;
                                     ^
         PREVIOUS ERROR ON PAGE  1
         **** ERROR #  3   IDENTIFIER NOT DEFINED (014)
             9   60.000   1      write_data;
            10   61.000   1
            10   62.000   1      writeln('sort done');
            11   63.000   1   END.

                   NUMBER OF ERRORS = 3      NUMBER OF WARNINGS =  0
                   PROCESSOR TIME 0: 0: 0    ELAPSED TIME 0: 0: 0
                   NUMBER OF LINES =   63    LINES/MINUTE =  0.0
                   NUMBER OF NOTES =  0

            

Line numbers for statements in included files are independent of line
numbers for the files that include them.

Example 

[]


MPE/iX 5.0 Documentation