mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 08:17:35 +02:00
WIP
This commit is contained in:
parent
709a13808d
commit
ff4e8bf3b9
4 changed files with 17 additions and 3 deletions
4
Makefile
4
Makefile
|
@ -24,6 +24,8 @@ SMODULES = \
|
||||||
scheme/read \
|
scheme/read \
|
||||||
scheme/time \
|
scheme/time \
|
||||||
scheme/write \
|
scheme/write \
|
||||||
|
scheme/cyclone/ast \
|
||||||
|
scheme/cyclone/optimize-cps \
|
||||||
scheme/cyclone/cgen \
|
scheme/cyclone/cgen \
|
||||||
scheme/cyclone/common \
|
scheme/cyclone/common \
|
||||||
scheme/cyclone/libraries \
|
scheme/cyclone/libraries \
|
||||||
|
@ -101,6 +103,8 @@ bootstrap: icyc
|
||||||
cp scheme/cyclone/common.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/common.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp icyc.scm $(BOOTSTRAP_DIR)
|
cp icyc.scm $(BOOTSTRAP_DIR)
|
||||||
cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
|
cp tests/unit-tests.scm $(BOOTSTRAP_DIR)
|
||||||
|
cp scheme/cyclone/ast.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
|
cp scheme/cyclone/optimize-cps.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/libraries.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/macros.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
cp scheme/cyclone/pretty-print.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
cp scheme/cyclone/pretty-print.c $(BOOTSTRAP_DIR)/scheme/cyclone
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
|
|
||||||
(define-library (ast)
|
(define-library (ast)
|
||||||
;(define-library (scheme cyclone ast)
|
;(define-library (scheme cyclone ast)
|
||||||
(import (scheme base))
|
(import (scheme base)
|
||||||
|
(scheme cyclone util)
|
||||||
|
)
|
||||||
(export
|
(export
|
||||||
ast:make-lambda
|
ast:make-lambda
|
||||||
ast:lambda?
|
ast:lambda?
|
||||||
|
@ -20,10 +22,14 @@
|
||||||
ast:se-lambda-body!
|
ast:se-lambda-body!
|
||||||
)
|
)
|
||||||
(begin
|
(begin
|
||||||
|
(define *lambda-id* 0)
|
||||||
(define-record-type <lambda-ast>
|
(define-record-type <lambda-ast>
|
||||||
(ast:make-lambda id args body)
|
(ast:%make-lambda id args body)
|
||||||
ast:lambda?
|
ast:lambda?
|
||||||
(id ast:lambda-id)
|
(id ast:lambda-id)
|
||||||
(args ast:lambda-args ast:set-lambda-args!)
|
(args ast:lambda-args ast:set-lambda-args!)
|
||||||
(body ast:lambda-body ast:se-lambda-body!))
|
(body ast:lambda-body ast:se-lambda-body!))
|
||||||
|
(define (ast:make-lambda args body)
|
||||||
|
(set! *lambda-id* (+ 1 *lambda-id*))
|
||||||
|
(ast:%make-lambda *lambda-id* args body))
|
||||||
))
|
))
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
(newline))
|
(newline))
|
||||||
|
|
||||||
|
|
||||||
(define l (ast:make-lambda 0 '() '((write 1) (write 2) (write 3))))
|
(define l (ast:make-lambda '() '((write 1) (write 2) (write 3))))
|
||||||
(write l)
|
(write l)
|
||||||
(newline)
|
(newline)
|
||||||
|
(set! l (ast:make-lambda '() '((write 1) (write 2) (write 3))))
|
||||||
|
(write `(l is now ,l))
|
||||||
|
(newline)
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
(scheme file)
|
(scheme file)
|
||||||
(scheme read)
|
(scheme read)
|
||||||
(scheme write)
|
(scheme write)
|
||||||
|
(scheme cyclone ast)
|
||||||
(scheme cyclone common)
|
(scheme cyclone common)
|
||||||
(scheme cyclone libraries)
|
(scheme cyclone libraries)
|
||||||
(scheme cyclone macros)
|
(scheme cyclone macros)
|
||||||
|
|
Loading…
Add table
Reference in a new issue