3 ;;; Output driver for SOD translator
5 ;;; (c) 2009 Straylight/Edgeware
8 ;;;----- Licensing notice ---------------------------------------------------
10 ;;; This file is part of the Simple Object Definition system.
12 ;;; SOD is free software; you can redistribute it and/or modify
13 ;;; it under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 2 of the License, or
15 ;;; (at your option) any later version.
17 ;;; SOD is distributed in the hope that it will be useful,
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with SOD; if not, write to the Free Software Foundation,
24 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 ;;;--------------------------------------------------------------------------
29 ;;; Sequencing machinery.
31 (defclass sequencer-item ()
32 ((name :initarg :name :reader sequencer-item-name)
33 (functions :initarg :functions :initform nil
34 :type list :accessor sequencer-item-functions))
36 "Represents a distinct item to be sequenced by a SEQUENCER.
38 A SEQUENCER-ITEM maintains a list of FUNCTIONS which are invoked when the
39 sequencer is invoked. This class is not intended to be subclassed."))
41 ;;;--------------------------------------------------------------------------
42 ;;; Output preparation.
44 (defvar *seen-announcement*) ;Keep me unbound!
46 (defmethod add-output-hooks :around (object reason sequencer &rest stuff)
47 "Arrange not to invoke any object more than once during a particular
49 (declare (ignore stuff))
50 (cond ((not (boundp '*seen-announcement*))
51 (let ((*seen-announcement* (make-hash-table)))
52 (setf (gethash object *seen-announcement*) t)
54 ((gethash object *seen-announcement*)
57 (setf (gethash object *seen-announcement*) t)
60 ;;;--------------------------------------------------------------------------
63 ;;;----- That's all, folks --------------------------------------------------