in the middle of integrating the real parser/compiler with the rest of the runtime

This commit is contained in:
Danny Yoo 2011-05-12 01:58:05 -04:00
parent f16ffbc171
commit 03164578a4

View File

@ -5,9 +5,21 @@
"simulator-helpers.rkt"
"compiler.rkt"
"compiler-structs.rkt"
"parse.rkt"
#; "parse.rkt"
"parse-bytecode-5.1.1.rkt"
"il-structs.rkt")
(require (prefix-in racket: racket/base))
(define (parse stx)
(parameterize ([current-namespace (make-base-namespace)])
(let ([bc (racket:compile stx)]
[op (open-output-bytes)])
(write bc op)
(parse-bytecode
(open-input-bytes (get-output-bytes op))))))
(define (run-compiler code)
(compile (parse code) 'val next-linkage/drop-multiple))