-
Notifications
You must be signed in to change notification settings - Fork 1
/
nodes.scm
54 lines (35 loc) · 1.38 KB
/
nodes.scm
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;;
;; node types
;;
(declare (unit nodes))
(include "struct-syntax")
;; HLIL: A basic lambda language
(define-struct if (test conseq altern))
(define-struct lambda (name args body free-vars))
(define-struct comb (args))
(define-struct constant (value))
(define-struct variable (name))
(define-struct fix (defs body))
(define-struct prim (name args result cexp))
(define-struct nil ())
;; LLIL: A mc executable language
;;; this language borrows <constant>, <variable> , and <if> from HLIL, for they have the same semantics at this level.
;;; A label for a block of code
(define-struct label (name))
;;; Function application. The compiler overloads this operation for primitive application.
;;; This operation never returns, but merely passes control to its continuation
(define-struct app (name args))
;;; Selects a value from a record and binds it to 'name in the continuation expression 'cexp
(define-struct select (index record name cexp))
;;; Creates a record from a list of values and binds it to 'name in cexp
(define-struct record (values name cexp))
(define-struct block (label code))
(define-struct module (contexts))
(define-struct context (formals start blocks))
(define-struct arch-descriptor
(make-context
operand-format
vregs-read
vregs-written
generate-bridge-context
emit-statement))