@@ -27,25 +27,23 @@ private module CfgInput implements CfgShared::InputSig<Location> {
27
27
28
28
class ControlFlowTreeBase = Impl:: AstNode ;
29
29
30
- class ControlFlowElement = ControlFlowTreeBase ;
30
+ class AstNode = ControlFlowTreeBase ;
31
31
32
32
class Completion = Comp:: Completion ;
33
33
34
34
predicate completionIsNormal ( Completion c ) { c instanceof Comp:: NormalCompletion }
35
35
36
36
predicate completionIsSimple ( Completion c ) { c instanceof Comp:: SimpleCompletion }
37
37
38
- predicate completionIsValidFor ( Completion c , ControlFlowElement e ) { c .isValidFor ( e ) }
38
+ predicate completionIsValidFor ( Completion c , AstNode e ) { c .isValidFor ( e ) }
39
39
40
40
class CfgScope = Cfg:: CfgScope ;
41
41
42
- CfgScope getCfgScope ( ControlFlowElement n ) { result = Impl:: getCfgScope ( n ) }
42
+ CfgScope getCfgScope ( AstNode n ) { result = Impl:: getCfgScope ( n ) }
43
43
44
- predicate scopeFirst ( CfgScope scope , ControlFlowElement first ) {
45
- scope .( Impl:: CfgScopeImpl ) .entry ( first )
46
- }
44
+ predicate scopeFirst ( CfgScope scope , AstNode first ) { scope .( Impl:: CfgScopeImpl ) .entry ( first ) }
47
45
48
- predicate scopeLast ( CfgScope scope , ControlFlowElement last , Completion c ) {
46
+ predicate scopeLast ( CfgScope scope , AstNode last , Completion c ) {
49
47
scope .( Impl:: CfgScopeImpl ) .exit ( last , c )
50
48
}
51
49
@@ -132,15 +130,15 @@ predicate succExit(CfgScopeImpl scope, AstNode last, Completion c) { scope.exit(
132
130
/** Defines the CFG by dispatch on the various AST types. */
133
131
module Trees {
134
132
private class AliasStmtTree extends StandardPreOrderTree instanceof AliasStmt {
135
- final override ControlFlowTree getChildElement ( int i ) {
133
+ final override ControlFlowTree getChildNode ( int i ) {
136
134
result = super .getNewName ( ) and i = 0
137
135
or
138
136
result = super .getOldName ( ) and i = 1
139
137
}
140
138
}
141
139
142
140
private class ArgumentListTree extends StandardPostOrderTree instanceof ArgumentList {
143
- final override ControlFlowTree getChildElement ( int i ) { result = super .getElement ( i ) }
141
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getElement ( i ) }
144
142
}
145
143
146
144
private class AssignExprTree extends StandardPostOrderTree instanceof AssignExpr {
@@ -151,7 +149,7 @@ module Trees {
151
149
)
152
150
}
153
151
154
- final override ControlFlowTree getChildElement ( int i ) {
152
+ final override ControlFlowTree getChildNode ( int i ) {
155
153
result = super .getLeftOperand ( ) and i = 0
156
154
or
157
155
result = super .getRightOperand ( ) and i = 1
@@ -167,7 +165,7 @@ module Trees {
167
165
}
168
166
169
167
private class BlockArgumentTree extends StandardPostOrderTree instanceof BlockArgument {
170
- final override ControlFlowTree getChildElement ( int i ) { result = super .getValue ( ) and i = 0 }
168
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getValue ( ) and i = 0 }
171
169
}
172
170
173
171
abstract private class NonDefaultValueParameterTree extends ControlFlowTree instanceof NamedParameter
@@ -422,7 +420,7 @@ module Trees {
422
420
not this .( MethodCall ) .isSafeNavigation ( )
423
421
}
424
422
425
- override ControlFlowTree getChildElement ( int i ) { result = super .getArgument ( i ) }
423
+ override ControlFlowTree getChildNode ( int i ) { result = super .getArgument ( i ) }
426
424
}
427
425
428
426
private class CaseTree extends PostOrderTree instanceof CaseExpr , AstInternal:: TCaseExpr {
@@ -784,11 +782,11 @@ module Trees {
784
782
785
783
private class ParenthesizedPatternTree extends StandardPreOrderTree instanceof ParenthesizedPattern
786
784
{
787
- override ControlFlowTree getChildElement ( int i ) { result = super .getPattern ( ) and i = 0 }
785
+ override ControlFlowTree getChildNode ( int i ) { result = super .getPattern ( ) and i = 0 }
788
786
}
789
787
790
788
private class ReferencePatternTree extends StandardPreOrderTree instanceof ReferencePattern {
791
- override ControlFlowTree getChildElement ( int i ) { result = super .getExpr ( ) and i = 0 }
789
+ override ControlFlowTree getChildNode ( int i ) { result = super .getExpr ( ) and i = 0 }
792
790
}
793
791
794
792
private class InClauseTree extends PreOrderTree instanceof InClause {
@@ -997,7 +995,7 @@ module Trees {
997
995
998
996
private class DestructuredParameterTree extends StandardPostOrderTree instanceof DestructuredParameter
999
997
{
1000
- final override ControlFlowTree getChildElement ( int i ) { result = super .getElement ( i ) }
998
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getElement ( i ) }
1001
999
}
1002
1000
1003
1001
private class DesugaredTree extends ControlFlowTree {
@@ -1059,12 +1057,12 @@ module Trees {
1059
1057
{ }
1060
1058
1061
1059
private class HereDocTree extends StandardPostOrderTree instanceof HereDoc {
1062
- final override ControlFlowTree getChildElement ( int i ) { result = super .getComponent ( i ) }
1060
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getComponent ( i ) }
1063
1061
}
1064
1062
1065
1063
private class InstanceVariableTree extends StandardPostOrderTree instanceof InstanceVariableAccess
1066
1064
{
1067
- final override ControlFlowTree getChildElement ( int i ) { result = super .getReceiver ( ) and i = 0 }
1065
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getReceiver ( ) and i = 0 }
1068
1066
}
1069
1067
1070
1068
private class KeywordParameterTree extends DefaultValueParameterTree instanceof KeywordParameter {
@@ -1139,7 +1137,7 @@ module Trees {
1139
1137
}
1140
1138
1141
1139
private class MethodCallTree extends CallTree instanceof MethodCall {
1142
- final override ControlFlowTree getChildElement ( int i ) {
1140
+ final override ControlFlowTree getChildNode ( int i ) {
1143
1141
result = super .getReceiver ( ) and i = 0
1144
1142
or
1145
1143
result = super .getArgument ( i - 1 )
@@ -1208,15 +1206,15 @@ module Trees {
1208
1206
}
1209
1207
1210
1208
private class PairTree extends StandardPostOrderTree instanceof Pair {
1211
- final override ControlFlowTree getChildElement ( int i ) {
1209
+ final override ControlFlowTree getChildNode ( int i ) {
1212
1210
result = super .getKey ( ) and i = 0
1213
1211
or
1214
1212
result = super .getValue ( ) and i = 1
1215
1213
}
1216
1214
}
1217
1215
1218
1216
private class RangeLiteralTree extends StandardPostOrderTree instanceof RangeLiteral {
1219
- final override ControlFlowTree getChildElement ( int i ) {
1217
+ final override ControlFlowTree getChildNode ( int i ) {
1220
1218
result = super .getBegin ( ) and i = 0
1221
1219
or
1222
1220
result = super .getEnd ( ) and i = 1
@@ -1314,7 +1312,7 @@ module Trees {
1314
1312
private class RetryStmtTree extends LeafTree instanceof RetryStmt { }
1315
1313
1316
1314
private class ReturningStmtTree extends StandardPostOrderTree instanceof ReturningStmt {
1317
- final override ControlFlowTree getChildElement ( int i ) { result = super .getValue ( ) and i = 0 }
1315
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getValue ( ) and i = 0 }
1318
1316
}
1319
1317
1320
1318
private class SimpleParameterTree extends NonDefaultValueParameterTree instanceof SimpleParameter {
@@ -1415,13 +1413,13 @@ module Trees {
1415
1413
1416
1414
private class StringConcatenationTree extends StandardPostOrderTree instanceof StringConcatenation
1417
1415
{
1418
- final override ControlFlowTree getChildElement ( int i ) { result = super .getString ( i ) }
1416
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getString ( i ) }
1419
1417
}
1420
1418
1421
1419
private class StringlikeLiteralTree extends StandardPostOrderTree instanceof StringlikeLiteral {
1422
1420
StringlikeLiteralTree ( ) { not this instanceof HereDoc }
1423
1421
1424
- final override ControlFlowTree getChildElement ( int i ) { result = super .getComponent ( i ) }
1422
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getComponent ( i ) }
1425
1423
}
1426
1424
1427
1425
private class StringComponentTree extends LeafTree instanceof StringComponent {
@@ -1447,7 +1445,7 @@ module Trees {
1447
1445
}
1448
1446
1449
1447
private class UndefStmtTree extends StandardPreOrderTree instanceof UndefStmt {
1450
- final override ControlFlowTree getChildElement ( int i ) { result = super .getMethodName ( i ) }
1448
+ final override ControlFlowTree getChildNode ( int i ) { result = super .getMethodName ( i ) }
1451
1449
}
1452
1450
1453
1451
private class WhenTree extends ControlFlowTree instanceof WhenClause {
0 commit comments