-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlambda.sml
35 lines (32 loc) · 1.02 KB
/
lambda.sml
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
(* lambda.sml
*
* The Lambda intermediate language of the MLPolyR compiler.
* Lambda is the output of the Translate phase.
*
* Copyright (c) 2005 by Matthias Blume (blume@tti-c.org)
*)
structure Lambda = struct
type lvar = LVar.lvar
type purity = Purity.purity
datatype value =
VAR of lvar
| LABEL of Label.label
| INT of LiteralData.integer
datatype exp =
VALUE of value
| LET of lvar * exp * exp
| FIX of function list * exp
| ARITH of Oper.arithop * exp * exp
| RECORD of { purity: purity, len: exp, slices: slice list }
| SELECT of exp * exp * purity
| UPDATE of exp * exp * exp
| CMP of Oper.cmpop * exp * exp * exp * exp
| APP of purity * exp * exp list
| HANDLER of lvar * lvar list * exp * exp
and slice =
SGT of exp
| SEQ of { base: exp, start: exp, stop: exp }
(* the boolean flag, when set to true, is a strong
* hint to have this function inlined *)
withtype function = lvar * lvar list * exp * bool
end