Mercurial > hg > Gears > Gears
comparison src/parallel_execution/examples/gearsDirectory/GearsDirectoryImpl.cbc @ 1023:67d57b15b899
merge
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 31 Mar 2022 13:44:19 +0900 |
parents | 0fc5916a1f64 |
children | 793b21a8ea12 |
comparison
equal
deleted
inserted
replaced
1022:635ccc391642 | 1023:67d57b15b899 |
---|---|
81 struct Node* node = new Node(); | 81 struct Node* node = new Node(); |
82 node->key = name->value; | 82 node->key = name->value; |
83 goto cDirectory->get(node, cd2Child2); | 83 goto cDirectory->get(node, cd2Child2); |
84 } | 84 } |
85 | 85 |
86 __code cd2Child2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node0, __code next(...)) { | 86 __code cd2Child2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) { |
87 // treeを作る | 87 // treeを作る |
88 // struct FTree* tree = new FileSystemTree(); | 88 // struct FTree* tree = new FileSystemTree(); |
89 // currentDirectoryを作ったtreeに変更する | 89 // currentDirectoryを作ったtreeに変更する |
90 // struct FTree* parentDirectory = gearsDirectory->currentDirectory; | 90 // struct FTree* parentDirectory = gearsDirectory->currentDirectory; |
91 // gearsDirectory->currentDirectory = tree; | 91 // gearsDirectory->currentDirectory = tree; |
92 // current treeをstackにpushする | 92 // current treeをstackにpushする |
93 // struct Stack* ds = gearsDirectory->directoryStack; | 93 // struct Stack* ds = gearsDirectory->directoryStack; |
94 | 94 |
95 // searchの結果,存在すればcurrentDirectoryにsearchしたtreeをsetする | 95 // searchの結果,存在すればcurrentDirectoryにsearchしたtreeをsetする |
96 gearsDirectory->currentDirectory = node0->value; | 96 struct FTree* iNodeTree = new FTree(); |
97 goto next(...); | 97 iNodeTree = gearsDirectory->iNodeTree; |
98 | |
99 goto iNodeTree->get(node->value, cd2Child3); | |
98 // gato ds->push(parentDirectory, next(...)); | 100 // gato ds->push(parentDirectory, next(...)); |
99 } | 101 } |
100 | 102 |
101 __code cd2Child2_stub(struct Context* context) { | 103 __code cd2Child2_stub(struct Context* context) { |
102 GearsDirectoryImpl* gearsDirectory = (GearsDirectoryImpl*)GearImpl(context, GearsDirectory, gearsDirectory); | 104 GearsDirectoryImpl* gearsDirectory = (GearsDirectoryImpl*)GearImpl(context, GearsDirectory, gearsDirectory); |
103 enum Code next = Gearef(context, GearsDirectory)->next; | 105 enum Code next = Gearef(context, GearsDirectory)->next; |
104 Node* node0 = Gearef(context, FTree)->node; | 106 Node* node0 = Gearef(context, FTree)->node; |
105 goto cd2Child2(context, gearsDirectory, node0, next); | 107 goto cd2Child2(context, gearsDirectory, node0, next); |
106 } | 108 } |
107 | 109 |
110 __code cd2Child3(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) { | |
111 gearsDirectory->currentDirectory = node->value; | |
112 goto next(...); | |
113 } | |
114 | |
115 __code cd2Child3_stub(struct Context* context) { | |
116 GearsDirectoryImpl* gearsDirectory = (GearsDirectoryImpl*)GearImpl(context, GearsDirectory, gearsDirectory); | |
117 Integer* name = Gearef(context, FTree)->node; | |
118 enum Code next = Gearef(context, GearsDirectory)->next; | |
119 goto ls2(context, gearsDirectory, name, next); | |
120 } | |
121 | |
122 | |
108 | 123 |
109 __code cd2Parent(struct GearsDirectoryImpl* gearsDirectory, __code next(...)) { | 124 __code cd2Parent(struct GearsDirectoryImpl* gearsDirectory, __code next(...)) { |
110 // struct Stack* ds = gearsDirectory->directoryStack; | 125 // struct Stack* ds = gearsDirectory->directoryStack; |
111 // gato ds->pop(cd2Parent2); | 126 // gato ds->pop(cd2Parent2); |
112 gearsDirectory->currentDirectory = gearsDirectory->currentDirectory->treeParent; | 127 gearsDirectory->currentDirectory = gearsDirectory->currentDirectory->treeParent; |