Skip to content

Commit

Permalink
Committing my changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm committed Apr 25, 2012
1 parent 106c596 commit 5c78158
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions swigls-compiler/base.rkt
@@ -1,6 +1,7 @@
#lang racket

(provide (all-defined-out))
(require racket/pretty)

;;make hash table
(define GENSYM-TABLE (make-hash))
Expand Down Expand Up @@ -93,3 +94,8 @@
;; - a list of one or more expressions
(struct seq (expressions)
#:inspector (make-inspector))

(define (show e)
(pretty-print e)
(newline)
e)
1 change: 1 addition & 0 deletions swigls-compiler/create_id_list.rkt
Expand Up @@ -4,6 +4,7 @@
(require "base.rkt")
(provide create-ids)


;; PURPOSE
;; Take in the structures from the previous pass
;; and produce a list of structures (broken down into the simple forms)
Expand Down
14 changes: 14 additions & 0 deletions swigls-compiler/driver.rkt
Expand Up @@ -18,11 +18,25 @@
)
(let ([interim 0]
[asm ""])
(printf "parse~n")
(set! interim (parse sexp))
(show interim)

(printf "remove mult~n")
(set! interim (remove-mult interim))
(show interim)

(printf "remove while~n")
(set! interim (removewhile interim))
(show interim)

(printf "remove if~n")
(set! interim (removeif interim))
(show interim)

(printf "create-ids~n")
(set! interim (create-ids interim))
(show interim)
(set! asm (pass-to-asm interim))
(let ([op (open-output-file
(string-append file-base ".hack")
Expand Down

0 comments on commit 5c78158

Please sign in to comment.