21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
;; 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 (cdr (cddddr (argv))))
(let ((targdat (cadddr (argv))))
(if (equal? targdat "-")
(set! targs files)
(set! targs (string-split targdat ","))))
(define function-patt (car (cdr (cdddr (argv)))))
(define function-rx (regexp function-patt))
(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))
|
|
>
>
>
>
>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
<
|
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
;; 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-1 srfi-13)
(module plot-code
*
(import scheme chicken.base chicken.port chicken.string chicken.io)
(import chicken.process-context)
(import regex srfi-1 srfi-69 srfi-13 matchable)
(define files #f)
(define targs #f)
(define function-patt #f)
(define targs #f)
(match (command-line-arguments)
((targfiles fnrx . scanfiles)
(set! targs (string-split-fields "," targfiles #:infix))
(set! function-patt fnrx)
(set! files scanfiles))
(else
(print "Usage: plot-code file1.scm,file2.scm *.scm > plot.dot
dot -Tpdf plot.dot > plot.pdf")
(exit)))
;; (define files (cdr (cddddr (argv))))
;;
;; (let ((targdat (cadddr (argv))))
;; (if (equal? targdat "-")
;; (set! targs files)
;; (set! targs (string-split targdat ","))))
(define function-rx (regexp function-patt))
(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))
|
195
196
197
198
199
200
201
|
"\"" fnname "\" -> \"" callname "\";"))
calls)))
function-calls)
(print "}")
(exit)
|
>
|
215
216
217
218
219
220
221
222
|
"\"" fnname "\" -> \"" callname "\";"))
calls)))
function-calls)
(print "}")
(exit)
)
|