Add the compilation function
This commit is contained in:
parent
92e42ef26e
commit
4d186e6b2b
1 changed files with 12 additions and 4 deletions
|
@ -22,11 +22,14 @@
|
|||
(define (new-addr)
|
||||
(gensym))
|
||||
|
||||
(: initial-dump Dump)
|
||||
(define initial-dump '())
|
||||
(: empty-dump Dump)
|
||||
(define empty-dump '())
|
||||
|
||||
(: initial-stats Stats)
|
||||
(define initial-stats 0)
|
||||
(: empty-stats Stats)
|
||||
(define empty-stats 0)
|
||||
|
||||
(: empty-stack Stack)
|
||||
(define empty-stack '())
|
||||
|
||||
(: incr-stats (-> Stats Stats))
|
||||
(define incr-stats add1)
|
||||
|
@ -52,3 +55,8 @@
|
|||
(let-values ([(new-heap addr) (allocate-node heap sc)])
|
||||
(values new-heap
|
||||
(update-globals globals (scdefn-name sc) addr)))))
|
||||
|
||||
(: compile-core (-> (Listof CoreScDefn) State))
|
||||
(define (compile-core scdefs)
|
||||
(let-values ([(heap globals) (initialize-heap scdefs)])
|
||||
(State empty-stack empty-dump heap globals empty-stats)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue