home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / ZXREF.LBR / XREF.PQS / XREF.PAS
Pascal/Delphi Source File  |  2000-06-30  |  5KB  |  181 lines

  1.  
  2. (********************)
  3. program    XREFT;
  4. (********************)
  5.  
  6. Const
  7.  
  8. title1 =
  9.  'CROSS REFERENCE GENERATOR';
  10. title2 =
  11.  'Turbo Pascal 3.0 CP/M-80';
  12. version =
  13.  'v. 0300pm, sun, 28,Sep.86, Glen Ellis';
  14.  credit =
  15.  'original by Peter Grogono, obtained from GEnie';
  16.  
  17. (*------------------------------------------------------*)
  18.  
  19. (* enable User interrupts *) (* disable for greater speed *)
  20. (* U+*)
  21. (* enable Cntl C character interrupts *)
  22. (* C+*)
  23. (* enable recursive calls in CPM *)
  24. (*$A-*)
  25. (* disable I/O error checking *)
  26. (*$I-*)
  27. (* disable verify variable types *) (* increases speed *)
  28. (*$V-*)
  29. (* disable Range checking on index operations *)
  30. (*$R-*)
  31.  
  32.  
  33. {++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
  34. {+                                                      +}
  35. {+  PROGRAM TITLE:      Cross Reference Generator       +}
  36. {+                                                      +}
  37. {+  WRITTEN BY:         Peter Grogono                   +}
  38. {+  DATE WRITTEN:       ?                               +}
  39. {+                                                      +}
  40. {+  SUMMARY:                                            +}
  41. {+      1. Output Files:                                +}
  42. {+         a. first output file is a numbered Listing   +}
  43. {+            of the input source                       +}
  44. {+         b. second output file is cross reference     +}
  45. {+            with each identifier followed by the      +}
  46. {+            line numbers on which it appears.         +}
  47. {+      2. Listing Device:                              +}
  48. {+         The numbered source Listing may optionally   +}
  49. {+         be routed to the screen or printer (but not  +}
  50. {+         both).                                       +}
  51. {+                                                      +}
  52. {+  MODIFICATION RECORD:                                +}
  53. (*
  54. (*  06 Jan 85: by Alan D. Hull, 42489 Castle Ct., Canton, MI. 48188
  55. (*             Added default answers to prompts, added line
  56. (*             processing display
  57. (*
  58. (*  01 Dec 84: by Donald W. Smith, Silicon Valley FOG.
  59. (*             Adapted from MS-DOS to CP/M:
  60. (*             Filename from 20 to 14 bytes
  61. (*             Changed "with" Level as required.
  62. (*             Split into two files XREFT.PAS, XREFT1.INC.
  63. (*             Added defaults for the file name input.
  64. (*
  65. (*   17-APR-84       -Modified for Turbo Pascal so
  66. (*                       $ includes are supported
  67. (*
  68. (*   23.Sep.86, by Glen Ellis, University of Tennessee,
  69. (*              Memphis, Tn, 38163.
  70. (*
  71. (*              Added Menu options
  72. (*                   for dBASE Keywords or Turbo Pascal Keywords.
  73. (*              Menus now require complete source filename.
  74. (*
  75. (*              Search InReservedWord for Pascal is absolute compare.
  76. (*              Search InReservedWord written for dBASE
  77. (*                 based on left string.
  78. (*
  79. (*              Some variables renamed, slightly, and so noted.
  80. (*              'p' prefixed to procedure names
  81. (*              'f' prefixed to function names
  82. (*              Source File run through
  83. (*                   author's Zindent.PAS reformatter.
  84. (*
  85. (*-------------------------------------------------------------------
  86. (*
  87. (*  Procedure Tree :
  88. (*
  89. (*     XREF.PAS
  90. (*        calls pInitialize
  91. (*        calls pBuildTree
  92. (*        calls pPrintTree
  93. (*
  94. (*     XREF0.INC
  95. (*        Assignments
  96. (*
  97. (*     XREF1.INC
  98. (*        pInitialize
  99. (*           calls pConnectFiles
  100. (*           calls pGetNames
  101. (*
  102. (*     XREF2.INC
  103. (*        pBuildTree
  104. (*           calls pEnterTree
  105. (*           calls pGetLine
  106. (*                 calls pReadChar
  107. (*           calls pReadWord
  108. (*                 calls pFindInReserve
  109. (*
  110. (*     XREF3.INC
  111. (*        pPrintTree
  112. (*           calls pPrintEntry
  113. (*           calls pPrintLine
  114. (*
  115. (*
  116. (*
  117. (*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*)
  118.  
  119.  
  120. (*-------------*)
  121.  
  122. (*$I XREF0.INC*)
  123. (* Assignements only *)
  124.  
  125. (*$I XREF1.INC*)
  126. (* pInitialize, pConnectFiles, pGetNames *)
  127.  
  128. (*$I XREF2.INC*)
  129. (* pBuildTree, pEnterTree, pReadChar, pGetLine, pReadWord *)
  130.  
  131. (*$I XREF3.INC*)
  132. (* pPrintTree, pPrintEntry, pPrintLine *)
  133.  
  134. (*-------*)
  135. (*  MAIN *)
  136.  
  137. begin { Cross Reference }
  138.  
  139.    CLRSCR;
  140.    LOWVIDEO;
  141.    WriteLn(' ':18,title1);
  142.    WriteLn(' ':18,title2);
  143.    WriteLn(' ':15, version);
  144.    WriteLn(' ':15, credit);
  145.    WriteLn;  WriteLn;  WriteLn;
  146.  
  147.    (**)
  148.    pInitialize( KeyModeChar ); (* XREF1.INC *)
  149.    (* and gather parameters *)
  150.  
  151.    IF not FatalErrorStatus then
  152.    begin
  153.  
  154.       WordTree := NIL;          {Make the Tree empty}
  155.  
  156.       WriteLn('Pass 1 [Listing] begins ...');
  157.  
  158.       (**) (* send parm KeyModeChar *)
  159.       pBuildTree(WordTree, FileInID, KeyModeChar ); (* XREF2.INC*)
  160.  
  161.       CLOSE(FOut) ;
  162.  
  163.       WriteLn('Pass 2 [Cross-Ref] begins ...');
  164.  
  165.       (**)
  166.       pPrintTree(WordTree); (* XREF3.INC*)
  167.  
  168.       WriteLn('Pass 2 [Cross-Ref] Complete..');
  169.  
  170.       CLOSE(xout);
  171.  
  172.    end;
  173.  
  174.    WriteLn;
  175.  
  176. end. (* Cross Reference *)
  177.  
  178. (*-----------------------------------------------------------*)
  179.  
  180.  
  181.