;;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10 -*- ;;;; --------------------------------------------------------------------------- ;;;; File name: reports.lsp ;;;; System: FIRE ;;;; Version: 1.0 ;;;; Author: Ken Forbus ;;;; Created: February 26, 2001 09:48:06 ;;;; Purpose: Report generators for FIRE ;;;; --------------------------------------------------------------------------- ;;;; Modified: Monday, February 26, 2001 at 09:59:01 by forbus ;;;; --------------------------------------------------------------------------- (in-package :common-lisp-user) ;;; These assume the HTML generators in expl-gen. (defun assertions->html-page (title assertions file) (with-open-file (fout file :direction :output) (html:with-document-head (fout) (format fout "~A" title)) (html:with-document-body (fout) (dolist (fact assertions) (html:with-preformatted (fout) (format fout "~A" (expl-gen:pretty-print-to-string fact))))))) (defun file-contents->list (file) (with-open-file (fin file :direction :input) (let ((ptr (cons nil nil))) (do ((form (read fin nil ptr) (read fin nil ptr)) (stuff nil)) ((eq ptr form) (nreverse stuff)) (push form stuff))))) ;;;; --------------------------------------------------------------------------- ;;; END OF CODE