-
Notifications
You must be signed in to change notification settings - Fork 0
/
cps.sig
executable file
·40 lines (36 loc) · 1.04 KB
/
cps.sig
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
signature CPS =
sig
type cont
type func
structure PrimOp:
sig
datatype t
= Print
| Add
| Sub
| Times
| Int2String
val pp: t -> unit
end
datatype t
= LetVal of string * v * t
| Let of string * int * string * t
| LetCont of cont * string * t * t
| ContApp of cont * string
| FuncApp of func * cont * string
| Case of string * cont * cont
| LetPrim of string * PrimOp.t * string list * t
(*let val x = option [x1, ...] in t*)
| If0 of string * cont * cont
| LetFix of func * cont * string * t * t
| Exit of string
and v
= Empty
| Num of int
| String of string
| Tuple of string list
| Tag of int * string
| FuncVal of cont * string * t
val dump2file : t * string -> unit
val pp : t -> unit
end