LISTINGDEMO                                                      2-Oct-1986 14:47:33    VAX Pascal V3.4-114                Page    1
01                              Source Listing                   2-Oct-1986 14:47:27    AD:[DECUS.LISTER]TEST.PAS;15 (1)

-LINE-IDC-PL-SL-

00001   C  0  0 {+++
00002   C  0  0 	This program demonstrates the use of the `listings' facility.
00003   C  0  0 	It reads the file `input', and writes the text there into the
00004   C  0  0 	file `listfile.lis', with line numbers added, using the default
00005   C  0  0 	page size.  There is a simple page header on each page.
00006   C  0  0 
00007   C  0  0 	Bob Langford
00008   C  0  0 	MCV Academic Computing
00009   C  0  0 	Medical College of Virginia
00010   C  0  0 	March, 1986
00011   C  0  0 ---}
00012      0  0 [inherit('listings')]
00013      0  0 program ListingDemo (input, output);
00014      0  0 
00015      0  0 var
00016      0  0     list : aListingControlBlock;	{ The LCB, of course. }
00017      0  0     line : varying [132] of char;	{ Holds the data line read in. }
00018      0  0     n : integer := 0;			{ Counts the # of records. }
00019      0  0 
00020      0  0 
00021   C  0  0 	{ Page header routine.  Called by FlushListing, not by
00022   C  0  0 	  this program.  Note that it can use static or global 
00023   C  0  0 	  variables.						}
00024      1  0 [asynchronous] function Header : integer;
00025      1  0 var PageNumber : [static,volatile] integer := 0;	{ Page number }
00026      1  1 begin
00027      1  1 PageNumber := PageNumber + 1;
00028   C  1  1 			{ Note that the <FF> must be written explicitly. }
00029      1  1 writeln (list.OutFile, chr(12)+'Heading for Page '+dec(PageNumber,5,1));
00030      1  1 writeln (list.Outfile);
00031      1  1 writeln (list.Outfile);
00032      1  1 header := 3			{ Signal that Header wrote 3 lines. }
00033      0  0 end;	{ header }
00034      0  0 
00035      0  0 
00036      0  1 begin
00037      0  1 OpenListing (list, 'listfile', iaddress(header));
00038      0  2 while not eof(input) do begin
00039      0  2     readln (input, line);
00040      0  2     n := n + 1;
00041      0  2     WriteListing (list, {dec(n,5,1)+'	'+}line);
00042      0  1     end;
00043      0  1 FlushListing (list)
00044      0  0 end.

LISTINGDEMO                                                      2-Oct-1986 14:47:33    VAX Pascal V3.4-114                Page    2
01                              Pascal Compilation Statistics    2-Oct-1986 14:47:27    AD:[DECUS.LISTER]TEST.PAS;15 (1)

PSECT SUMMARY

        Name                     Bytes                         Attributes

$CODE                                 484  NOVEC,NOWRT,  RD,  EXE,  SHR,  LCL,  REL,  CON,  PIC,ALIGN(2)
$LOCAL                               8144  NOVEC,  WRT,  RD,NOEXE,NOSHR,  LCL,  REL,  CON,  PIC,ALIGN(2)


ENVIRONMENT STATISTICS

                                                       -------- Symbols --------
        File                                           Total    Loaded   Percent

AD:[DECUS.LISTER]LISTINGS.PEN;13                          32        32       100


COMMAND QUALIFIERS

  PASCAL/LIST TEST

  /CHECK=(BOUNDS,NOCASE_SELECTORS,NOOVERFLOW,NOPOINTERS,NOSUBRANGE)
  /DEBUG=(NOSYMBOLS,TRACEBACK)
  /SHOW=(DICTIONARY,INCLUDE,NOINLINE,HEADER,SOURCE,STATISTICS,TABLE_OF_CONTENTS)
  /OPTIMIZE
  /STANDARD=NONE
  /TERMINAL=(NOFILE_NAME,NOROUTINE_NAME,NOSTATISTICS)
  /USAGE=(NOUNUSED,UNINITIALIZED,NOUNCERTAIN)
  /NOENVIRONMENT
  /LIST=AD:[DECUS.LISTER]TEST.LIS;17
  /OBJECT=AD:[DECUS.LISTER]TEST.OBJ;17
  /NOCROSS_REFERENCE /ERROR_LIMIT=30 /NOG_FLOATING /NOMACHINE_CODE /NOOLD_VERSION /WARNINGS


COMPILER INTERNAL TIMING

  Phase                 Faults       CPU Time      Elapsed Time
  Initialization          266        00:00.1          00:00.6
  Source Analysis         258        00:00.1          00:00.5
  Source Listing           19        00:00.1          00:00.1
  Tree Construction       101        00:00.0          00:00.0
  Flow Analysis            52        00:00.0          00:00.0
  Value Propagation        10        00:00.0          00:00.0
  Profit Analysis          28        00:00.0          00:00.0
  Context Analysis        172        00:00.1          00:00.1
  Name Packing              8        00:00.0          00:00.0
  Code Selection          106        00:00.0          00:00.0
  Final                    69        00:00.1          00:00.2
  TOTAL                  1094        00:00.6          00:01.7


COMPILATION STATISTICS

  CPU Time:       00:00.6         (4400 Lines/Minute)
  Elapsed Time:   00:01.7
  Page Faults:    1094
  Pages Used:     742

LISTINGDEMO                                                      2-Oct-1986 14:47:33    VAX Pascal V3.4-114                Page    3
01                              Pascal Compilation Statistics    2-Oct-1986 14:47:27    AD:[DECUS.LISTER]TEST.PAS;15 (1)

  Compilation Complete
