;;; -*- Mode: Lisp;  Package: User; Base: 10. -*-
;;;
;;; Toplevel CT-ADA system loader.
;;; Richard Mark Soley, 8 February 1986
;;;
;;; Usage:
;;; (load "HOST: CT-ADA.TOOLS; LOAD-CTADA")
;;; (LOAD-CTADA)

(sstatus feature debugging)

(defvar *ctada-sys-host* (send fs:fdefine-file-pathname :host))

;;; Load up the compilation tools.
(load (format nil #+Symbolics "~A:>Ct-Ada>Tools>Comp"
	          #+LMI       "~A:CT-ADA.TOOLS;COMP"
		  #+TI        "~A:CT-ADA.TOOLS;COMP"
	      *ctada-sys-host*))

;;; Load up the CT_LOAD tools and the filemap
(load (format nil #+Symbolics "~A:>Ct-Ada>CTLisp>CTLoad"
	          #+LMI       "~A:CT-ADA.CTLISP;CTLOAD"
		  #+TI        "~A:CT-ADA.CTLISP;CTLOAD"
	      *ctada-sys-host*))

;;; Define the load completion function.
(defun load-ctada ()
  (pkg-goto 'USER)
  (send terminal-io :set-more-p nil)

  (format t "~2&Loading the interpreter.~%")
  (ct_load 'interp)

  ;; Must be written like this because adaf is a macro.
  (format t "~2&Initializing the interpreter.~%")
  (eval '(adaf "CT: INTERP; INITIAL.ADA"))

  (format t "~2&Loading the debugger.~%")
  (ct_load 'debugger)

  (format t "~2&Initializing the debugger.~%")
  (db%init_debugger)

  (format t "~2&Loading the editor.~%")
  (ct_load 'adamode)

  (format t "~2&Loading the browser.~%")
  (ct_load 'browser)

  ;; Must be written like this because the browser package doesn't exist yet.
  (format t "~2&Initializing the browser.~%")
  (funcall (intern "INIT-BROWSER" "BROWSER") #\B "CT: DOC; BROWSER;")

  (format t "~2&Loading the graph world system.~%")
  (load "CT: GRAPH; GRAPH-SYS")
  (make-system 'graph :noconfirm)

  ;; Must be written like this because the graph package doesn't exist yet.
  (format t "~2&Initializing the graph world system.~%")
  (funcall (intern "SETUP" "GRAPH")))


;;; Make the big lisp-listener, and call it.
(make-big-lisp-listener)
