home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / idepth.icn < prev    next >
Text File  |  2001-05-02  |  799b  |  39 lines

  1. ############################################################################
  2. #
  3. #    File:     idepth.icn
  4. #
  5. #    Subject:  Program to report maximum recursion depth
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     May 2, 2001
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program processes trace output and reports the maximum depth of
  18. #  recursion.
  19. #
  20. ############################################################################
  21.  
  22. procedure main()
  23.    local i, max
  24.  
  25.    max := 0
  26.  
  27.    every !&input ? {
  28.       tab(upto('(')) ? {
  29.          i := 0
  30.          every find("| ") do
  31.             i +:= 1
  32.          max <:= i
  33.          }
  34.       }
  35.  
  36.    write(max)
  37.  
  38. end
  39.