Trailing-Edge
-
PDP-10 Archives
-
clisp
-
clisp/upsala/lclc.clisp
There are no other files named lclc.clisp in the archive.
;;; -*-Lisp-*-
;;;; this file is the loader for the compiler/lap package
(in-package "COMPILER" :nicknames '("CLC"))
(defun user::icc () (setq *package* (find-package "CLC")))
(export '(lisp::compile lisp::compile-file lisp::uncompile lisp::compiledp)
*lisp-package*)
;;; various kernel stuff mostly used by LAP
;;; internal functions used by lap to create the code:
(import 'lisp::%allocate-bps) ; rtns (consts . code) addrs
(import 'lisp::%sp-set-definition) ; of a fn, of course
(import 'lisp::%sp-get-value) ; of a spec var
(import 'lisp::%deposit-instruction)
;; the following two actually do exactly the same thing
(import 'lisp::%deposit-object-pointer) ; to a constant
(import 'lisp::%deposit-value-reference) ;to a special
(import 'lisp::%deposit-word) ; deposits bare binary wd
(import 'lisp::%function-address-block) ; for doing calls to the fn
(import 'lisp::%int-ent-tab) ; finds internal entry pts
;;; atoms we need EQ to the system ones
(import '(lisp::sym lisp::subr lisp::macro))
(shadowing-import
'(lisp::w2 lisp::w3 lisp::w4 lisp::o1 lisp::o2 lisp::o3 lisp::o4
lisp::o5 lisp::o6 lisp::sp))
(shadow '(n p q))
(setf (get 'n 'sym) (get 'lisp::%sp-n 'sym))
(setf (get 'p 'sym) (get 'lisp::%sp-p 'sym))
(setf (get 'q 'sym) (get 'lisp::%sp-q 'sym))
;;; various support entry points used by compiled code
(import '(lisp::%too-few-args lisp::%too-many-args lisp::ufo))
(import '(lisp::unbind lisp::ub1 lisp::ub2 lisp::ub3 lisp::ub4 lisp::ub5))
(import '(lisp::ccatch lisp::cthrow lisp::cunwind lisp::bindv))
(import '(lisp::rest1 lisp::rest2 lisp::rest3 lisp::rest4 lisp::rest5
lisp::restn lisp::restx lisp::get-key))
(import '(lisp::push-values lisp::pop-values lisp::values-to-list
lisp::values-call lisp::adjust-values))
(import '(lisp::mvp))
(import '(lisp::clogen lisp::alloc-closure-vector))
(defvar *clc-package* (find-package 'clc))
;;; These are added here after the compiler package has been defined. See
;;; MISC.CLISP for use of this var.
(setq lisp::*implementation-properties*
(append '(clc-transforms synonym assumed-expr
inline-expansion declared-function-type cg
recognized-declaration lisp::macro-in-compiler
lisp::constant-in-compiler cp1 cp2 pss1)
lisp::*implementation-properties*))
(defmacro pp (x)
"PPRINTS the SYMBOL-FUNCTION of x."
`(pprint (symbol-function ',x)))
(defun p1 (fun)
(laprint (get fun 'pss1) *standard-output*))
(load "lap.clisp" :verbose t)
(load "lap.lap" :verbose t)
;(load "analyze.lap" :verbose t) ; not needed anymore
(load "clc.lap" :verbose t)
(load "trans.lap" :verbose t)
(load "optimizer.lap" :verbose t)
;(save "clc.exe" "=*= compiled CLC =*=")