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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 44, Sun Mar 22 20:10:57 1998 UTC revision 45, Sun Mar 22 20:11:09 1998 UTC
# Line 7  Line 7 
7  type tkind = LtyDef.tkind  type tkind = LtyDef.tkind
8  type tyc = LtyDef.tyc  type tyc = LtyDef.tyc
9  type lty = LtyDef.lty  type lty = LtyDef.lty
10    
11  type tvar = LtyDef.tvar  type tvar = LtyDef.tvar
12  type lvar = LambdaVar.lvar  type lvar = LambdaVar.lvar
13    
14    type fflag = LtyDef.fflag
15    type rflag = LtyDef.rflag
16    
17  (** classifying various kinds of functions *)  (** classifying various kinds of functions *)
18  type fkind =  datatype fkind
19    {isrec : lty list option,    = FK_FCT
20     raw   : LtyDef.rawflag,    | FK_FUN of
21     isfct : bool}        {isrec : lty list option,  (* is this function recursive ? *)
22  (*         fixed : fflag,            (* is calling convention fixed ? *)
23   * rec --- NONE means non-recursive         known : bool,             (* is this function known, default: false *)
24   *            SOME t means that t is the function type.         inline: bool}             (* is this inlinable, default: not isrec *)
  * raw --- true means that argument/result flattening has been done  
  *  
  * In the future, we want to cover the following and more:  
  *  
  *  FK_KREC            known recursive functions  
  *  FK_KNOWN           general known functions  
  *  FK_ESCAPE          general escaping functions  
  *  FK_KTAIL           tail-recursive kernal  
  *  FK_NOINL           no in-line expansions are allowed inslide  
  *  FK_HANDLER         exception handler  
  *)  
25    
26  (** classifying various kinds of records *)  (** classifying various kinds of records *)
27  datatype rkind  datatype rkind
28    = RK_VECTOR of tyc  (* vector: all elements have same type *)    = RK_VECTOR of tyc  (* vector: all elements have same type *)
   | RK_RECORD         (* tuple: all elements are monomorphic *)  
29    | RK_STRUCT         (* module: elements may be polymorphic *)    | RK_STRUCT         (* module: elements may be polymorphic *)
30      | RK_TUPLE of rflag          (* tuple: all fields are monomorphic *)
31    
32  (*  (*
33   * dcon records the name of the constructor (for debugging), the   * dcon records the name of the constructor (for debugging), the
34   * corresponding conrep, and the lambda type lty; the value carrying   * corresponding conrep, and the flint type lty (which must be an
35   * data constructors must have the arrow type.   * arrow type). The use of conrep will go away soon.
36   *)   *)
37  type dcon = Symbol.symbol * Access.conrep * lty  type dcon = Symbol.symbol * Access.conrep * lty
38    
# Line 47  Line 40 
40   * con: used to specify all possible switching statements. Efficient switch   * con: used to specify all possible switching statements. Efficient switch
41   * generation can be applied to DATAcon and INTcon. Otherwise, the switch is   * 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   * just a short-hand of the binary branch trees. Some of these instances
43   * such as REALcon probably should go away.   * such as REALcon and VLENcon will go away soon.
44   *)   *)
45  datatype con  datatype con
46    = DATAcon of dcon * tyc list * lvar list    = DATAcon of dcon * tyc list * lvar
47    | INTcon of int                          (* should use InfInf.int *)    | INTcon of int                          (* should use InfInf.int *)
48    | INT32con of Int32.int    | INT32con of Int32.int
49    | WORDcon of word    | WORDcon of word
50    | WORD32con of Word32.word    | WORD32con of Word32.word
51    | REALcon of string    | REALcon of string
52    | STRINGcon of string    | STRINGcon of string
53    | VLENcon of int                  (* ??? require checks on vec select *)    | VLENcon of int
54    
55  (** simple values, including variables and static constants. *)  (** simple values, including variables and static constants. *)
56  datatype value  datatype value
# Line 81  Line 74 
74    | TAPP of value * tyc list    | TAPP of value * tyc list
75    
76    | SWITCH of value * Access.consig * (con * lexp) list * lexp option    | SWITCH of value * Access.consig * (con * lexp) list * lexp option
77    | CON of dcon * tyc list * value list * lvar * lexp    | CON of dcon * tyc list * value * lvar * lexp
78    
79    | RECORD of rkind * value list * lvar * lexp    | RECORD of rkind * value list * lvar * lexp
80    | SELECT of value * int * lvar * lexp          (* add rkind ? *)    | SELECT of value * int * lvar * lexp          (* add rkind ? *)
81    
82    | RAISE of value * lty list    | RAISE of value * lty list
83    | HANDLE of lexp * value    | HANDLE of lexp * value
   | ETAG of tyc * value * lvar * lexp  
84    
85      | BRANCH of primop * value list * lexp * lexp
86    | PRIMOP of primop * value list * lvar * lexp    | PRIMOP of primop * value list * lvar * lexp
   | GENOP of dict * primop * value list * lvar * lexp  
87    
   | WRAP of tyc * value * lvar * lexp  
   | UNWRAP of tyc * value * lvar * lexp  
   
 (** the return type is not required for non-recursive functions *)  
88  withtype fundec = fkind * lvar * (lvar * lty) list * lexp  withtype fundec = fkind * lvar * (lvar * lty) list * lexp
   
 (** definitions of type functions, result type not required *)  
89  and tfundec = lvar * (tvar * tkind) list * lexp  and tfundec = lvar * (tvar * tkind) list * lexp
   
 (** used by GENOP only, should go away soon *)  
90  and dict = {default: lvar, table: (tyc list * lvar) list}  and dict = {default: lvar, table: (tyc list * lvar) list}
91    and primop = dict option * PrimOp.primop * lty * tyc list
92  and primop = PrimOp.primop * lty * tyc list          (* Invariant: primop's lty is always fully closed *)
93    
94  type prog = fundec (* was "lvar * lty * lexp" *)  type prog = fundec (* was "lvar * lty * lexp" *)
95    

Legend:
Removed from v.44  
changed lines
  Added in v.45

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