(********************) program XREFT; (********************) Const title1 = 'CROSS REFERENCE GENERATOR'; title2 = 'Turbo Pascal 3.0 CP/M-80'; version = 'v. 0300pm, sun, 28,Sep.86, Glen Ellis'; credit = 'original by Peter Grogono, obtained from GEnie'; (*------------------------------------------------------*) (* enable User interrupts *) (* disable for greater speed *) (* U+*) (* enable Cntl C character interrupts *) (* C+*) (* enable recursive calls in CPM *) (*$A-*) (* disable I/O error checking *) (*$I-*) (* disable verify variable types *) (* increases speed *) (*$V-*) (* disable Range checking on index operations *) (*$R-*) {++++++++++++++++++++++++++++++++++++++++++++++++++++++++} {+ +} {+ PROGRAM TITLE: Cross Reference Generator +} {+ +} {+ WRITTEN BY: Peter Grogono +} {+ DATE WRITTEN: ? +} {+ +} {+ SUMMARY: +} {+ 1. Output Files: +} {+ a. first output file is a numbered Listing +} {+ of the input source +} {+ b. second output file is cross reference +} {+ with each identifier followed by the +} {+ line numbers on which it appears. +} {+ 2. Listing Device: +} {+ The numbered source Listing may optionally +} {+ be routed to the screen or printer (but not +} {+ both). +} {+ +} {+ MODIFICATION RECORD: +} (* (* 06 Jan 85: by Alan D. Hull, 42489 Castle Ct., Canton, MI. 48188 (* Added default answers to prompts, added line (* processing display (* (* 01 Dec 84: by Donald W. Smith, Silicon Valley FOG. (* Adapted from MS-DOS to CP/M: (* Filename from 20 to 14 bytes (* Changed "with" Level as required. (* Split into two files XREFT.PAS, XREFT1.INC. (* Added defaults for the file name input. (* (* 17-APR-84 -Modified for Turbo Pascal so (* $ includes are supported (* (* 23.Sep.86, by Glen Ellis, University of Tennessee, (* Memphis, Tn, 38163. (* (* Added Menu options (* for dBASE Keywords or Turbo Pascal Keywords. (* Menus now require complete source filename. (* (* Search InReservedWord for Pascal is absolute compare. (* Search InReservedWord written for dBASE (* based on left string. (* (* Some variables renamed, slightly, and so noted. (* 'p' prefixed to procedure names (* 'f' prefixed to function names (* Source File run through (* author's Zindent.PAS reformatter. (* (*------------------------------------------------------------------- (* (* Procedure Tree : (* (* XREF.PAS (* calls pInitialize (* calls pBuildTree (* calls pPrintTree (* (* XREF0.INC (* Assignments (* (* XREF1.INC (* pInitialize (* calls pConnectFiles (* calls pGetNames (* (* XREF2.INC (* pBuildTree (* calls pEnterTree (* calls pGetLine (* calls pReadChar (* calls pReadWord (* calls pFindInReserve (* (* XREF3.INC (* pPrintTree (* calls pPrintEntry (* calls pPrintLine (* (* (* (*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*) (*-------------*) (*$I XREF0.INC*) (* Assignements only *) (*$I XREF1.INC*) (* pInitialize, pConnectFiles, pGetNames *) (*$I XREF2.INC*) (* pBuildTree, pEnterTree, pReadChar, pGetLine, pReadWord *) (*$I XREF3.INC*) (* pPrintTree, pPrintEntry, pPrintLine *) (*-------*) (* MAIN *) begin { Cross Reference } CLRSCR; LOWVIDEO; WriteLn(' ':18,title1); WriteLn(' ':18,title2); WriteLn(' ':15, version); WriteLn(' ':15, credit); WriteLn; WriteLn; WriteLn; (**) pInitialize( KeyModeChar ); (* XREF1.INC *) (* and gather parameters *) IF not FatalErrorStatus then begin WordTree := NIL; {Make the Tree empty} WriteLn('Pass 1 [Listing] begins ...'); (**) (* send parm KeyModeChar *) pBuildTree(WordTree, FileInID, KeyModeChar ); (* XREF2.INC*) CLOSE(FOut) ; WriteLn('Pass 2 [Cross-Ref] begins ...'); (**) pPrintTree(WordTree); (* XREF3.INC*) WriteLn('Pass 2 [Cross-Ref] Complete..'); CLOSE(xout); end; WriteLn; end. (* Cross Reference *) (*-----------------------------------------------------------*)