Mercurial > repos > rhope
comparison nworker_c.rhope @ 120:cd25171e1bb2
Use List for Subsets instead of a Dictionary for performance reasons. Fix issue with List literals. Compiled compiler is now self-hosting.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 21 Oct 2010 23:55:15 -0400 |
parents | b3f56e1d54a0 |
children | 1af91ceaaf49 |
comparison
equal
deleted
inserted
replaced
119:72c648bca43b | 120:cd25171e1bb2 |
---|---|
9 Condition Type | 9 Condition Type |
10 } | 10 } |
11 | 11 |
12 AndSet[:out] | 12 AndSet[:out] |
13 { | 13 { |
14 out <- [[[Build[Condition Set()]]Variables <<[Dictionary[]]]Subsets <<[Dictionary[]]]Condition Type <<["And"] | 14 out <- [[[Build[Condition Set()]]Variables <<[Dictionary[]]]Subsets <<[()]]Condition Type <<["And"] |
15 } | 15 } |
16 | 16 |
17 OrSet[:out] | 17 OrSet[:out] |
18 { | 18 { |
19 out <- [[[Build[Condition Set()]]Variables <<[Dictionary[]]]Subsets <<[Dictionary[]]]Condition Type <<["Or"] | 19 out <- [[[Build[Condition Set()]]Variables <<[Dictionary[]]]Subsets <<[()]]Condition Type <<["Or"] |
20 } | 20 } |
21 | 21 |
22 To String@Condition Set[set:out] | 22 To String@Condition Set[set:out] |
23 { | 23 { |
24 out <- [[[[[set]Condition Type >> | 24 out <- [[[[[set]Condition Type >> |
33 If[[Blueprint Of[cond]] = [Condition Set()]] | 33 If[[Blueprint Of[cond]] = [Condition Set()]] |
34 { | 34 { |
35 If[[[set]Condition Type >>]=[[cond]Condition Type >>]] | 35 If[[[set]Condition Type >>]=[[cond]Condition Type >>]] |
36 { | 36 { |
37 out <- [[set]Variables <<[ Combine[[set]Variables >>, [cond]Variables >>] ] | 37 out <- [[set]Variables <<[ Combine[[set]Variables >>, [cond]Variables >>] ] |
38 ]Subsets <<[ Combine[[set]Subsets >>, [cond]Subsets >>] ] | 38 ]Subsets <<[ Concatenate[[set]Subsets >>, [cond]Subsets >>] ] |
39 }{ | 39 }{ |
40 [cond]Empty? | 40 [cond]Empty? |
41 { | 41 { |
42 [cond]Simple? | 42 [cond]Simple? |
43 { out <- [set]Variables <<[ Combine[[set]Variables >>, [cond]Variables >>] ] } | 43 { out <- [set]Variables <<[ Combine[[set]Variables >>, [cond]Variables >>] ] } |
44 { out <- [set]Subsets <<[ [[set]Subsets>>]Set[[cond]To String, cond] ] } | 44 { out <- [set]Subsets <<[ [[set]Subsets>>]Append[cond] ] } |
45 }{ | 45 }{ |
46 out <- set | 46 out <- set |
47 } | 47 } |
48 } | 48 } |
49 }{ | 49 }{ |
1216 }{ | 1216 }{ |
1217 If[[[worker]Library >>] = [""]] | 1217 If[[[worker]Library >>] = [""]] |
1218 { | 1218 { |
1219 ifunc <- Fold[Set Output Type[?], Fold[Set Input Type[?], [program]Create Function[name,[worker]Inputs >>, [worker]Outputs >>, [worker]Convention >>], [worker]Input Types >>], [worker]Output Types >>] | 1219 ifunc <- Fold[Set Output Type[?], Fold[Set Input Type[?], [program]Create Function[name,[worker]Inputs >>, [worker]Outputs >>, [worker]Convention >>], [worker]Input Types >>], [worker]Output Types >>] |
1220 | 1220 |
1221 groups <- [worker]Dependency Groups | |
1221 | 1222 |
1222 | 1223 fgroup <- [groups]First |
1223 groups <- [worker]Dependency Groups | |
1224 [groups]First | |
1225 { | 1224 { |
1226 with conds <- [worker]Save Group Conditions[groups, ~] | 1225 with conds <- [worker]Save Group Conditions[groups, ~] |
1227 final func <- [with conds]Compile Group[program,func,groups, ~] | 1226 final func <- [with conds]Compile Group[program,func,groups, ~] |
1228 }{ | 1227 }{ |
1229 final func <- Val[func] | 1228 final func <- Val[func] |