-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcogen-input-syntax
38 lines (36 loc) · 1.27 KB
/
cogen-input-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
E ::= K | (quote A) | (quasiquote A) | V | (if E E E) | (cond (E E)* (else E)?) |
(O E*) | (P E*) | (begin E*)
(let ((V E)*) D0* E*) | (let* ((V E)*) D0* E*) |
(letrec ((V (lambda (V*) E*))*) D0* E*) |
(let P ((V E)*) D0* E*) |
(do ((V E E)*) (E E*) E*) |
(case E ((A*) E*)* (else E*)?) |
(let-syntax ((P (syntax-rules (V*) R)))) |
(letrec-syntax ((P (syntax-rules (V*) R))*)) |
(lambda (V*) D0* E*) | (E E*) |
[ (lambda V D0* E*) | (lambda (V* . V) D0* E*) | ]
(C E*) | (Ci E) | (C? E) | % ctors, selectors, tests
(M E) | % memoization point
(set! V E) | (make-cell E) | (cell-ref E) | (cell-set! E E)
A ::= <datum> of R4RS
D0 ::= (define (P V*) D0* E*) |
(define P E) |
(define-without-memoization (P V*) D0* E*) |
(define-without-memoization P E)
D ::= D0 |
(begin D*) |
(load <string>) |
(define-data TC (C Ci*)+) |
(define-type (P B*) B) |
(define-primitive O T [dynamic|error|opaque|pure|apply]) |
(define-memo M <number>) |
(define-macro P (syntax-rules (V*) R))
R ::= <???> of R5RS
T ::= - | T0
T0 ::= (all TV T0) | (rec TV T0) | (TC T0*) | TV
TV type variable (must be bound by rec or all)
TC type constructor
B ::= * | d | -
prg ::= D+
S ::= (P G*) % syntax of the skeleton call
G ::= * | - | d | s | <number> | ((C G*)*) % binding times in the skeleton