home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / snobol / aisnobol / buildlib.sno < prev    next >
Text File  |  1987-10-08  |  530b  |  27 lines

  1. *    BUILDLIB.SNO
  2. *
  3. *    Build index to functions in INPUT to file OUTPUT.
  4. *
  5. -PLUSOPS 1
  6.  
  7.     &TRIM = 1
  8.     &ANCHOR = 1
  9.  
  10.     PAT = (ANY(&UCASE) (BREAK(' ' CHAR(9)) | REM)) . LABEL
  11.  
  12. * Scan for starting label, noting file position preceeding label.
  13. *
  14. LOOP    FILE_POS = TELL(5)
  15.     LINE = INPUT                :F(END)
  16.     LINE ? PAT                :F(LOOP)
  17.  
  18. * Found the start of a function.  Record it.
  19.     OUTPUT = LABEL ',' FILE_POS
  20.  
  21. * Scan for end of function
  22.     END_PAT = LABEL '.END'
  23. LOOP2    LINE = INPUT                :F(END)
  24.     LINE ? END_PAT                :F(LOOP2)S(LOOP)
  25.  
  26. END
  27.