home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
util
/
edit
/
jade
/
lisp
/
compiler.jlc
< prev
next >
Wrap
Text File
|
1994-10-16
|
18KB
|
485 lines
;;; Source file: /usr/local/lib/jade/3.2/lisp/compiler.jl
;;; Compiled by jsh@orcrist on Sun Oct 16 20:21:16 1994
;;; Jade 3.2
(provide (quote compiler))
(defvar comp-write-docs nil 92938)
(defconst op-call 8)
(defconst op-push 16)
(defconst op-vrefc 24)
(defconst op-vsetc 32)
(defconst op-list 40)
(defconst op-bind 48)
(defconst op-last-with-args 55)
(defconst op-vref 64)
(defconst op-vset 65)
(defconst op-fref 66)
(defconst op-fset 67)
(defconst op-init-bind 68)
(defconst op-unbind 69)
(defconst op-dup 70)
(defconst op-swap 71)
(defconst op-pop 72)
(defconst op-nil 73)
(defconst op-t 74)
(defconst op-cons 75)
(defconst op-car 76)
(defconst op-cdr 77)
(defconst op-rplaca 78)
(defconst op-rplacd 79)
(defconst op-nth 80)
(defconst op-nthcdr 81)
(defconst op-aset 82)
(defconst op-aref 83)
(defconst op-length 84)
(defconst op-eval 85)
(defconst op-plus-2 86)
(defconst op-negate 87)
(defconst op-minus-2 88)
(defconst op-product-2 89)
(defconst op-divide-2 90)
(defconst op-mod-2 91)
(defconst op-lognot 92)
(defconst op-not 93)
(defconst op-logior-2 94)
(defconst op-logand-2 95)
(defconst op-equal 96)
(defconst op-eq 97)
(defconst op-num-eq 98)
(defconst op-num-noteq 99)
(defconst op-gtthan 100)
(defconst op-gethan 101)
(defconst op-ltthan 102)
(defconst op-lethan 103)
(defconst op-inc 104)
(defconst op-dec 105)
(defconst op-lsh 106)
(defconst op-zerop 107)
(defconst op-null 108)
(defconst op-atom 109)
(defconst op-consp 110)
(defconst op-listp 111)
(defconst op-numberp 112)
(defconst op-stringp 113)
(defconst op-vectorp 114)
(defconst op-catch-kludge 115)
(defconst op-throw 116)
(defconst op-unwind-pro 117)
(defconst op-un-unwind-pro 118)
(defconst op-fboundp 119)
(defconst op-boundp 120)
(defconst op-symbolp 121)
(defconst op-get 122)
(defconst op-put 123)
(defconst op-error-pro 124)
(defconst op-signal 125)
(defconst op-return 126)
(defconst op-reverse 127)
(defconst op-nreverse 128)
(defconst op-assoc 129)
(defconst op-assq 130)
(defconst op-rassoc 131)
(defconst op-rassq 132)
(defconst op-last 133)
(defconst op-mapcar 134)
(defconst op-mapc 135)
(defconst op-member 136)
(defconst op-memq 137)
(defconst op-delete 138)
(defconst op-delq 139)
(defconst op-delete-if 140)
(defconst op-delete-if-not 141)
(defconst op-copy-sequence 142)
(defconst op-sequencep 143)
(defconst op-functionp 144)
(defconst op-special-form-p 145)
(defconst op-subrp 146)
(defconst op-eql 147)
(defconst op-logxor-2 148)
(defconst op-set-current-buffer 176)
(defconst op-swap-buffer 177)
(defconst op-current-buffer 178)
(defconst op-bufferp 179)
(defconst op-markp 180)
(defconst op-windowp 181)
(defconst op-swap-window 182)
(defconst op-last-before-jmps 250)
(defconst op-jmp 251)
(defconst op-jn 252)
(defconst op-jt 253)
(defconst op-jnp 254)
(defconst op-jtp 255)
(defconst comp-max-1-byte-arg 5)
(defconst comp-max-2-byte-arg 255)
(defconst comp-max-3-byte-arg 65535)
(defvar comp-constant-alist (quote nil))
(defvar comp-constant-index 0)
(defvar comp-current-stack 0)
(defvar comp-max-stack 0)
(defvar comp-output nil)
(defvar comp-output-pc 0)
(defvar comp-macro-env (quote nil))
(defvar comp-const-env (quote nil))
(defvar comp-top-level-compiled (quote (if cond when unless let let* catch unwind-protect error-protect with-buffer with-window progn prog1 prog2 while and or)) 93037)
(defun compile-file (file-name) 93150 (interactive "fLisp file to compile:") (jade-byte-code "DIIIII01234
F$þ#
F#þHH|HJE" [comp-const-env comp-macro-env form dst-file src-file open file-name "r" concat 99 "w" format ";;; Source file: %s
;;; Compiled by %s@%s on %s
;;; Jade %d.%d
" user-login-name system-name current-time-string major-version-number minor-version-number (jade-byte-code "uDI1J
H ]þ\\ F!þXL
ü3 F!ûELüD F!ûEIHþX
H
HûEv" [(jade-byte-code " H " [close dst-file src-file] 2) form message concat "Compiling " file-name "..." file-eof-p src-file read (defun defmacro defvar defconst require) comp-compile-top-form comp-top-level-compiled compile-form print dst-file write 10] 5) (error (jade-byte-code "D
3 þ EHt" [concat file-name 99 fname file-exists-p delete-file error error-info] 3)) 2] 9))
(defun compile-directory (dir-name &optional force-p exclude-list) 93272 (interactive "DDirectory of Lisp files to compile:
P") (jade-byte-code "D 2nþEL
þLlþ<DL
6
6
þ; EHMF\"HûHJE" [directory-files dir-name dir regexp-match "\\.jl$" exclude-list file-name-concat file concat 99 cfile file-newer-than-file-p compile-file] 3))
(defvar compile-lib-exclude-list (quote ("autoload.jl")))
(defun compile-lisp-lib (&optional force-p) 93522 (interactive "P") (jade-byte-code "DJ0E" [comp-write-docs compile-directory lisp-lib-dir force-p compile-lib-exclude-list] 4))
(put (quote compile-error) (quote error-message) "Compilation mishap")
(defun comp-error (&rest data) (jade-byte-code "}" [compile-error data] 2))
(defun comp-compile-top-form (form) (jade-byte-code "DL1aü2DP5þINHIOEHPQK MKKûñ aüpDQK P56
üW
OûaP
KKF$H P
MKKEûñaüDPUP66þqþQ NHPKKF&EHûñaüÖDP6þÃqþÐQ NEHûñaüäUHûñJüð ûñIE" [form fun defun 1 comp-macro-env tmp comp-compile-lambda lambda 2 defmacro code defconst 3 doc value comp-write-docs add-doc-string comp-const-env defvar require comp-error "Shouldn't have got here!"] 6))
(defun compile-form (form) 93772 (jade-byte-code "DII123456 Hþ\"
,E" [0 comp-output-pc comp-output comp-max-stack comp-current-stack comp-constant-index comp-constant-alist comp-compile-form form jade-byte-code comp-make-code-string comp-make-const-vec] 6))
(defun comp-make-code-string nil (jade-byte-code "D
nþLMLLRHMF$HûHE" [make-string comp-output-pc 42 comp-output data code-string] 3))
(defun comp-make-const-vec nil (jade-byte-code "D 34nþLMLLRHMF#HûHE" [make-vector comp-constant-index comp-constant-alist consts vec] 3))
(defun comp-inc-stack nil (jade-byte-code "hF dþF!" [comp-current-stack comp-max-stack] 2))
(defmacro comp-dec-stack (&optional n) (jade-byte-code "ü+û*+" [setq comp-current-stack n - 1-] 5))
(defun comp-compile-form (form) (jade-byte-code "Iaü Hû-Jaü Hû-yüfDI5 ü>
Hûb
F%üOM ûbJüa
HûbIEû-nü!DI6Lyþ}LzF&ü
û
F HLyþ LzF&ü¬
ûLF&HyüÀ ûénþÌLaüÚ ûéJüè
ûéIHMF HD6nþL Hh&MF HûôH
HXF&EEû-Jü, û-I" [form comp-write-op 73 comp-inc-stack 74 val const-variable-p 16 comp-add-constant symbol-value comp-const-env comp-compile-form 24 fun compile-fun funcall macroexpand comp-macro-env comp-compile-constant lambda comp-compile-lambda comp-error "Bad function name" 0 i 8 comp-current-stack] 5))
(defun comp-compile-constant (form) (jade-byte-code "
H" [comp-write-op 16 comp-add-constant form comp-inc-stack] 4))
(defun comp-add-constant (const) (jade-byte-code "MÿKK!hF\"Hi" [const comp-constant-alist comp-constant-index] 2))
(defun comp-compile-body (body) (jade-byte-code "lü Hû0nþ0L HMþ' HiF&HMF Hû" [body comp-write-op 73 comp-inc-stack comp-compile-form 72 comp-current-stack] 2))
(defun comp-compile-lambda (list) (jade-byte-code "DQI23Lqü+M#Pü\"P û%P+F\"û:Jü9P*F\"û:IHLLaþP L)
\"MF#H
K IK
E" [2 list new-head body lambda 1 comp-write-docs add-doc-string interactive nconc compile-form progn] 5))
(defmacro comp-make-label nil (jade-byte-code "" [(cons nil nil)] 1))
(defun comp-compile-jmp (opcode label) (jade-byte-code " HLpüLj HL_ û/Jü.MKOHVF%û/I" [comp-byte-out opcode label -8 255 comp-output-pc 2] 3))
(defun comp-set-label (label) (jade-byte-code "dþ HNHMF$Hnþ4jLK_LhKKK&MF$Hû" [comp-output-pc 65535 comp-error "Jump destination overflow!" label -8 255 comp-output] 3))
(defun comp-write-op (opco