dist_pkglispsrc_DATA += sod-frontend.asd
dist_pkglispsrc_DATA += frontend.lisp optparse.lisp
+## Interactive testing.
+dist_pkglispsrc_DATA += debug.lisp
+
###--------------------------------------------------------------------------
### Constructing an output image.
--- /dev/null
+;;; -*-lisp-*-
+;;;
+;;; Debugging utilities for Sod
+;;;
+;;; (c) 2015 Straylight/Edgeware
+;;;
+
+;;;----- Licensing notice ---------------------------------------------------
+;;;
+;;; This file is part of the Sensble Object Design, an object system for C.
+;;;
+;;; SOD 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.
+;;;
+;;; SOD 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 SOD; if not, write to the Free Software Foundation,
+;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+(cl:in-package #:sod)
+
+(export 'test-module)
+(defun test-module (path reason)
+ "Reset the translator's state, read a module from PATH and output it with
+ REASON, returning the result as a string."
+ (unless *builtin-module* (make-builtin-module))
+ (clear-the-decks)
+ (setf *module-map* (make-hash-table :test #'equal))
+ (with-output-to-string (out)
+ (output-module (read-module path) reason out)))
+
+;;;----- That's all, folks --------------------------------------------------
("classes" "class-layout-proto" "class-layout-impl"
"method-proto" "method-impl" "output-proto"))))
+ ;; Debugging and interactive testing.
+ (:file "debug" :depends-on ("builtin" "module-output"))))
+
;;;--------------------------------------------------------------------------
;;; Testing.