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/MLRISC/library/annotations.sig
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/library/annotations.sig

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : monnier 245 (*
2 :     * User definable annotations.
3 :     *
4 :     * Note: annotations will now be used extensively in all part of
5 :     * the optimizer.
6 :     *
7 :     * Idea is stolen from Stephen Weeks
8 : monnier 411 *
9 :     * -- Allen
10 : monnier 245 *)
11 :    
12 :     signature ANNOTATIONS =
13 :     sig
14 :    
15 : monnier 469 type annotation
16 : monnier 245 type annotations = annotation list
17 : monnier 469 type propList = annotations
18 :    
19 :     exception NoProperty
20 : monnier 245
21 : monnier 469 type 'a property =
22 :     { get : annotations -> 'a option,
23 :     peek : annotation -> 'a option,
24 :     lookup : annotations -> 'a,
25 :     contains : annotations -> bool,
26 :     set : 'a * annotations -> annotations,
27 :     rmv : annotations -> annotations,
28 :     create : 'a -> annotation
29 :     }
30 :     type flag = unit property
31 : monnier 245
32 :     (*
33 : monnier 469 * Generate a new annotation.
34 :     * Client should provide a pretty printing function.
35 : monnier 245 *)
36 : monnier 469 val new : ('a -> string) option -> 'a property
37 :     val newFlag : string -> flag
38 : monnier 245
39 :     (*
40 :     * Pretty print an annotation
41 :     *)
42 :     val toString : annotation -> string
43 :    
44 :     end

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