Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/staging/src/compiler/common/strand-util.sml
ViewVC logotype

Annotation of /branches/staging/src/compiler/common/strand-util.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2635 - (view) (download)

1 : jhr 1640 (* strand-util.sml
2 :     *
3 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * Utility definitions for strands.
7 :     *)
8 :    
9 :     structure StrandUtil =
10 :     struct
11 :    
12 :     (* method names *)
13 :     datatype method_name
14 :     = Update
15 :     | Stabilize
16 :    
17 :     fun nameToString Update = "Update"
18 :     | nameToString Stabilize = "Stabilize"
19 :    
20 :     (* program properties *)
21 :     datatype program_prop
22 : jhr 2332 = StrandsMayDie (* present if strands may die *)
23 :     | NewStrands (* present if new strands may be created dynamically *)
24 :     | StrandCommunication (* present if strands read the state of other strands *)
25 :     | GlobalReduce (* present if there is a global reduce phase *)
26 : jhr 1640
27 :     fun propToString StrandsMayDie = "StrandsMayDie"
28 :     | propToString NewStrands = "NewStrands"
29 :     | propToString StrandCommunication = "StrandCommunication"
30 : jhr 2107 | propToString GlobalReduce = "GlobalReduce"
31 : jhr 1640
32 : jhr 2635 fun propsToString [] = "none"
33 :     | propsToString [p] = propToString p
34 :     | propsToString (p::props) = String.concat(
35 :     propToString p
36 :     :: List.foldr (fn (p, l) => "," :: propToString p :: l) [] props)
37 :    
38 : jhr 1671 fun hasProp (prop : program_prop) = List.exists (fn p => prop = p)
39 :    
40 : jhr 1640 end

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