1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/mfs/pkgs/chicken/4.8.0.5/bin/csi -nbq
;; Usage: plot-code file1.scm,file2.scm *.scm > plot.dot
;; dot -Tpdf plot.dot > plot.pdf
(use regex srfi-69 srfi-13)
(define targs #f)
(define files (cddddr (argv)))
(let ((targdat (cadddr (argv))))
(if (equal? targdat "-")
(set! targs files)
(set! targs (string-split targdat ","))))
(define filedat-defns (make-hash-table))
(define filedat-usages (make-hash-table))
(define defn-rx (regexp "^\\s*\\(define\\s+\\(([^\\s\\)]+).*"))
(define all-regexs (make-hash-table))
(define all-fns '())
(define (print-err . data)
(with-output-to-port (current-error-port)
(lambda ()
(apply print data))))
(print-err "Making graph for files: " (string-intersperse targs ", "))
|
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/mfs/pkgs/chicken/4.8.0.5/bin/csi -nbq
;; Coming soon (right?) Usage: plot-code file1.scm,file2.scm "fun1,fun2,x*" *.scm > plot.dot
;; Usage: plot-code file1.scm,file2.scm *.scm > plot.dot
;; dot -Tpdf plot.dot > plot.pdf
;; first param is comma separated list of files to include in the map, use - to do all
;; second param is list of regexs for functions to include in the map
;; third param is list of files to scan
(use regex srfi-69 srfi-13)
(define targs #f)
(define files (cddddr (argv)))
(let ((targdat (cadddr (argv))))
(if (equal? targdat "-")
(set! targs files)
(set! targs (string-split targdat ","))))
(define filedat-defns (make-hash-table))
(define filedat-usages (make-hash-table))
(define defn-rx (regexp "^\\s*\\(define\\s+\\(([^\\s\\)]+).*"))
(define all-regexs (make-hash-table))
(define all-fns '())
;; for the se
(define (print-err . data)
(with-output-to-port (current-error-port)
(lambda ()
(apply print data))))
(print-err "Making graph for files: " (string-intersperse targs ", "))
|
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
(loop (car tal)
(cdr tal)
newres)))
(if (null? tal)
res
(loop (car tal)(cdr tal) res)))))
'()))
;; Gather the usages
(print "digraph G {")
(define curr-cluster-num 0)
(define function-calls '())
(for-each
(lambda (fname)
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
(loop (car tal)
(cdr tal)
newres)))
(if (null? tal)
res
(loop (car tal)(cdr tal) res)))))
'()))
;; (define mm-header #<<MMHEADER
;; <map version="freeplane 1.2.0">
;; <!--To view this file, download free mind mapping software Freeplane from http://freeplane.sourceforge.net -->
;;
;; MMHEADER
;;
;; (define (add-node text)
;; <node TEXT="homenode" ID="ID_1723255651" CREATED="1283093380553" MODIFIED="1417113442955"><hook NAME="MapStyle">
;; )
;;
;; minimal mindmap file
;; <map version="freeplane 1.2.0">
;; <!--To view this file, download free mind mapping software Freeplane from http://freeplane.sourceforge.net -->
;; <node TEXT="homenode" ID="ID_1723255651" CREATED="1283093380553" MODIFIED="1417113442955">
;; <node TEXT="node1" POSITION="right" ID="ID_1810107939" CREATED="1417113473476" MODIFIED="1417113480425">
;; <node TEXT="node2" ID="ID_68133256" CREATED="1417113482134" MODIFIED="1417113484466"/>
;; <node TEXT="node3" ID="ID_1572284821" CREATED="1417113487785" MODIFIED="1417113491589"/>
;; </node>
;; </node>
;; </map>
;; Gather the usages
(print "digraph G {")
(define curr-cluster-num 0)
(define function-calls '())
(for-each
(lambda (fname)
|