home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 181_01 / cugutl.doc < prev    next >
Text File  |  1984-01-17  |  7KB  |  207 lines

  1.                           C U G I N S
  2.  
  3. The CUGINS program allows users to insert a HEADER TEMPLATE in a
  4. series of files. A common example is program made up of many source
  5. modules (i.e. YACC has 53 Source Modules and 2 Document Modules),
  6. the CUG headers on these types of files are identical except
  7. for the Filename entry.
  8.  
  9. To use this program the user must provide a HEADER TEMPLATE and a
  10. list of the files to be processed.
  11.  
  12. The following is a example of such a Template:
  13.  
  14.  
  15. /*
  16.   HEADER: CUG    nnn.nn;
  17.   TITLE:         YACC - Yet Another Compilier-Compilier
  18.   VERSION:       1.0 for IBM-PC
  19.   DATE:          Sep 20, 195
  20.   DESCRIPTION:   LALR(1) Parser Generator. From UNIX
  21.   KEYWORDS:      Parser Generator Compilier-Compilier YACC
  22.   SYSTEM:        IBM-PC and Compatiables
  23.   FILENAME:
  24.   WARNINGS:      This program is not for the casual user. It will
  25.                  be useful primarily to expert developers.
  26.   CRC:           N/A
  27.   SEE-ALSO:      LEX and PREP
  28.   AUTHORS:       Scott Guthery 11100 leadfwood lane Austin, TX 78750
  29.   COMPILERS:     DESMET-C
  30.   REFERENCES:    UNIX Systems Manuals
  31. */
  32.  
  33. Notice that the Filename entry is blank. This entry is automatically
  34. filled in by the CUGINS Program. The Replacement Offset Parameter is
  35. used to insure that the replacement text will be insert in the correct
  36. place. In the case of example Template, the offset would be 6. This
  37. would insure that the replacement text lined up with the other data.
  38.  
  39. The list of files to be processed can be generated by any editor. The
  40. general practice for a large number of files is to cause the DIR
  41. command to write a directory to disk and then use an editor to clean
  42. up the file for use by CUGINS. The file names must be listed one
  43. per line and can be any legal file expression recognized by DOS.
  44.  
  45. To generate a directory on disk:
  46.  
  47.                  B> DIR >DIR.DAT
  48.  
  49. The resulting disk file would look something like the following:
  50.  
  51.  Volume in drive B has no label
  52.  Directory of  B:\
  53.  
  54. CUGINS   PAS     7132   1-08-84   6:09p
  55. HEADER   DAT      642   1-08-84   5:12p
  56. REST     BAT       89   1-07-84   8:41p
  57. CUGINS   COM    14256   1-08-84   6:09p
  58. LIST     DAT       19   1-08-84   6:11p
  59. Y1IMP    C        712   1-08-84   6:14p
  60. Y2IMP    C        712   1-08-84   6:14p
  61. TURBOF3  MAC      319   1-08-84   7:42p
  62. Y1IMP    CAK       57   1-08-84   6:00p
  63. Y2IMP    CAK       57   1-08-84   6:00p
  64. CUGINS   BAK     1131   1-08-84   7:56p
  65. CUGINS   DOC     1893   1-08-84   8:05p
  66. DIR      DAT        0   1-08-84   8:05p
  67.        13 File(s)    320512 bytes free
  68.  
  69. After cleaning the file up we could be left with:
  70.  
  71. Y1IMP.C
  72. Y2IMP.C
  73. Y3IMP.C
  74.  
  75.  
  76.                      ===============================
  77.  
  78. Now that the two data files we need have been created, the program
  79. is executed as follows:
  80.  
  81. B> CUGINS list.dat header.dat 6
  82.  
  83. The file "list.dat" contains the list of files to be processed.
  84. The file "header.dat" contains the HEADER TEMPLATE Data.
  85. The third parameter, "Replacement Offset", is optional. If missing
  86. it has the value of ONE(1).
  87.  
  88. If the "list.dat" or "header.dat" are not present, the user will
  89. be requested to enter the correct file name.
  90.  
  91. Once the file list, "list.dat", and the HEADER TEMPLATE, "header.dat",
  92. have been successfully loaded, the program will begin processing the
  93. files in "list.dat". As each file is processed it's file specification
  94. will be printed on the users terminal.
  95.  
  96. With the list specified above, the following would appear on the
  97. users terminal:
  98.  
  99. B> CUGINS list.dat header.dat 6
  100. Y1IMP.C
  101. Y2IMP.C
  102. Y3IMP.C
  103.  
  104. If the user enters CUGINS without the correct number of parameters
  105. (2 or 3), the program will simply print out a brief usage description,
  106. distribution rights and my copyright notice.
  107.  
  108.  
  109.                           C U G E D T
  110.  
  111.  
  112. This program, CUGEDT, will allow a user to edit an entries in the CUG
  113. Headers on a whole series modules.
  114.  
  115. It works almost the same as CUGINS described above, with the following
  116. glaring differences.
  117.  
  118.     1) The program name is CUGEDT,  NOT CUGINS!   (Rather Obvious)
  119.     2) The HEADER TEMPLATE File is now called an EDIT File.
  120.     3) The first two lines of the EDIT File specify the starting
  121.        element of the area in the CUG file to be deleted (first line)
  122.        and the element following the deleted area. (ie. The ending
  123.        element is not deleted!)
  124.     4) Line 3 through the last line comprise the text that will be
  125.        inserted in place of the deleted text.
  126.  
  127.  
  128. When this program is run, all files in the input file list will be
  129. processed as follows:
  130.  
  131.     1) If the Starting Text key (Line one in the EDIT File) is found
  132.        in the text file, all text including the start line will be
  133.        deleted up to, but not including, the termination line (line
  134.        two in the EDIT File).
  135.     2) The replacement text (Lines 3 through "n") will be inserted
  136.        in the text file IN FRONT OF THE TERMINATION LINE.
  137.  
  138.  
  139. For example, if the CUG Header looks the same as the one shown above,
  140. then the following EDIT File would replace the compilier information
  141. element.
  142.  
  143.                              EDIT File
  144.  
  145.  
  146. COMPILERS:
  147. REFERENCES:
  148.   COMPILERS:     DESMET-C
  149.                  CI-86
  150.                  LATTICE
  151.  
  152.  
  153. After running CUGEDT (i.e.  CUGEDT FILE.LST EDIT.FIL<CR> ) the header
  154. shown above would look as follows:
  155.  
  156.  
  157. /*
  158.   HEADER: CUG    nnn.nn;
  159.   TITLE:         YACC - Yet Another Compilier-Compilier
  160.   VERSION:       1.0 for IBM-PC
  161.   DATE:          Sep 20, 195
  162.   DESCRIPTION:   LALR(1) Parser Generator. From UNIX
  163.   KEYWORDS:      Parser Generator Compilier-Compilier YACC
  164.   SYSTEM:        IBM-PC and Compatiables
  165.   FILENAME:
  166.   WARNINGS:      This program is not for the casual user. It will
  167.                  be useful primarily to expert developers.
  168.   CRC:           N/A
  169.   SEE-ALSO:      LEX and PREP
  170.   AUTHORS:       Scott Guthery 11100 leadfwood lane Austin, TX 78750
  171.   COMPILERS:     DESMET-C
  172.                  CI-86
  173.                  LATTICE
  174.   REFERENCES:    UNIX Systems Manuals
  175. */
  176.  
  177.  
  178. AUTHOR: C.E. Thornton [ Box 55085 Houston, TX 77255: (713) 467-1651) ]
  179.  
  180. APPLICATION: Setting up CUG Disks for their library
  181.  
  182. DATE:   Sept 29, 1985
  183.  
  184. NOTE: This software may be freely distributed and used by non-commerical
  185.       users. Users Groups and Clubs may charge reasonable (less than $15)
  186.       distribution fees. Contributions are always gratefully recieved.
  187.  
  188.  
  189.  
  190.                   G E N E R A L   I N F O R M A T I O N
  191.  
  192.  
  193. If you have any questions, feel free to call the number below at anytime
  194. between 8:00pm and 11:00pm weekdays and any reasonable time on weekends.
  195.  
  196. This program is written in Turbo PASCAL and the source is available for
  197. one 5 1/4 inch floppy disk and $5.00.
  198.  
  199.  
  200. C.E. Thornton
  201. PASCAL/"C" LIBRARIAN
  202. P.O. Box 55085
  203. Houston, Tx   77255
  204. (713) 467 - 1651
  205.  
  206. >>>> Copyright Sept 1985 by C.E. Thornton
  207.