Scheme: Translate static data from C++ to XML

The C++ was extracted and munged with vim to make nice Scheme syntax elements before running this script.

(with-input-from-file "das.cpp"
(lambda ()
(do ((field-type (read) (read))
(field-length (read) (read))
(field-description (read) (read))
(bit-number (read) (read)))
((eof-object? field-type) #f)
[...]

June 23, 2009 • Tags: , , , • Posted in: Jigs • Comments Closed

Scheme: Graph lines of code in Subversion

This checks out every tenth version from SVN and produces a data file which can easily be used as input to gnuplot. You can see the final graph.

(module foo
(main main))
 
(define *new-test-regexp* (pregexp "^[ \t][ \t]*void\\s+test[A-Za-z_0-9]*\\s*\\(\\s*\\)"))
 
(define (is-test-header? filename)
(cond
((not (string-ci=? "h" (suffix filename)))
#f)
[...]

June 11, 2009 • Tags: , , , , • Posted in: Jigs • One Comment

Scheme: Save preprocessor output for all compiled files

This is a wrapper for the MSVC compiler (cl.exe) to generate a .i file as well as a .obj. Compiled with Bigloo.

(module cl-wrap
(main main))
 
(define (quote-args args)
(let loop ((args args)
(result ""))
(if (null? args)
result
[...]

June 7, 2009 • Tags: , , , , • Posted in: Jigs • Comments Closed