-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathOCBlockNode.extension.st
More file actions
47 lines (35 loc) · 1.38 KB
/
OCBlockNode.extension.st
File metadata and controls
47 lines (35 loc) · 1.38 KB
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
Extension { #name : 'OCBlockNode' }
{ #category : '*Sindarin' }
OCBlockNode >> executedNodesAfter: aNode [
"Gives all nodes that are executed after aNode. Assuming that aNode is a recursive child, then all nodes executed after it are all nodes after it in allChildrenPostOrder"
| nodesAfter indexOfNode |
nodesAfter := self allChildrenPostOrder.
indexOfNode := nodesAfter identityIndexOf: aNode.
nodesAfter := nodesAfter withIndexSelect: [ :value :index |
index > indexOfNode ].
^ nodesAfter
]
{ #category : '*Sindarin' }
OCBlockNode >> firstPCOfStatement: aStatementNode [
^ self bcToASTCache firstRecursiveBcOffsetForStatementNode: aStatementNode
]
{ #category : '*Sindarin' }
OCBlockNode >> nextExecutedNodeAfter: aNode [
"Find first node that is after aNode that has an associated pc in method node all children (post-order)"
| indexOfNextNode nodesAfter |
nodesAfter := self executedNodesAfter: aNode.
indexOfNextNode := nodesAfter findFirst: [ :each |
(self firstPcForNode: each) isNotNil ].
^ nodesAfter at: indexOfNextNode
]
{ #category : '*Sindarin' }
OCBlockNode >> parentOfIdenticalSubtree: subtree [
^ self allChildren reversed
detect: [ :e | e == subtree ]
ifFound: [ :e | e parent ]
ifNone: [ nil ]
]
{ #category : '*Sindarin' }
OCBlockNode >> skipWithDebugger: aSindarinDebugger [
aSindarinDebugger skipBlockNode
]