#! /bin/csh -f ########################################################################### # PROJECT: DEMETER # MODULE: GENERATION # FILE: cd-numbered-xref # SYSTEM: UNIX 4.3 BSD on sun #-------------------------------------------------------------------------- # COPYRIGHT (c) 1994 Demeter International, Inc. # #-------------------------------------------------------------------------- # AUTHOR: Thangaraj Veerappan (tsun@ccs.neu.edu) # INTEGRATOR: Walter Hursch # Mon Jan 17 14:36:32 1994 # $Log: cd-numbered-xref,v $ # Revision 5.5.1.1 1994/09/26 16:19:50 demeter # *** empty log message *** # # Revision 5.5 1994/09/26 16:19:49 demeter # *** empty log message *** # # Revision 5.4.1.1 1994/02/28 17:13:05 huersch # *** empty log message *** # # Revision 5.4 1994/02/28 17:13:05 huersch # *** empty log message *** # # Revision 5.3.1.1 1994/01/26 19:47:40 huersch # No changes. # # Revision 5.3 1994/01/26 19:47:39 huersch # *** empty log message *** # # Revision 5.2.1.1 1994/01/26 19:43:23 huersch # No changes. # # Revision 5.2 1994/01/26 19:43:21 huersch # *** empty log message *** # # Revision 5.1.1.4 1994/01/21 20:43:17 huersch # Updated output to have three sections: # cd, xref, sorted xref. # # Revision 5.1.1.3 1994/01/21 19:15:24 huersch # Converted to a free-standing tool; i.e., has to be called by hand. # # Revision 5.1.1.2 1994/01/19 16:39:16 huersch # Added log messages. # # #-------------------------------------------------------------------------- # DESCRIPTION: # # Cd-numbered-xref creates a file cd.numbered-xref that consists # of two sections. The first section is a list of cross reference # entries where each entry starts with a class name, the line number # in the cd.cd file where the class was defined and a list of # line numbers where the class name was used. # The second section consists of the same entries but sorted in # alphabetical order. # ########################################################################### #--------------------------------------------------------------------------- # command line evaluation # Test usage if ($#argv != 1) then echo "Usage: cd-numbered-xref " exit (1) endif # Evaluation if (! -f $1) then echo "cd-numbered-xref error: Cannot open or find $1." echo "" exit (1) endif #--------------------------------------------------------------------------- # Execution # Output file name (must coincide with the name in main.C) set NXREF = cd.numbered-xref set TMP = cd.numbered-xref.tmp # Execute program set PROGRAM = $0 set PROGRAM_NAME = $PROGRAM:t set PROGRAM_DIR = $PROGRAM:h setenv GEN_DIR $PROGRAM_DIR/util/$PROGRAM_NAME $GEN_DIR/`get-cpu`/run-exec $1 if ($status) exit (1) # Now print the whole file on the screen version > $TMP echo "" >> $TMP echo " CD-NUMBERED-XREF" >> $TMP echo " Create a numbered cross reference list for a class dictionary." >> $TMP echo "" >> $TMP echo "-------------------------------------------------------------" >> $TMP echo " Class Dictionary" >> $TMP echo "-------------------------------------------------------------" >> $TMP nl -ba $1 >> $TMP echo "" >> $TMP echo "-------------------------------------------------------------" >> $TMP echo " Cross Reference List" >> $TMP echo "-------------------------------------------------------------" >> $TMP cat $NXREF >> $TMP echo "" >> $TMP echo "-------------------------------------------------------------" >> $TMP echo " Alphabetically Sorted Cross Reference List" >> $TMP echo "-------------------------------------------------------------" >> $TMP sort $NXREF >> $TMP echo "" >> $TMP mv -f $TMP $NXREF fold -72 $NXREF