;;;; ;;;; extract-doc.stk -- Extrcat Documentation from STklos source files ;;;; ;;;; Copyright © 2000-2011 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2 of the License, or ;;;; (at your option) any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this program; if not, write to the Free Software ;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ;;;; USA. ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 24-Nov-2000 11:08 (eg) ;;;; Last file update: 20-Apr-2011 10:24 (eg) ;;;; (define start-doc-rgxp (string->regexp "^regexp "^ \\* *$")) (define end-doc-rgxp (string->regexp "^doc>")) ;====================================================================== ; ; parse-until-regexp ; ;====================================================================== (define (end-of-string s from) (let ((len (string-length s))) (substring s (min from len) len))) (define (parse-until in proc) (let ((result '())) (do ((l (read-line in) (read-line in))) ((or (eof-object? l) (proc l))) (set! result (if (null? result) (list (end-of-string l 3)) `(,(end-of-string l 3) "\n" ,@result)))) (apply string-append (reverse! result)))) ;====================================================================== ; ; parse-documentation-item ; ;====================================================================== (define (parse-documentation-item first-line in) (define (analyse-documentation-header first-line) (let ((in (open-input-string first-line)) (type #f) (l '())) (read in) ;; to skip "