Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/compiler/FLINT/flint/flint.sig
ViewVC logotype

Annotation of /sml/trunk/src/compiler/FLINT/flint/flint.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 95 - (view) (download) (as text)

1 : monnier 16 (* COPYRIGHT (c) 1997 YALE FLINT PROJECT *)
2 :     (* flint.sig *)
3 :    
4 :     signature FLINT =
5 :     sig
6 :    
7 :     type tkind = LtyDef.tkind
8 :     type tyc = LtyDef.tyc
9 :     type lty = LtyDef.lty
10 : monnier 45
11 : monnier 16 type tvar = LtyDef.tvar
12 :     type lvar = LambdaVar.lvar
13 :    
14 : monnier 45 type fflag = LtyDef.fflag
15 :     type rflag = LtyDef.rflag
16 :    
17 : monnier 16 (** classifying various kinds of functions *)
18 : monnier 45 datatype fkind
19 :     = FK_FCT
20 :     | FK_FUN of
21 :     {isrec : lty list option, (* is this function recursive ? *)
22 :     fixed : fflag, (* is calling convention fixed ? *)
23 :     known : bool, (* is this function known, default: false *)
24 : monnier 80 inline: bool} (* should this be inlined, default: false *)
25 : monnier 16
26 :     (** classifying various kinds of records *)
27 :     datatype rkind
28 : monnier 45 = RK_VECTOR of tyc (* vector: all elements have same type *)
29 :     | RK_STRUCT (* module: elements may be polymorphic *)
30 :     | RK_TUPLE of rflag (* tuple: all fields are monomorphic *)
31 : monnier 16
32 :     (*
33 :     * dcon records the name of the constructor (for debugging), the
34 : monnier 45 * corresponding conrep, and the flint type lty (which must be an
35 :     * arrow type). The use of conrep will go away soon.
36 : monnier 16 *)
37 :     type dcon = Symbol.symbol * Access.conrep * lty
38 :    
39 :     (*
40 :     * con: used to specify all possible switching statements. Efficient switch
41 :     * generation can be applied to DATAcon and INTcon. Otherwise, the switch is
42 :     * just a short-hand of the binary branch trees. Some of these instances
43 : monnier 45 * such as REALcon and VLENcon will go away soon.
44 : monnier 16 *)
45 :     datatype con
46 : monnier 45 = DATAcon of dcon * tyc list * lvar
47 : monnier 16 | INTcon of int (* should use InfInf.int *)
48 :     | INT32con of Int32.int
49 :     | WORDcon of word
50 :     | WORD32con of Word32.word
51 :     | REALcon of string
52 :     | STRINGcon of string
53 : monnier 45 | VLENcon of int
54 : monnier 16
55 :     (** simple values, including variables and static constants. *)
56 :     datatype value
57 :     = VAR of lvar
58 :     | INT of int (* should use InfInf.int *)
59 :     | INT32 of Int32.int
60 :     | WORD of word
61 :     | WORD32 of Word32.word
62 :     | REAL of string
63 :     | STRING of string
64 :    
65 :     (** the definitions of the lambda expressions *)
66 :     datatype lexp
67 :     = RET of value list
68 :     | LET of lvar list * lexp * lexp
69 :    
70 :     | FIX of fundec list * lexp
71 : monnier 45 | APP of value * value list
72 : monnier 16
73 : monnier 45 | TFN of tfundec * lexp
74 :     | TAPP of value * tyc list
75 : monnier 16
76 :     | SWITCH of value * Access.consig * (con * lexp) list * lexp option
77 : monnier 45 | CON of dcon * tyc list * value * lvar * lexp
78 : monnier 16
79 :     | RECORD of rkind * value list * lvar * lexp
80 :     | SELECT of value * int * lvar * lexp (* add rkind ? *)
81 :    
82 : monnier 45 | RAISE of value * lty list
83 : monnier 16 | HANDLE of lexp * value
84 :    
85 : monnier 45 | BRANCH of primop * value list * lexp * lexp
86 : monnier 16 | PRIMOP of primop * value list * lvar * lexp
87 :    
88 :     withtype fundec = fkind * lvar * (lvar * lty) list * lexp
89 : monnier 45 and tfundec = lvar * (tvar * tkind) list * lexp
90 :     and dict = {default: lvar, table: (tyc list * lvar) list}
91 :     and primop = dict option * PrimOp.primop * lty * tyc list
92 :     (* Invariant: primop's lty is always fully closed *)
93 : monnier 16
94 : monnier 45 type prog = fundec (* was "lvar * lty * lexp" *)
95 : monnier 16
96 :     end (* signature FLINT *)
97 : monnier 95
98 :     (*
99 :     * $Log: flint.sig,v $
100 :     * Revision 1.1.1.1 1998/04/08 18:39:38 george
101 :     * Version 110.5
102 :     *
103 :     *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0