summary refs log tree commit diff stats
path: root/bouml/128002.diagram
blob: 027d353a708d6a1c2a3b3f6206f65407326c6e36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
format 70

classcanvas 128002 class_ref 128002 // FM
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 171 201 2000
end
classcanvas 128130 class_ref 128130 // UI
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 483 193 2000
end
classcanvas 128258 class_ref 128258 // MAIN
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 58 186 2000
end
classcanvas 128386 class_ref 128386 // Command
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 322 139 2000
end
classcanvas 128514 class_ref 128514 // Action
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 212 33 2000
end
classcanvas 128642 class_ref 128642 // Environment
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 317 338 2000
end
classcanvas 128770 class_ref 128770 // Widget
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 495 479 2000
end
classcanvas 128898 class_ref 128898 // curses
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 505 76 2000
end
classcanvas 132994 class_ref 129154 // WStatusBar
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 700 527 2000
end
classcanvas 133250 class_ref 129026 // WConsole
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 706 569 2000
end
classcanvas 133506 class_ref 129538 // WTitleBar
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 710 612 2000
end
classcanvas 133762 class_ref 129410 // WMessage
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 701 483 2000
end
classcanvas 134018 class_ref 129282 // WDisplay
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 710 657 2005
end
classcanvas 134530 class_ref 136066 // Window
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 623 284 2000
end
classcanvas 135042 class_ref 136194 // Color
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 419 487 2000
end
classcanvas 135938 class_ref 136322 // FSObject
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 187 405 2000
end
classcanvas 136066 class_ref 136450 // File
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 83 455 2000
end
classcanvas 136194 class_ref 136578 // Directory
  draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default
  xyz 69 395 2005
end
relationcanvas 129026 relation_ref 128002 // <association>
  decenter_end 288
  from ref 128258 z 2001 to ref 128002
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 129154 relation_ref 128130 // <association>
  from ref 128130 z 2001 to ref 128002
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 129922 relation_ref 128514 // <association>
  decenter_begin 520
  from ref 128514 z 2001 to ref 128386
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 130178 relation_ref 128770 // <association>
  decenter_begin 267
  from ref 128642 z 2001 to ref 128002
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 130562 relation_ref 129154 // <association>
  from ref 128130 z 2001 to ref 128642
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 130690 relation_ref 129282 // <association>
  from ref 128002 z 2001 to ref 128386
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 133122 relation_ref 135938 // <generalisation>
  decenter_end 286
  from ref 132994 z 2001 to ref 128770
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 133378 relation_ref 136066 // <generalisation>
  decenter_end 433
  from ref 133250 z 2001 to ref 128770
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 133634 relation_ref 136194 // <generalisation>
  decenter_end 552
  from ref 133506 z 2001 to ref 128770
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 133890 relation_ref 142722 // <generalisation>
  decenter_end 146
  from ref 133762 z 2001 to ref 128770
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 134402 relation_ref 142850 // <generalisation>
  decenter_end 671
  from ref 134018 z 2006 to ref 128770
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 134786 relation_ref 149506 // <association>
  from ref 134530 z 2001 to ref 128770
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 134914 relation_ref 149634 // <association>
  from ref 128130 z 2001 to ref 134530
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 135554 relation_ref 149890 // <association>
  decenter_begin 271
  from ref 128770 z 2001 to ref 135042
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 136322 relation_ref 150146 // <generalisation>
  from ref 136066 z 2001 to ref 135938
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 136450 relation_ref 150274 // <generalisation>
  from ref 136194 z 2006 to ref 135938
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 136578 relation_ref 150402 // <aggregation>
  from ref 128642 z 2001 to ref 135938
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 136962 relation_ref 150786 // <aggregation>
  from ref 128130 z 2001 to ref 128770
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 137090 relation_ref 150914 // <aggregation>
  decenter_begin 167
  from ref 128130 z 2001 to ref 128386
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
relationcanvas 137858 relation_ref 151042 // <association>
  from ref 128898 z 2001 to ref 128130
  no_role_a no_role_b
  no_multiplicity_a no_multiplicity_b
end
end
c@akkartik.com> 2016-08-27 20:49:03 -0700 3266' href='/akkartik/mu/commit/html/042name.cc.html?h=main&id=cd9bb850caeca88747a25436fc65c67c6d5cd89a'>cd9bb850 ^
fcf35c13 ^
2e4f0bbd ^
298f8065 ^
4690ce81 ^
cd9bb850 ^
4690ce81 ^
cd9bb850 ^

4690ce81 ^

cd9bb850 ^
4690ce81 ^
672e3e50 ^

d059fe74 ^
cd9bb850 ^









672e3e50 ^
cd9bb850 ^
4690ce81 ^
cd9bb850 ^

4690ce81 ^

cd9bb850 ^
4690ce81 ^

672e3e50 ^

4690ce81 ^

65361948 ^

4690ce81 ^

c842d90b ^
2e4f0bbd ^
9542bb11 ^

4690ce81 ^

6d007fda ^
4690ce81 ^
65361948 ^
672e3e50 ^

a654e4ec ^
76755b28 ^
672e3e50 ^

a654e4ec ^
672e3e50 ^


a654e4ec ^
44c1aeef ^


6d007fda ^






672e3e50 ^

4690ce81 ^

d059fe74 ^
4690ce81 ^
2f02189d ^
672e3e50 ^


4690ce81 ^



c5ffb6e1 ^
65361948 ^

4690ce81 ^



c5ffb6e1 ^
65361948 ^

298f8065 ^
4690ce81 ^


6d007fda ^
65361948 ^


32b8fac2 ^
3e1349d2 ^
32b8fac2 ^
f344b250 ^
32b8fac2 ^





3e1349d2 ^
f344b250 ^

32b8fac2 ^




9570363a ^
672e3e50 ^
3e1349d2 ^
f344b250 ^
672e3e50 ^



672e3e50 ^
4fe9f5e8 ^
9570363a ^
76755b28 ^
3e1349d2 ^
f344b250 ^
672e3e50 ^

f344b250 ^
672e3e50 ^
4fe9f5e8 ^
76755b28 ^

3e1349d2 ^
f344b250 ^
65361948 ^
76755b28 ^
65361948 ^
76755b28 ^

3e1349d2 ^
f344b250 ^

65361948 ^
76755b28 ^
65361948 ^
76755b28 ^
3e1349d2 ^
f344b250 ^
65361948 ^
76755b28 ^

65361948 ^
76755b28 ^
3e1349d2 ^
f344b250 ^
65361948 ^
76755b28 ^

65361948 ^
32b8fac2 ^

672e3e50 ^
9570363a ^
3e1349d2 ^
f344b250 ^
3e1349d2 ^

672e3e50 ^



76755b28 ^
672e3e50 ^
32b8fac2 ^





4690ce81 ^
32b8fac2 ^
4690ce81 ^
62a52ffb ^
a654e4ec ^

32b8fac2 ^
4690ce81 ^
db1f56c8 ^


62a52ffb ^
672e3e50 ^



9570363a ^
3e1349d2 ^
a654e4ec ^
f344b250 ^
672e3e50 ^






9570363a ^
3e1349d2 ^
f344b250 ^


3e1349d2 ^
672e3e50 ^
65361948 ^
2f02189d ^
32b8fac2 ^

672e3e50 ^
76755b28 ^
672e3e50 ^
4690ce81 ^

c842d90b ^
9542bb11 ^

dbe12410 ^
4690ce81 ^
62a52ffb ^
a654e4ec ^

c842d90b ^
4690ce81 ^
db1f56c8 ^


62a52ffb ^
672e3e50 ^



a654e4ec ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347



                                                                                          
                              

                                                
                                  

                                                                                         

                       
                                                                                                 
                                                                                            

                                      
                                
                             
                             
                                   
                            

                              
                                  
                                                                           
                               

        





                               

       
                         
                                                                                                             
                                                                                                     

                                             
                                                          
                                        
                                                                                                           

                                                    

                                                                
                                                     

                                                                                     
                                        
                                                                                 
 
                                                                                                                                           
                                                               
 
                                                                                                
                                                                                                                                                                              

                                                                









                                                                                                                                                                                          

                                      
                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                               
                                                                                                                                        
                                                                            
                                                                                                                                   
                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                           
                                                                           
                                                          
                                                                                                                                                                                                                                                                                                                                                                             






                                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                            
                                                                              
                                      
                                                                                                                                                                  
                                                                                                                                                                             

                                                                                                                             

                                                                       
                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                                                                              

                                      
                                                                                                                                                                                                                                                                                                                                                                             









                                                                                                                                                                                                                                                                                                                                                                                                                                    
                                      
                                                                                                                                                               
                                                                                                                                                                             

                                                                                                                          

                                                                       
                                                                                                                                                                                                                                                                                                                                                                                                                                              

                                                                              

                                    

                                                                                                                                                                                                                                                                                                                                              

                                

                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                        

                                                                                                             

                                                                                                                                                                                                                                                       
                                                                   
                                                                                                                                                                                                                                                       
                                                                                                            

                                
                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                 

                                
                                                                                                                                                                                                                                                                                            


                                                                                                                                    
                                                                                                                                           


                                                                                                                                                                                                                                                                         






                                                                                                                                                                                                                                                                  

                                

                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  


                                                                                                         



                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                         

                                



                                                                                                                                                                                                                                                                                                 
                                                                                                                                                          

                                
                                                                                                                   


                                                                                                                                                                                                                                                           
                                                                   


                                                                                                            
                                                                              
                                        
                                                                                                                                                                                
                                                                                                           





                                                                                 
                                        

                                                                                                                     




                                                                                       
                                                                       
                                                                                
                                        
                                                                                                                                                                                 



                                                    
                                                                                                 
                                               
                                                                     
                                                  
                                        
                                                                                                               

                                                  
                                                                                                
 
                                                     

                                                                                                        
                                        
                                                                                                               
 
                                                                                            
 

                                                                                                          
                                        

                                                                                                           
 
                                                                                            
 
                                                                                                            
                                        
                                                                                                                                                
 

                                                                                          
 
                                                                                                       
                                        
                                                                                                           
 

                                                                                          
 

                                                                                                                    
 
                                                                                        
                                        
                                                                                                                   

                                                                                                                                                                



                                                                                
                                                                                            
                                                                                





                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                              
                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                                                                                       

                                                                                                                                                                                                                                                                                                 
                                                                                                                                   
                                                                                                                                                                                                                                                                                                         


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                  



                                                                                
                                                                             
                                        
                                                                                                                    
                                                                                                                  






                                                                                                           
                                                                                       
                                        


                                                                                                               
                                                                                                                                                                                                                                                                                                                                                       
 
                                                                                     
                                                                 

                                                                  
 
                                                                                            
                                                                             

                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

                                                                         
                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                                                                                                  

                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                         


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                  



                                
                                     
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - 042name.cc</title>
<meta name="Generator" content="Vim/7.4">
<meta name="plugin-version" content="vim7.4_v2">
<meta name="syntax" content="cpp">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="minimal">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; }
body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color: #080808; }
* { font-size: 12pt; font-size: 1em; }
.Constant { color: #00a0a0; }
.traceAbsent { color: #c00000; }
.cSpecial { color: #008000; }
.muRecipe { color: #ff8700; }
.SalientComment { color: #00ffff; }
.Comment { color: #9090ff; }
.Delimiter { color: #800080; }
.Special { color: #c00000; }
.traceContains { color: #008000; }
.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; }
.Identifier { color: #c0a020; }
-->
</style>

<script type='text/javascript'>
<!--

-->
</script>
</head>
<body>
<pre id='vimCodeElement'>
<span class="Comment">//: A big convenience high-level languages provide is the ability to name memory</span>
<span class="Comment">//: locations. In Mu, a transform called 'transform_names' provides this</span>
<span class="Comment">//: convenience.</span>

<span class="Delimiter">:(scenario transform_names)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
]
<span class="traceContains">+name: assign x 1</span>
<span class="traceContains">+mem: storing 0 in location 1</span>

<span class="Delimiter">:(scenarios transform)</span>
<span class="Delimiter">:(scenario transform_names_fails_on_use_before_define)</span>
<span class="Special">% Hide_errors = true;</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:num<span class="Special"> &lt;- </span>copy y:num
]
<span class="traceContains">+error: main: tried to read ingredient 'y' in 'x:num &lt;- copy y:num' but it hasn't been written to yet</span>
<span class="Comment"># todo: detect conditional defines</span>

<span class="Delimiter">:(after &quot;Transform.push_back(compute_container_sizes)&quot;)</span>
Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>transform_names<span class="Delimiter">);</span>  <span class="Comment">// idempotent</span>

<span class="Delimiter">:(before &quot;End Globals&quot;)</span>
map&lt;recipe_ordinal<span class="Delimiter">,</span> map&lt;string<span class="Delimiter">,</span> <span class="Normal">int</span>&gt; &gt; Name<span class="Delimiter">;</span>

<span class="Comment">//: the Name map is a global, so save it before tests and reset it for every</span>
<span class="Comment">//: test, just to be safe.</span>
<span class="Delimiter">:(before &quot;End Globals&quot;)</span>
map&lt;recipe_ordinal<span class="Delimiter">,</span> map&lt;string<span class="Delimiter">,</span> <span class="Normal">int</span>&gt; &gt; Name_snapshot<span class="Delimiter">;</span>
<span class="Delimiter">:(before &quot;End save_snapshots&quot;)</span>
Name_snapshot = Name<span class="Delimiter">;</span>
<span class="Delimiter">:(before &quot;End restore_snapshots&quot;)</span>
Name = Name_snapshot<span class="Delimiter">;</span>

<span class="Delimiter">:(code)</span>
<span class="Normal">void</span> transform_names<span class="Delimiter">(</span><span class="Normal">const</span> recipe_ordinal r<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  recipe&amp; caller = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">);</span>
  trace<span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">&quot;transform&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;--- transform names for recipe &quot;</span> &lt;&lt; caller<span class="Delimiter">.</span>name &lt;&lt; end<span class="Delimiter">();</span>
  <span class="Normal">bool</span> names_used = <span class="Constant">false</span><span class="Delimiter">;</span>
  <span class="Normal">bool</span> numeric_locations_used = <span class="Constant">false</span><span class="Delimiter">;</span>
  map&lt;string<span class="Delimiter">,</span> <span class="Normal">int</span>&gt;&amp; names = Name[r]<span class="Delimiter">;</span>
  <span class="Comment">// store the indices 'used' so far in the map</span>
  <span class="Normal">int</span>&amp; curr_idx = names[<span class="Constant">&quot;&quot;</span>]<span class="Delimiter">;</span>
  ++curr_idx<span class="Delimiter">;</span>  <span class="Comment">// avoid using index 0, benign skip in some other cases</span>
  <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; SIZE<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>steps<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
    instruction&amp; inst = caller<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span>
    <span class="Comment">// End transform_names(inst) Special-cases</span>
    <span class="Comment">// map names to addresses</span>
    <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> in = <span class="Constant">0</span><span class="Delimiter">;</span>  in &lt; SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span>  ++in<span class="Delimiter">)</span> <span class="Delimiter">{</span>
      reagent&amp; ingredient = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>in<span class="Delimiter">);</span>
      <span class="Comment">// Begin transform_names Ingredient Special-cases(ingredient, inst, caller)</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_disqualified<span class="Delimiter">(</span>ingredient<span class="Delimiter">,</span> inst<span class="Delimiter">,</span> caller<span class="Delimiter">.</span>name<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_numeric_location<span class="Delimiter">(</span>ingredient<span class="Delimiter">))</span> numeric_locations_used = <span class="Constant">true</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_named_location<span class="Delimiter">(</span>ingredient<span class="Delimiter">))</span> names_used = <span class="Constant">true</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_integer<span class="Delimiter">(</span>ingredient<span class="Delimiter">.</span>name<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>!already_transformed<span class="Delimiter">(</span>ingredient<span class="Delimiter">,</span> names<span class="Delimiter">))</span> <span class="Delimiter">{</span>
        raise &lt;&lt; maybe<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;tried to read ingredient '&quot;</span> &lt;&lt; ingredient<span class="Delimiter">.</span>name &lt;&lt; <span class="Constant">&quot;' in '&quot;</span> &lt;&lt; to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;' but it hasn't been written to yet</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
        <span class="Comment">// use-before-set Error</span>
        <span class="Identifier">return</span><span class="Delimiter">;</span>
      <span class="Delimiter">}</span>
      <span class="Normal">int</span> v = lookup_name<span class="Delimiter">(</span>ingredient<span class="Delimiter">,</span> r<span class="Delimiter">);</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>v &gt;= <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
        ingredient<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>v<span class="Delimiter">);</span>
        <span class="Comment">// Done Placing Ingredient(ingredient, inst, caller)</span>
      <span class="Delimiter">}</span>
      <span class="Normal">else</span> <span class="Delimiter">{</span>
        raise &lt;&lt; maybe<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;can't find a place to store '&quot;</span> &lt;&lt; ingredient<span class="Delimiter">.</span>name &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
        <span class="Identifier">return</span><span class="Delimiter">;</span>
      <span class="Delimiter">}</span>
    <span class="Delimiter">}</span>
    <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> out = <span class="Constant">0</span><span class="Delimiter">;</span>  out &lt; SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">);</span>  ++out<span class="Delimiter">)</span> <span class="Delimiter">{</span>
      reagent&amp; product = inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>out<span class="Delimiter">);</span>
      <span class="Comment">// Begin transform_names Product Special-cases(product, inst, caller)</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_disqualified<span class="Delimiter">(</span>product<span class="Delimiter">,</span> inst<span class="Delimiter">,</span> caller<span class="Delimiter">.</span>name<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_numeric_location<span class="Delimiter">(</span>product<span class="Delimiter">))</span> numeric_locations_used = <span class="Constant">true</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_named_location<span class="Delimiter">(</span>product<span class="Delimiter">))</span> names_used = <span class="Constant">true</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>is_integer<span class="Delimiter">(</span>product<span class="Delimiter">.</span>name<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>names<span class="Delimiter">.</span>find<span class="Delimiter">(</span>product<span class="Delimiter">.</span>name<span class="Delimiter">)</span> == names<span class="Delimiter">.</span>end<span class="Delimiter">())</span> <span class="Delimiter">{</span>
        trace<span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">&quot;name&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;assign &quot;</span> &lt;&lt; product<span class="Delimiter">.</span>name &lt;&lt; <span class="Constant">&quot; &quot;</span> &lt;&lt; curr_idx &lt;&lt; end<span class="Delimiter">();</span>
        names[product<span class="Delimiter">.</span>name] = curr_idx<span class="Delimiter">;</span>
        curr_idx += size_of<span class="Delimiter">(</span>product<span class="Delimiter">);</span>
      <span class="Delimiter">}</span>
      <span class="Normal">int</span> v = lookup_name<span class="Delimiter">(</span>product<span class="Delimiter">,</span> r<span class="Delimiter">);</span>
      <span class="Normal">if</span> <span class="Delimiter">(</span>v &gt;= <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
        product<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>v<span class="Delimiter">);</span>
        <span class="Comment">// Done Placing Product(product, inst, caller)</span>
      <span class="Delimiter">}</span>
      <span class="Normal">else</span> <span class="Delimiter">{</span>
        raise &lt;&lt; maybe<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;can't find a place to store '&quot;</span> &lt;&lt; product<span class="Delimiter">.</span>name &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
        <span class="Identifier">return</span><span class="Delimiter">;</span>
      <span class="Delimiter">}</span>
    <span class="Delimiter">}</span>
  <span class="Delimiter">}</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>names_used &amp;&amp; numeric_locations_used<span class="Delimiter">)</span>
    raise &lt;&lt; maybe<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;mixing variable names and numeric addresses</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
<span class="Delimiter">}</span>

<span class="Normal">bool</span> is_disqualified<span class="Delimiter">(</span><span class="Comment">/*</span><span class="Comment">mutable</span><span class="Comment">*/</span> reagent&amp; x<span class="Delimiter">,</span> <span class="Normal">const</span> instruction&amp; inst<span class="Delimiter">,</span> <span class="Normal">const</span> string&amp; recipe_name<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>!x<span class="Delimiter">.</span>type<span class="Delimiter">)</span> <span class="Delimiter">{</span>
    raise &lt;&lt; maybe<span class="Delimiter">(</span>recipe_name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;missing type for '&quot;</span> &lt;&lt; x<span class="Delimiter">.</span>original_string &lt;&lt; <span class="Constant">&quot;' in '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
    <span class="Comment">// missing-type Error 1</span>
    <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
  <span class="Delimiter">}</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>is_raw<span class="Delimiter">(</span>x<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>x<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
  <span class="Comment">// End is_disqualified Special-cases</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>initialized<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
  <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
<span class="Delimiter">}</span>

<span class="Normal">bool</span> already_transformed<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; r<span class="Delimiter">,</span> <span class="Normal">const</span> map&lt;string<span class="Delimiter">,</span> <span class="Normal">int</span>&gt;&amp; names<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Identifier">return</span> contains_key<span class="Delimiter">(</span>names<span class="Delimiter">,</span> r<span class="Delimiter">.</span>name<span class="Delimiter">);</span>
<span class="Delimiter">}</span>

<span class="Normal">int</span> lookup_name<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; r<span class="Delimiter">,</span> <span class="Normal">const</span> recipe_ordinal default_recipe<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Identifier">return</span> Name[default_recipe][r<span class="Delimiter">.</span>name]<span class="Delimiter">;</span>
<span class="Delimiter">}</span>

type_ordinal skip_addresses<span class="Delimiter">(</span>type_tree* type<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">while</span> <span class="Delimiter">(</span>type &amp;&amp; is_compound_type_starting_with<span class="Delimiter">(</span>type<span class="Delimiter">,</span> <span class="Constant">&quot;address&quot;</span><span class="Delimiter">))</span>
    type = type<span class="Delimiter">-&gt;</span>right<span class="Delimiter">;</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>!type<span class="Delimiter">)</span> <span class="Identifier">return</span> -<span class="Constant">1</span><span class="Delimiter">;</span>  <span class="Comment">// error handled elsewhere</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-&gt;</span>atom<span class="Delimiter">)</span> <span class="Identifier">return</span> type<span class="Delimiter">-&gt;</span>value<span class="Delimiter">;</span>
  <span class="Normal">const</span> type_tree* base_type = type<span class="Delimiter">;</span>
  <span class="Comment">// Update base_type in skip_addresses</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>base_type<span class="Delimiter">-&gt;</span>atom<span class="Delimiter">)</span>
    <span class="Identifier">return</span> base_type<span class="Delimiter">-&gt;</span>value<span class="Delimiter">;</span>
  assert<span class="Delimiter">(</span>base_type<span class="Delimiter">-&gt;</span>left<span class="Delimiter">-&gt;</span>atom<span class="Delimiter">);</span>
  <span class="Identifier">return</span> base_type<span class="Delimiter">-&gt;</span>left<span class="Delimiter">-&gt;</span>value<span class="Delimiter">;</span>
<span class="Delimiter">}</span>

<span class="Normal">int</span> find_element_name<span class="Delimiter">(</span><span class="Normal">const</span> type_ordinal t<span class="Delimiter">,</span> <span class="Normal">const</span> string&amp; name<span class="Delimiter">,</span> <span class="Normal">const</span> string&amp; recipe_name<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">const</span> type_info&amp; container = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> t<span class="Delimiter">);</span>
  <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; SIZE<span class="Delimiter">(</span>container<span class="Delimiter">.</span>elements<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span>
    <span class="Normal">if</span> <span class="Delimiter">(</span>container<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name == name<span class="Delimiter">)</span> <span class="Identifier">return</span> i<span class="Delimiter">;</span>
  raise &lt;&lt; maybe<span class="Delimiter">(</span>recipe_name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;unknown element '&quot;</span> &lt;&lt; name &lt;&lt; <span class="Constant">&quot;' in container '&quot;</span> &lt;&lt; get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> t<span class="Delimiter">).</span>name &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
  <span class="Identifier">return</span> -<span class="Constant">1</span><span class="Delimiter">;</span>
<span class="Delimiter">}</span>

<span class="Normal">bool</span> is_numeric_location<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; x<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>x<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>is_raw<span class="Delimiter">(</span>x<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>name == <span class="Constant">&quot;0&quot;</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>  <span class="Comment">// used for chaining lexical scopes</span>
  <span class="Identifier">return</span> is_integer<span class="Delimiter">(</span>x<span class="Delimiter">.</span>name<span class="Delimiter">);</span>
<span class="Delimiter">}</span>

<span class="Normal">bool</span> is_named_location<span class="Delimiter">(</span><span class="Normal">const</span> reagent&amp; x<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>x<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>is_raw<span class="Delimiter">(</span>x<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>is_special_name<span class="Delimiter">(</span>x<span class="Delimiter">.</span>name<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
  <span class="Identifier">return</span> !is_integer<span class="Delimiter">(</span>x<span class="Delimiter">.</span>name<span class="Delimiter">);</span>
<span class="Delimiter">}</span>

<span class="Comment">// all names here should either be disqualified or also in bind_special_scenario_names</span>
<span class="Normal">bool</span> is_special_name<span class="Delimiter">(</span><span class="Normal">const</span> string&amp; s<span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>s == <span class="Constant">&quot;_&quot;</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>s == <span class="Constant">&quot;0&quot;</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
  <span class="Comment">// End is_special_name Special-cases</span>
  <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
<span class="Delimiter">}</span>

<span class="Delimiter">:(scenario transform_names_supports_containers)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:point<span class="Special"> &lt;- </span>merge <span class="Constant">34</span><span class="Delimiter">,</span> <span class="Constant">35</span>
  <span class="Normal">y</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>
]
<span class="traceContains">+name: assign x 1</span>
<span class="Comment"># skip location 2 because x occupies two locations</span>
<span class="traceContains">+name: assign y 3</span>

<span class="Delimiter">:(scenario transform_names_supports_static_arrays)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:@:num:<span class="Constant">3</span><span class="Special"> &lt;- </span>create-array
  <span class="Normal">y</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>
]
<span class="traceContains">+name: assign x 1</span>
<span class="Comment"># skip locations 2, 3, 4 because x occupies four locations</span>
<span class="traceContains">+name: assign y 5</span>

<span class="Delimiter">:(scenario transform_names_passes_dummy)</span>
<span class="Comment"># _ is just a dummy result that never gets consumed</span>
<span class="muRecipe">def</span> main [
  _<span class="Delimiter">,</span> x:num<span class="Special"> &lt;- </span>copy <span class="Constant">0</span><span class="Delimiter">,</span> <span class="Constant">1</span>
]
<span class="traceContains">+name: assign x 1</span>
<span class="traceAbsent">-name: assign _ 1</span>

<span class="Comment">//: an escape hatch to suppress name conversion that we'll use later</span>
<span class="Delimiter">:(scenarios run)</span>
<span class="Delimiter">:(scenario transform_names_passes_raw)</span>
<span class="Special">% Hide_errors = true;</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:num/<span class="Special">raw &lt;- </span>copy <span class="Constant">0</span>
]
<span class="traceAbsent">-name: assign x 1</span>
<span class="traceContains">+error: can't write to location 0 in 'x:num/raw &lt;- copy 0'</span>

<span class="Delimiter">:(scenarios transform)</span>
<span class="Delimiter">:(scenario transform_names_fails_when_mixing_names_and_numeric_locations)</span>
<span class="Special">% Hide_errors = true;</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:num
]
<span class="traceContains">+error: main: mixing variable names and numeric addresses</span>

<span class="Delimiter">:(scenario transform_names_fails_when_mixing_names_and_numeric_locations_2)</span>
<span class="Special">% Hide_errors = true;</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>
  <span class="Constant">1</span>:num<span class="Special"> &lt;- </span>copy x:num
]
<span class="traceContains">+error: main: mixing variable names and numeric addresses</span>

<span class="Delimiter">:(scenario transform_names_does_not_fail_when_mixing_names_and_raw_locations)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:num/<span class="Special">raw</span>
]
<span class="traceAbsent">-error: main: mixing variable names and numeric addresses</span>
$error: <span class="Constant">0</span>

<span class="Delimiter">:(scenario transform_names_does_not_fail_when_mixing_names_and_literals)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">x</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>
]
<span class="traceAbsent">-error: main: mixing variable names and numeric addresses</span>
$error: <span class="Constant">0</span>

<span class="SalientComment">//:: Support element names for containers in 'get' and 'get-location' and 'put'.</span>
<span class="Comment">//: (get-location is implemented later)</span>

<span class="Delimiter">:(scenario transform_names_transforms_container_elements)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">p</span>:&amp;:point<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
  <span class="Normal">a</span>:num<span class="Special"> &lt;- </span>get *p:&amp;:point<span class="Delimiter">,</span> <span class="Constant">y:offset</span>
  <span class="Normal">b</span>:num<span class="Special"> &lt;- </span>get *p:&amp;:point<span class="Delimiter">,</span> <span class="Constant">x:offset</span>
]
<span class="traceContains">+name: element y of type point is at offset 1</span>
<span class="traceContains">+name: element x of type point is at offset 0</span>

<span class="Delimiter">:(before &quot;End transform_names(inst) Special-cases&quot;)</span>
<span class="Comment">// replace element names of containers with offsets</span>
<span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>name == <span class="Constant">&quot;get&quot;</span> || inst<span class="Delimiter">.</span>name == <span class="Constant">&quot;get-location&quot;</span> || inst<span class="Delimiter">.</span>name == <span class="Constant">&quot;put&quot;</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Comment">//: avoid raising any errors here; later layers will support overloading new</span>
  <span class="Comment">//: instructions with the same names (static dispatch), which could lead to</span>
  <span class="Comment">//: spurious errors</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> &lt; <span class="Constant">2</span><span class="Delimiter">)</span>
    <span class="Identifier">break</span><span class="Delimiter">;</span>  <span class="Comment">// error raised elsewhere</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>!is_literal<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)))</span>
    <span class="Identifier">break</span><span class="Delimiter">;</span>  <span class="Comment">// error raised elsewhere</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name<span class="Delimiter">.</span>find_first_not_of<span class="Delimiter">(</span><span class="Constant">&quot;0123456789&quot;</span><span class="Delimiter">)</span> != string::npos<span class="Delimiter">)</span> <span class="Delimiter">{</span>
    <span class="Comment">// since first non-address in base type must be a container, we don't have to canonize</span>
    type_ordinal base_type = skip_addresses<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>type<span class="Delimiter">);</span>
    <span class="Normal">if</span> <span class="Delimiter">(</span>base_type == -<span class="Constant">1</span><span class="Delimiter">)</span>
      <span class="Identifier">break</span><span class="Delimiter">;</span>  <span class="Comment">// error raised elsewhere</span>
    <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> base_type<span class="Delimiter">))</span> <span class="Delimiter">{</span>  <span class="Comment">// otherwise we'll raise an error elsewhere</span>
      inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>set_value<span class="Delimiter">(</span>find_element_name<span class="Delimiter">(</span>base_type<span class="Delimiter">,</span> inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name<span class="Delimiter">,</span> get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">));</span>
      trace<span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">&quot;name&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;element &quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name &lt;&lt; <span class="Constant">&quot; of type &quot;</span> &lt;&lt; get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> base_type<span class="Delimiter">).</span>name &lt;&lt; <span class="Constant">&quot; is at offset &quot;</span> &lt;&lt; no_scientific<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>value<span class="Delimiter">)</span> &lt;&lt; end<span class="Delimiter">();</span>
    <span class="Delimiter">}</span>
  <span class="Delimiter">}</span>
<span class="Delimiter">}</span>

<span class="Comment">//: this test is actually illegal so can't call run</span>
<span class="Delimiter">:(scenarios transform)</span>
<span class="Delimiter">:(scenario transform_names_handles_containers)</span>
<span class="muRecipe">def</span> main [
  <span class="Normal">a</span>:point<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>/unsafe
  <span class="Normal">b</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>/unsafe
]
<span class="traceContains">+name: assign a 1</span>
<span class="traceContains">+name: assign b 3</span>

<span class="SalientComment">//:: Support variant names for exclusive containers in 'maybe-convert'.</span>

<span class="Delimiter">:(scenarios run)</span>
<span class="Delimiter">:(scenario transform_names_handles_exclusive_containers)</span>
<span class="muRecipe">def</span> main [
  <span class="Constant">12</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>
  <span class="Constant">13</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">35</span>
  <span class="Constant">14</span>:num<span class="Special"> &lt;- </span>copy <span class="Constant">36</span>
  <span class="Constant">20</span>:point<span class="Delimiter">,</span> <span class="Constant">22</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>maybe-convert <span class="Constant">12</span>:number-<span class="Normal">or</span>-point/unsafe<span class="Delimiter">,</span> <span class="Constant">p:variant</span>
]
<span class="traceContains">+name: variant p of type number-or-point has tag 1</span>
<span class="traceContains">+mem: storing 1 in location 22</span>
<span class="traceContains">+mem: storing 35 in location 20</span>
<span class="traceContains">+mem: storing 36 in location 21</span>

<span class="Delimiter">:(before &quot;End transform_names(inst) Special-cases&quot;)</span>
<span class="Comment">// convert variant names of exclusive containers</span>
<span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>name == <span class="Constant">&quot;maybe-convert&quot;</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
    raise &lt;&lt; maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;exactly 2 ingredients expected in '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
    <span class="Identifier">break</span><span class="Delimiter">;</span>
  <span class="Delimiter">}</span>
  assert<span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)));</span>
  <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name<span class="Delimiter">.</span>find_first_not_of<span class="Delimiter">(</span><span class="Constant">&quot;0123456789&quot;</span><span class="Delimiter">)</span> != string::npos<span class="Delimiter">)</span> <span class="Delimiter">{</span>
    <span class="Comment">// since first non-address in base type must be an exclusive container, we don't have to canonize</span>
    type_ordinal base_type = skip_addresses<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>type<span class="Delimiter">);</span>
    <span class="Normal">if</span> <span class="Delimiter">(</span>base_type == -<span class="Constant">1</span><span class="Delimiter">)</span>
      raise &lt;&lt; maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;expected an exclusive-container in '&quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>original_string &lt;&lt; <span class="Constant">&quot;'</span><span class="cSpecial">\n</span><span class="Constant">&quot;</span> &lt;&lt; end<span class="Delimiter">();</span>
    <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> base_type<span class="Delimiter">))</span> <span class="Delimiter">{</span>  <span class="Comment">// otherwise we'll raise an error elsewhere</span>
      inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>set_value<span class="Delimiter">(</span>find_element_name<span class="Delimiter">(</span>base_type<span class="Delimiter">,</span> inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name<span class="Delimiter">,</span> get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">));</span>
      trace<span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">&quot;name&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;variant &quot;</span> &lt;&lt; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name &lt;&lt; <span class="Constant">&quot; of type &quot;</span> &lt;&lt; get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> base_type<span class="Delimiter">).</span>name &lt;&lt; <span class="Constant">&quot; has tag &quot;</span> &lt;&lt; no_scientific<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>value<span class="Delimiter">)</span> &lt;&lt; end<span class="Delimiter">();</span>
    <span class="Delimiter">}</span>
  <span class="Delimiter">}</span>
<span class="Delimiter">}</span>
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->