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/Semant/basics/stamps.sig
ViewVC logotype

Diff of /sml/trunk/src/compiler/Semant/basics/stamps.sig

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

revision 419, Fri Sep 3 23:51:27 1999 UTC revision 587, Thu Mar 30 09:01:52 2000 UTC
# Line 1  Line 1 
1  (* Copyright 1996 by AT&T Bell Laboratories *)  (* Copyright 1996 by AT&T Bell Laboratories *)
2    (* Re-written by Matthias Blume (3/2000) *)
3  (* stamps.sig *)  (* stamps.sig *)
4    
5  signature STAMPS =  signature STAMPS =
6  sig  sig
7        type stamp
8        type ord_key = stamp                (* to match signature ORD_KEY *)
9        type pid = PersStamps.persstamp     (* for global stamps *)
10    
   datatype stamp_scope  
     = LOCAL  
     | GLOBAL of PersStamps.persstamp  
     | SPECIAL of string  
   
   datatype stamp = STAMP of {scope : stamp_scope, count : int}  
   
   val new : unit -> unit -> stamp  (* a generator of the stamp-generator *)  
11    val eq : stamp * stamp -> bool    val eq : stamp * stamp -> bool
12    val cmp : stamp * stamp -> order      val compare : stamp * stamp -> order (* instead of "cmp" (ORD_KEY) *)
   val special : string -> stamp  
   val stampToString : stamp -> string  
   val stampToShortString : stamp -> string  
13    
14    type 'a stampMap      type generator
15    val newMap : exn -> '1a stampMap      val newGenerator : unit -> generator
16        val fresh : generator -> stamp
17    
18    (* updateMap - add mapping to a stampMap *)      (* Make a new "special" stamp (for things in primEnv). *)
19    val updateMap : 'a stampMap -> stamp * 'a -> unit      val special : string -> stamp
   
   (* applyMap - apply stampMap to a stamp *)  
   val applyMap : 'a stampMap * stamp -> 'a  
   
 end (* signature STAMPS *)  
20    
21        (* Make a "global" stamp (i.e., one that comes from a different
22         * compilation unit). Used only by the unpickler. *)
23        val global  : { pid: pid, cnt: int } -> stamp
24    
25        (* Case analysis on the abstract type with built-in alpha-conversion
26         * for fresh stamps. Used by the pickler. *)
27        type converter
28        val newConverter : unit -> converter
29        val Case : converter  -> stamp ->
30                   { fresh   : int -> 'a,   (* already alpha-converted *)
31                     global  : { pid: pid, cnt: int } -> 'a,
32                     special : string -> 'a } -> 'a
33    
34        (* testing for freshness quickly... *)
35        val isFresh : stamp -> bool
36    
37        (* for debugging: *)
38        val toString : stamp -> string
39        val toShortString : stamp -> string
40    end

Legend:
Removed from v.419  
changed lines
  Added in v.587

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