(FILECREATED " 2-Dec-85 12:48:06" {DSK}<LISPFILES>CML>CMLSOURCEMETRICS.;6 2617   

      changes to:  (FNS INTERLISPSOURCEMETRICS CMLSOURCEMETRICS SOURCECOMPLEXITY)
		   (VARS CMLSOURCEMETRICSCOMS)

      previous date: "25-Nov-85 17:43:24" {DSK}<LISPFILES>CML>CMLSOURCEMETRICS.;1)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT CMLSOURCEMETRICSCOMS)

(RPAQQ CMLSOURCEMETRICSCOMS ((FNS CMLSOURCEMETRICS INTERLISPSOURCEMETRICS)))
(DEFINEQ

(CMLSOURCEMETRICS
  [LAMBDA (PATTERN)                                          (* raf "27-Nov-85 15:50")
    (bind STR NF FLS for FILE in (FILDIR PATTERN)
       do (RESETLST [RESETSAVE NIL (LIST (QUOTE CLOSEF?)
						 (SETQ STR (OPENSTREAM FILE (QUOTE INPUT)
									   (QUOTE OLD]
			(SETQ NF (NAMEFIELD FILE))
			(push FLS NF)
			(PRINTOUT T NF ": ")
			(bind DEFS (COUNTSUM ← 0) while (FILEPOS "
(def" STR)
			   do (READC STR)
				(LET* ((DEFFORM (READ STR CMLRDTBL))
				       (DEFD (CADR DEFFORM)))
				      (if (LISTP DEFD)
					  then (SETQ DEFD (CAR DEFD)))
				      (PRINTOUT T DEFD " ")
				      (if (SYMBOLP DEFD)
					  then (INCR COUNTSUM (PUTPROP
							 DEFD
							 (MKATOM (CONCAT "COUNT-" (CAR DEFFORM))
								   )
							 (COUNT DEFFORM)))
						 (push DEFS DEFD)))
			   finally (PUTPROP NF (QUOTE DEFS)
						DEFS)
				     (PUTPROP NF (QUOTE TOTAL-COUNT)
						COUNTSUM))
			(PRINTOUT T T))
       finally (RETURN FLS])

(INTERLISPSOURCEMETRICS
  [LAMBDA (FILELIST)                                         (* raf " 2-Dec-85 11:19")
    (for FILE in FILELIST
       do (PRINTOUT T FILE ": " T)
	    (bind (COUNTSUM ← 0)
		    NAMES for TYPE in (QUOTE (VARS FNS MACROS))
	       do (SETQ NAMES (FILECOMSLST FILE TYPE))
		    (PRINTOUT T TYPE ": ")
		    (for NAME in NAMES do [LET ((DEF (GETDEF NAME TYPE FILE)))
						     (PRINTOUT T NAME " ")
						     (INCR COUNTSUM (PUTPROP NAME
									       (MKATOM
										 (CONCAT "COUNT-" 
											   TYPE))
									       (COUNT DEF]
		       finally (PUTPROP FILE (MKATOM (CONCAT "DEFS-" TYPE))
					    NAMES))
	       finally (PUTPROP FILE (QUOTE TOTAL-COUNT)
				    COUNTSUM)
			 (PRINTOUT T T))
	    (PRINTOUT T T)
       finally (RETURN FILELIST])
)
(PUTPROPS CMLSOURCEMETRICS COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (477 2530 (CMLSOURCEMETRICS 487 . 1621) (INTERLISPSOURCEMETRICS 1623 . 2528)))))
STOP