      SUBROUTINE PC.INSTRUMENT(PGM.FILE,PGM.ID)
*PRE-COMPILER
*
*DEV TRIAL RT
*BASIC
*N
*     PRECISION 6
*
************************************************************************
************************************************************************
***                                                                  ***
*** PICK PARSING PRE-COMPILER SYSTEM                                 ***
***                                                                  ***
*** COPYRIGHT 1988 MODULAR SOFTWARE                                  ***
***                P.O. BOX 204                                      ***
***                ATLANTA, GA  30291                                ***
***                (404) 964 - 7171                                  ***
***                                                                  ***
*** THIS PROGRAM IS PROPRIETARY TO MODULAR SOFTWARE AND MAY NOT BE   ***
*** USED, COPIED, EXAMINED, OR DISCLOSED WITHOUT A VALID LICENSE     ***
*** FROM MODULAR SOFTWARE.                                           ***
***                                                                  ***
************************************************************************
************************************************************************
*
*
* Pre-compiler recursive compiler driver for a single item
*
*
      $INCLUDE PC.COMMON
*
      SKIP.FLG = YES
      FIRST.FLG = YES
      MAT DATA.ARRAY = ''
      INCL.STR = 'N$='
      INCL.STR2 = ';GOSUB 76431;'
*
      READ DATA FROM DEST.FD , PGM.ID THEN
         NO.LINES = DCOUNT(DATA,AM)
         IF LEN(DATA) <= 15000 AND NO.LINES <= 1000 THEN
            DATA = ''
            MATREAD DATA.ARRAY FROM DEST.FD , PGM.ID THEN
               FOR L.NO = 1 TO NO.LINES
                  LINE = DATA.ARRAY(L.NO)
                  GOSUB 100
                  DATA.ARRAY(L.NO) = LINE
               NEXT L.NO
               MATWRITE DATA.ARRAY ON DEST.FD , PGM.ID
            END
         END ELSE
            FOR L.NO = 1 TO NO.LINES
               READV LINE FROM DEST.FD , PGM.ID , L.NO THEN
                  GOSUB 100
                  WRITEV LINE ON DEST.FD , PGM.ID , L.NO
               END
            NEXT L.NO
         END
*
         X = '76431 WRITEV "'
         X = X : PGM.FILE : VM : PGM.ID : VM
         X = X : '" : N$ ON PL$STATE.FD , "RUN*" : PL$V.PORT.NO , 1 ; RETURN'
         WRITEV X ON DEST.FD , PGM.ID , -1
*
      END
*
      DATA = ''
      MAT DATA.ARRAY = ''
*
      RETURN
*
100   REM PROCESS LINE
*
      LL = OCONV(LINE,'MCU')
*
      BEGIN CASE
         CASE NOT(FIRST.FLG)
         CASE LL[1,1] = '*'
         CASE LL[1,8] = 'INCLUDE '
         CASE LL[1,9] = '$INCLUDE '
         CASE LL[1,11] = 'SUBROUTINE '
         CASE LL[1,7] = 'EQUATE '
         CASE YES
            FIRST.FLG = NO
      END CASE
*
      IF FIRST.FLG THEN RETURN
*
      W = FIELD(LL,' ',2)
      BEGIN CASE
         CASE FIELD(LL,' ',1) MATCHES '1N0N'
            SKIP.FLG = YES
         CASE LL[1,1] = '*'
         CASE LL[1,10] = 'BEGIN CASE'
            SKIP.FLG = YES
         CASE LL[1,8] = 'INCLUDE '
            SKIP.FLG = YES
         CASE LL[1,5] = 'CASE '
            SKIP.FLG = YES
         CASE YES
            SKIP.FLG = NO
      END CASE
*
      IF NOT(SKIP.FLG) AND LL[1,1] <> '*' THEN
         LINE = INCL.STR : L.NO : INCL.STR2 : LINE
      END
*
      RETURN
   END
