home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / CXREF.ZIP / CXREF.DOC < prev    next >
Encoding:
Text File  |  1988-06-01  |  7.4 KB  |  144 lines

  1.  
  2.  
  3.  
  4.                      CXREF - C Program Cross Reference Generator
  5.                             Version: 2.00     June 24, 1986
  6.           
  7.           
  8.               CXREF produces a cross-reference listing for a C program  and 
  9.           optional  graphical  representation of the block structure of the 
  10.           program.  Occurrences only are listed.  No  distinction  is  made 
  11.           between  definitions  and  references.  Version 2.00 of CXREF has 
  12.           been converted from Turbo Pascal source  into  C  source.  The  C 
  13.           compiler  used  was  Datalight's small model compiler however the 
  14.           source appears to be reasonably standard and little effort should 
  15.           be required to convert it to any other C.  
  16.           
  17.           
  18.           USAGE:
  19.           
  20.               The command line for CXREF has the following format:
  21.           
  22.                   CXREF input_file_name [output_file_name] [options]
  23.           
  24.               Both the input_file_name and the output_file_name may be full 
  25.           PC/MS-DOS path names.  The output_file_name is  optional.  If  is 
  26.           is  not  supplied,  the output file will be created with the same 
  27.           name as the input file but  with  an  extension  of  LST.  If  no 
  28.           extension  is  specified  for the input file,  an extension of .C 
  29.           will be assumed.  If an output file name is specified but without 
  30.           an extension, an extension of LST will be assumed.  
  31.           
  32.               The current version of CXREF supports three flag options and 
  33.           two options that require an additional parameter.
  34.           
  35.               Flag Options:
  36.           
  37.                   -NL  - Suppress  the  graphical  representation  of   the 
  38.                          program  and  the  line  numbered  listing  of the 
  39.                          program.  
  40.           
  41.                   -NS  - Suppress cross-referencing of C keywords.
  42.           
  43.                   -NI  - Suppress analysis of #include files.
  44.           
  45.               Value Options:
  46.           
  47.                   -I <path>  - Supplies the path for  #include  <file_name> 
  48.                                files.  Must b followed by the pathname.  
  49.           
  50.                   -T <n>     - Sets  the  tab stop value for tab expansion.  
  51.                                The default value is 4.  
  52.           
  53.               The  default  condition  is  to  produce  the  line  numbered 
  54.           listing,   including  all  #include  files,   showing  the  block 
  55.           structure and to cross-reference all symbols.  
  56.           
  57.               If executed with  no  command  line  parameters,  CXREF  will 
  58.           display a brief summary of its usage.  
  59.           
  60.  
  61.  
  62.  
  63.           
  64.           INCLUDE FILES:
  65.           
  66.               This version of CXREF will process single level include files 
  67.           of  either  the  quote  delimited  or the angle bracket ['<','>'] 
  68.           forms.  Quote delimited include files are  located  in  the  same 
  69.           directory  as  the  input  program  and  angle  bracket delimited 
  70.           include   files   are   located   in   a   "system"    directory.  
  71.           Unfortunately,  there  is  no  standard  "system" directory under 
  72.           PC/MS-DOS and the various C compilers use a number  of  different 
  73.           mechanisms  to  provide  a  "system"  directory.  To  handle  the 
  74.           different "system" directories, CXREF provides the "-I" option on 
  75.           the command line,  allowing the user to provide a  path  for  all 
  76.           angle bracket delimited include files.  
  77.           
  78.               CXREF can handle up to 26 include files, distinguished by the 
  79.           letters  A  through  Z  following  the  line  numbers in both the 
  80.           listing and the cross-reference.  The line numbers shown, both on 
  81.           the listing and in the cross-reference,  are  true  line  numbers 
  82.           within  the  file  making the cross-reference without the listing 
  83.           useful.  
  84.           
  85.           
  86.           
  87.           HISTORY OF DEVELOPMENT:
  88.           
  89.               This program has  had  a  long  history.  It  was  originally 
  90.           written  for  Pascal  programs  by N.  Wirth using the "quadratic 
  91.           quotient" hash method.  It was adapted for UCSD Pascal (1.4 - the 
  92.           public  domain  version)  by  Shawn   Fanning   (in   1978)   and 
  93.           subsequently  adapted  for  Pascal/MT+  by Mike Lehman (in 1981).  
  94.           This version was then modified by Warren A.  Smith to try to  get 
  95.           back  to ISO standard Pascal and to add the additional feature of 
  96.           mapping out the compound statements.  It was modified  for  Turbo 
  97.           Pascal  by  Ron  Finger in July,  1984.  This last version of the 
  98.           program, at least, was named XLIST.  
  99.            
  100.               Further modifications were made by Larry Dodson in September, 
  101.           1985.   These  include  the  ability  to  handle  Include  files, 
  102.           expansion   of   the   identifier  field  from  eight  to  twelve 
  103.           characters,  optional  suppression  of  the  output  of  standard 
  104.           identifiers,  a margin on the left of the output to provide space 
  105.           to punch holes for a three-ring binder, and a compile time option 
  106.           of 66 or 88 lines per page.  In addition,  several comments  were 
  107.           added,  blocking  (for  readability)  was improved,  the name was 
  108.           changed from XLIST  to  XREF,  and  several  other  less  evident 
  109.           corrections  and  modifications were incorporated.  These changes 
  110.           were made and tested using Turbo Pascal (Version 2.0 for CP/M 80) 
  111.           on a Kaypro II with an Okidata 82 printer.  
  112.           
  113.               NXREF was then produced by  Don  Williams  as  practically  a 
  114.           complete  rewrite  of  XREF.  Binary  trees  were  used  for  the 
  115.           references rather than the 'quadratic quotient' used by XREF (the 
  116.           binary tree routines used,  however,  are simple  adaptations  of 
  117.           those  presented  by  N.  Wirth  in  his  excellent  book,  "Data 
  118.           Structures + Algorithms = Programs".) The program was modified to 
  119.           take advantage of the Turbo Pascal  3.0  Command  Line  parameter 
  120.           features.  The  case  structure  of  the  first  occurrence of an 
  121.           identifier  was  preserved  (XREF   and   XLIST   converted   all 
  122.           identifiers to upper case in the cross-reference.  
  123.  
  124.  
  125.  
  126.           
  127.               Use  of  the  binary  tree  routines  and  dynamic allocation 
  128.           allowed the maximum length of an identifier to be increased to 29 
  129.           bytes.  In NXREF,  this length  is  determined  by  the  printout 
  130.           format rather than the structure that holds the references.  
  131.           
  132.               Upon realizing that a similar facility would be useful for C 
  133.           programs, I modified NXREF into CXREF.  Since, from the viewpoint 
  134.           of structure and cross-reference, the differences between Pascal 
  135.           and C are slight, it was a relatively simple modification.
  136.           
  137.               CXREF200 and beyond have been converted to  C  with  CXREF200 
  138.           being  in Datalight C.  Future releases of this program may be in 
  139.           some other C source.  
  140.           
  141.           
  142.           
  143.           
  144.