home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
mitsch75.zip
/
scheme-7_5_17-src.zip
/
scheme-7.5.17
/
src
/
compiler
/
machines
/
C
/
compiler.sf
< prev
next >
Wrap
Text File
|
1999-01-02
|
3KB
|
75 lines
#| -*-Scheme-*-
$Id: compiler.sf,v 1.6 1999/01/02 06:06:43 cph Exp $
Copyright (c) 1992-1999 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|#
;;;; Script to incrementally syntax the compiler
(load-option 'CREF)
;; Guarantee that the compiler's package structure exists.
(if (not (name->package '(COMPILER)))
(begin
;; If there is no existing package constructor, generate one.
(if (not (file-exists? "compiler.bco"))
(begin
((access cref/generate-trivial-constructor
(->environment '(CROSS-REFERENCE)))
"compiler")
(sf "compiler.con")))
(load "compiler.bco")))
;; Guarantee that the necessary syntactic transforms and optimizers
;; are loaded.
(if (lexical-unreferenceable? (->environment '(COMPILER)) 'SYNTAX-FILES!)
(let ((sf-and-load
(lambda (files package)
(sf-conditionally files)
(for-each (lambda (file)
(load (string-append file ".bin") package))
files))))
(load-option 'HASH-TABLE)
(write-string "\n\n---- Loading compile-time files ----")
(sf-and-load '("base/switch") '(COMPILER))
(sf-and-load '("base/macros") '(COMPILER MACROS))
((access initialize-package! (->environment '(COMPILER MACROS))))
(sf-and-load '("machines/C/decls") '(COMPILER DECLARATIONS))
(let ((environment (->environment '(COMPILER DECLARATIONS))))
(set! (access source-file-expression environment) "*.scm")
((access initialize-package! environment)))
(sf-and-load '("base/pmlook") '(COMPILER PATTERN-MATCHER/LOOKUP))
(sf-and-load '("base/pmpars") '(COMPILER PATTERN-MATCHER/PARSER))
(sf-and-load '("rtlbase/valclass") '(COMPILER))
(fluid-let ((sf/default-syntax-table
(access compiler-syntax-table
(->environment '(COMPILER MACROS)))))
(sf-and-load '("machines/C/machin") '(COMPILER)))
(set! (access endianness (->environment '(COMPILER))) 'BIG)
(sf-and-load '("back/syntax")
'(COMPILER LAP-SYNTAXER))
(sf-and-load '("base/scode") '(COMPILER))
(sf-and-load '("base/pmerly") '(COMPILER PATTERN-MATCHER/EARLY))))
;; Resyntax any files that need it.
((access syntax-files! (->environment '(COMPILER))))
;; Rebuild the package constructors and cref.
(cref/generate-constructors "compiler")
(sf "compiler.con")
(sf "compiler.ldr")