@@ -27,25 +27,23 @@ private module CfgInput implements CfgShared::InputSig<Location> {
2727
2828 class ControlFlowTreeBase = Impl:: AstNode ;
2929
30- class ControlFlowElement = ControlFlowTreeBase ;
30+ class AstNode = ControlFlowTreeBase ;
3131
3232 class Completion = Comp:: Completion ;
3333
3434 predicate completionIsNormal ( Completion c ) { c instanceof Comp:: NormalCompletion }
3535
3636 predicate completionIsSimple ( Completion c ) { c instanceof Comp:: SimpleCompletion }
3737
38- predicate completionIsValidFor ( Completion c , ControlFlowElement e ) { c .isValidFor ( e ) }
38+ predicate completionIsValidFor ( Completion c , AstNode e ) { c .isValidFor ( e ) }
3939
4040 class CfgScope = Cfg:: CfgScope ;
4141
42- CfgScope getCfgScope ( ControlFlowElement n ) { result = Impl:: getCfgScope ( n ) }
42+ CfgScope getCfgScope ( AstNode n ) { result = Impl:: getCfgScope ( n ) }
4343
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 ) }
4745
48- predicate scopeLast ( CfgScope scope , ControlFlowElement last , Completion c ) {
46+ predicate scopeLast ( CfgScope scope , AstNode last , Completion c ) {
4947 scope .( Impl:: CfgScopeImpl ) .exit ( last , c )
5048 }
5149
@@ -132,15 +130,15 @@ predicate succExit(CfgScopeImpl scope, AstNode last, Completion c) { scope.exit(
132130/** Defines the CFG by dispatch on the various AST types. */
133131module Trees {
134132 private class AliasStmtTree extends StandardPreOrderTree instanceof AliasStmt {
135- final override ControlFlowTree getChildElement ( int i ) {
133+ final override ControlFlowTree getChildNode ( int i ) {
136134 result = super .getNewName ( ) and i = 0
137135 or
138136 result = super .getOldName ( ) and i = 1
139137 }
140138 }
141139
142140 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 ) }
144142 }
145143
146144 private class AssignExprTree extends StandardPostOrderTree instanceof AssignExpr {
@@ -151,7 +149,7 @@ module Trees {
151149 )
152150 }
153151
154- final override ControlFlowTree getChildElement ( int i ) {
152+ final override ControlFlowTree getChildNode ( int i ) {
155153 result = super .getLeftOperand ( ) and i = 0
156154 or
157155 result = super .getRightOperand ( ) and i = 1
@@ -167,7 +165,7 @@ module Trees {
167165 }
168166
169167 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 }
171169 }
172170
173171 abstract private class NonDefaultValueParameterTree extends ControlFlowTree instanceof NamedParameter
@@ -422,7 +420,7 @@ module Trees {
422420 not this .( MethodCall ) .isSafeNavigation ( )
423421 }
424422
425- override ControlFlowTree getChildElement ( int i ) { result = super .getArgument ( i ) }
423+ override ControlFlowTree getChildNode ( int i ) { result = super .getArgument ( i ) }
426424 }
427425
428426 private class CaseTree extends PostOrderTree instanceof CaseExpr , AstInternal:: TCaseExpr {
@@ -784,11 +782,11 @@ module Trees {
784782
785783 private class ParenthesizedPatternTree extends StandardPreOrderTree instanceof ParenthesizedPattern
786784 {
787- override ControlFlowTree getChildElement ( int i ) { result = super .getPattern ( ) and i = 0 }
785+ override ControlFlowTree getChildNode ( int i ) { result = super .getPattern ( ) and i = 0 }
788786 }
789787
790788 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 }
792790 }
793791
794792 private class InClauseTree extends PreOrderTree instanceof InClause {
@@ -997,7 +995,7 @@ module Trees {
997995
998996 private class DestructuredParameterTree extends StandardPostOrderTree instanceof DestructuredParameter
999997 {
1000- final override ControlFlowTree getChildElement ( int i ) { result = super .getElement ( i ) }
998+ final override ControlFlowTree getChildNode ( int i ) { result = super .getElement ( i ) }
1001999 }
10021000
10031001 private class DesugaredTree extends ControlFlowTree {
@@ -1059,12 +1057,12 @@ module Trees {
10591057 { }
10601058
10611059 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 ) }
10631061 }
10641062
10651063 private class InstanceVariableTree extends StandardPostOrderTree instanceof InstanceVariableAccess
10661064 {
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 }
10681066 }
10691067
10701068 private class KeywordParameterTree extends DefaultValueParameterTree instanceof KeywordParameter {
@@ -1139,7 +1137,7 @@ module Trees {
11391137 }
11401138
11411139 private class MethodCallTree extends CallTree instanceof MethodCall {
1142- final override ControlFlowTree getChildElement ( int i ) {
1140+ final override ControlFlowTree getChildNode ( int i ) {
11431141 result = super .getReceiver ( ) and i = 0
11441142 or
11451143 result = super .getArgument ( i - 1 )
@@ -1208,15 +1206,15 @@ module Trees {
12081206 }
12091207
12101208 private class PairTree extends StandardPostOrderTree instanceof Pair {
1211- final override ControlFlowTree getChildElement ( int i ) {
1209+ final override ControlFlowTree getChildNode ( int i ) {
12121210 result = super .getKey ( ) and i = 0
12131211 or
12141212 result = super .getValue ( ) and i = 1
12151213 }
12161214 }
12171215
12181216 private class RangeLiteralTree extends StandardPostOrderTree instanceof RangeLiteral {
1219- final override ControlFlowTree getChildElement ( int i ) {
1217+ final override ControlFlowTree getChildNode ( int i ) {
12201218 result = super .getBegin ( ) and i = 0
12211219 or
12221220 result = super .getEnd ( ) and i = 1
@@ -1314,7 +1312,7 @@ module Trees {
13141312 private class RetryStmtTree extends LeafTree instanceof RetryStmt { }
13151313
13161314 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 }
13181316 }
13191317
13201318 private class SimpleParameterTree extends NonDefaultValueParameterTree instanceof SimpleParameter {
@@ -1415,13 +1413,13 @@ module Trees {
14151413
14161414 private class StringConcatenationTree extends StandardPostOrderTree instanceof StringConcatenation
14171415 {
1418- final override ControlFlowTree getChildElement ( int i ) { result = super .getString ( i ) }
1416+ final override ControlFlowTree getChildNode ( int i ) { result = super .getString ( i ) }
14191417 }
14201418
14211419 private class StringlikeLiteralTree extends StandardPostOrderTree instanceof StringlikeLiteral {
14221420 StringlikeLiteralTree ( ) { not this instanceof HereDoc }
14231421
1424- final override ControlFlowTree getChildElement ( int i ) { result = super .getComponent ( i ) }
1422+ final override ControlFlowTree getChildNode ( int i ) { result = super .getComponent ( i ) }
14251423 }
14261424
14271425 private class StringComponentTree extends LeafTree instanceof StringComponent {
@@ -1447,7 +1445,7 @@ module Trees {
14471445 }
14481446
14491447 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 ) }
14511449 }
14521450
14531451 private class WhenTree extends ControlFlowTree instanceof WhenClause {
0 commit comments