;; Compiling Scheme Workshop (1996) expository Scheme compiler.

;; Copyright (c) 2007 David Van Horn
;; Licensed under the Academic Free License version 3.0

;; <dvanhorn@cs.brandeis.edu>

(module r4rs-compiler mzscheme
  (require (planet "record-case.ss" ("dvanhorn" "record-case.plt" 1 0))
           (lib "include.ss")
           (lib "pretty.ss"))

  (provide (all-defined))
  ;; Ignore all (load ---) expressions.
  (current-load (lambda (path module?) (values)))
  ;; scanparse.ss is modified by replacing the 3 free occurrences of
  ;; parse-error in the scan procedure with the bound scan-error,
  ;; which is clearly what was intended and is a bug in the original
  ;; code.
  (include "private/src/scanparse.ss")
  ;; front.ss needs pretty-print.
  (include "private/src/front.ss")
  ;; Not needed because the code is duplicated in back.ss.
  ;; (include "private/src/cg-help.ss")
  (include "private/src/back.ss")
  (define (nonnegative? n) (not (negative? n)))  ; Chezism.
  (define *reset* #f)                            ; set! by emu.ss.
  ;; emu.ss is modified by replacing (define emu-{code,stack,heap,cc}) with
  ;; (define emu-{code,stack,heap,cc} #f).  The definition of the procedure
  ;; sparc is commented out since it uses system and uses paths highly
  ;; unlikely to work.
  (include "private/src/emu.ss")
  ;; Chezisms.  Are these correct???
  (define (fxlogand fx1 fx2) (bitwise-and fx1 fx2))
  (define (fxlogor  fx1 fx2) (bitwise-ior fx1 fx2))
  (include "private/src/bitfield32.ss")
  ) ; end of module r4rs-compiler