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/branches/SMLNJ/src/MLRISC/graphs/readonly.sml
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/MLRISC/graphs/readonly.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 411 - (view) (download)

1 : monnier 245 (*
2 : monnier 411 * This view make a graph readonly.
3 :     *
4 :     * -- Allen
5 : monnier 245 *)
6 :    
7 :     signature READONLY_GRAPH_VIEW =
8 :     sig
9 :    
10 :     val readonly_view : ('n,'e,'g) Graph.graph -> ('n,'e,'g) Graph.graph
11 :    
12 :     end
13 :    
14 :     structure ReadOnlyGraphView : READONLY_GRAPH_VIEW =
15 :     struct
16 :    
17 :     structure G = Graph
18 :    
19 :     fun readonly_view (G.GRAPH G) =
20 :     let fun unimplemented _ = raise G.Readonly
21 :     in
22 :     G.GRAPH
23 :     { name = #name G,
24 :     graph_info = #graph_info G,
25 :     new_id = unimplemented,
26 :     add_node = unimplemented,
27 :     add_edge = unimplemented,
28 :     remove_node = unimplemented,
29 :     set_in_edges = unimplemented,
30 :     set_out_edges = unimplemented,
31 :     set_entries = unimplemented,
32 :     set_exits = unimplemented,
33 :     garbage_collect = unimplemented,
34 :     nodes = #nodes G,
35 :     edges = #edges G,
36 :     order = #order G,
37 :     size = #size G,
38 :     capacity = #capacity G,
39 :     out_edges = #out_edges G,
40 :     in_edges = #in_edges G,
41 :     succ = #succ G,
42 :     pred = #pred G,
43 :     has_edge = #has_edge G,
44 :     has_node = #has_node G,
45 :     node_info = #node_info G,
46 :     entries = #entries G,
47 :     exits = #exits G,
48 :     entry_edges = #entry_edges G,
49 :     exit_edges = #exit_edges G,
50 :     forall_nodes = #forall_nodes G,
51 :     forall_edges = #forall_edges G
52 :     (* fold_nodes = #fold_nodes G,
53 :     fold_edges = #fold_edges G *)
54 :     }
55 :     end
56 :     end
57 :    

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