git.fiddlerwoaroof.com
src/ops-init.lisp
5092d8a5
 ;;; ****************************************************************
 ;;; OPS5 Interpreter ***********************************************
 ;;; ****************************************************************
 ;;; This Common Lisp version of OPS5 is in the public domain.  It is based
 ;;; in part on based on a Franz Lisp implementation done by Charles L. Forgy
 ;;; at Carnegie-Mellon University, which was placed in the public domain by
 ;;; the author in accordance with CMU policies.  Ported to Common Lisp by 
 ;;; George Wood and Jim Kowalski. CMU Common Lisp modifications by
 ;;; Dario Guise, Skef Wholey, Michael Parzen, and Dan Kuokka. 
 ;;; Modified to work in CLtL1, CLtL2 and X3J13 compatible lisps by 
 ;;; Mark Kantrowitz on 14-OCT-92.
 ;;; 
 ;;; This code is made available is, and without warranty of any kind by the
 ;;; authors or by Carnegie-Mellon University.
 ;;;
 
 ;;; 15-OCT-92 mk    Modified definition of RESET-OPS.
 
 (in-package "OPS")
 
 (defparameter *ops-version* "19-OCT-92")
 
 (defun ops-init ()
983cb74c
   ;; Allows ^ , { , and } operators to be right next to another symbol.
5092d8a5
   (set-macro-character #\{ #'(lambda (s c)
983cb74c
                                (declare (ignore s c))
                                '\{))
5092d8a5
   (set-macro-character #\} #'(lambda (s c)
983cb74c
                                (declare (ignore s c))
                                '\}))
5092d8a5
   (set-macro-character #\^ #'(lambda (s c)
983cb74c
                                (declare (ignore s c))
                                '\^))
5092d8a5
   (backup-init)
   (compile-init)
   (main-init)
   (match-init)
   (io-init)
   (rhs-init)
   (format t "~&Common Lisp OPS5 interpreter, version ~A.~&"
983cb74c
           *ops-version*))
5092d8a5
 
 (defun reset-ops ()
   "Clears the state of OPS to allow a new rule set to be loaded."
 
   ;; Tell the user what we're doing.
30f73e84
   (format t "~&Resetting OPS5 interpreter: 
5092d8a5
              ~&   deleting productions, working memory, etc.")
   (remove *)
   (ops-init)
   (clear-ops-hash-tables)
   ;; (i-g-v)
   (setq *class-list* nil
983cb74c
         *pcount* 0))
5092d8a5
 
 ;;; *EOF*