home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol097 / cross.doc < prev    next >
Encoding:
Text File  |  1984-04-29  |  4.1 KB  |  123 lines

  1.  
  2.         Cross is a program that will take a Pascal program, indent it and
  3. produce a cross reference of the indented copy.  To use cross type
  4.  
  5.         CROSS
  6.         Input file:<Old-Name>
  7.         Output file:<New-Name>
  8.         Cross file:<Listing Name>
  9.  
  10. Where <Old-Name> is the name of your Pascal program.  <New-name> is the
  11. name the name the file you want the indented program sent to and
  12. <Listing-Name> is the file that the cross reference listing will be
  13. sent to. (LST: is suggested).
  14.  
  15. Cross will try to properly indent your program.  Since many screen editors
  16. will not edit lines longer than 80 characters, Cross will not indent
  17. lines past column 75 if possible.  This leaves 5 characters for changes
  18. to the lines.  The listing will be properly indented even if the source
  19. has to be moved to the left to avoid column 80.
  20.  
  21. If CROSS sees a comment beginning with %E it will start a new page.
  22. {%E} is used by Cross the same way {$L+} is used by the Pascal/Z
  23. compiler.
  24.  
  25. This listing file will contain your Pascal program with line number and
  26. annotation added to it.  The annotation will look something like this
  27.  
  28. B   5           120     Begin
  29. I   6           121       If X>5
  30.         T   6   122        Then
  31. B   7           123         Begin
  32.                 124           X:=6;Y:=2;
  33.         E   7   125         End
  34.         S   6   126       Else
  35.  
  36. The B at the left margin signals the start of BEGIN number 5.  It will
  37. match end number 5.  The I signals the start of IF number 6.  It matches
  38. THEN number 6 and ELSE number 6.  The other letters are
  39.  
  40. B       Begin
  41. C       Case
  42. E       End
  43. I       If
  44. R       Repeat
  45. S       Else
  46. T       Then
  47. U       Until
  48.  
  49. At the end of your listing there will be a section titled
  50.  
  51. Cross listing of identifiers
  52.  
  53. This section will contain all the identifiers used by your program and
  54. were they are used.  The where part is of the form <Line number>/<Page number>.
  55.  
  56. The next section will show a list of your proredures and who calls whom.
  57.  
  58. The final section will show your procedure nesting.
  59.  
  60.  
  61. Known bugs and restrictions:
  62.  
  63.         Cross does not know about Include files.  This will not be a problem
  64. as long as your include files do not contain part of a block structure.
  65. (Such as a single END statement).
  66.  
  67.         Cross considers 10 characters significant for variable names.  The
  68. Pascal/Z compiler considers only 8.
  69.  
  70.         Cross likes to right justify comments.  If you have a comment of the
  71. form
  72.  
  73. {*------------------------------------------------------*
  74.                         Text
  75.  *------------------------------------------------------*}
  76.  
  77. Cross will write it as
  78.  
  79. {*------------------------------------------------------*
  80.  Text
  81.  *------------------------------------------------------*}
  82.  
  83. You should write your comments as:
  84.  
  85. {*------------------------------------------------------*
  86.  *                      Text                            *
  87.  *------------------------------------------------------*}
  88.  
  89. to avoid this problem.
  90.  
  91.  
  92.  
  93. Notes on the Cross source.
  94.  
  95. 1)Good luck.  Cross orginally came from the univeristy of Hamburg.  It
  96. is commented in Germain.  Have fun.  Also the orignal source was made
  97. for a Dec-10 which allowed long lines to be edited.  When it was
  98. moved to the Z80 the lines had to be shortened and they were split up
  99. badly.  This poses a problem with reading the source.
  100.  
  101. 2)The file CROSS.SUB will make the program CROSS from the sources.
  102. It assumes that the sources and Pascal are on drive A and that
  103. drive B contains a scratch disk.
  104.  
  105. 3)The following paramters can be changed to suit the user.
  106. These are defined in the procedure Options which is located at
  107. the end of the program.
  108.  
  109. R       Right Margin.  Cross will try to keep text from going past
  110.         this margin.
  111. I       Indention.  This parameter is the number of spaces that Cross
  112.         will indent for every block.
  113. P       Printer width.  This is the size of the printer in columns.
  114.         Cross will cause the listing lines to wrap around if they
  115.         go past this margin.
  116. S       The number of lines of program text to be listed per page.
  117.  
  118. 4)The following are dummy procedures that you can define if you have
  119. some sort of clock.
  120.  
  121. P$Time  Returns the time as 8 characters.
  122. P$Date  Returns the date as 8 characters.
  123.