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)
      (printf "<isofield id=\"~a\" length=\"~a\" name=\"~a\" pad=\"true\" class=\"org.jpos.iso.~a\"/>~n"
	     bit-number
	     field-length
	     field-description
	     field-type))))
Posted by: Jason Felice on June 23, 2009 • Tags: , , , • Posted in: Jigs

Comments are closed for this entry.