33private import codeql.ruby.AST
44private import codeql.ruby.controlflow.BasicBlocks
55private import SuccessorTypes
6- private import internal.ControlFlowGraphImpl
6+ private import internal.ControlFlowGraphImpl as CfgImpl
77private import internal.Splitting
88private import internal.Completion
99
@@ -15,12 +15,12 @@ private import internal.Completion
1515 * Note that module declarations are not themselves CFG scopes, as they are part of
1616 * the CFG of the enclosing top-level or callable.
1717 */
18- class CfgScope extends Scope instanceof CfgScopeImpl {
18+ class CfgScope extends Scope instanceof CfgImpl :: CfgScopeImpl {
1919 /** Gets the CFG scope that this scope is nested under, if any. */
2020 final CfgScope getOuterCfgScope ( ) {
2121 exists ( AstNode parent |
2222 parent = this .getParent ( ) and
23- result = getCfgScope ( parent )
23+ result = CfgImpl :: getCfgScope ( parent )
2424 )
2525 }
2626}
@@ -33,7 +33,7 @@ class CfgScope extends Scope instanceof CfgScopeImpl {
3333 *
3434 * Only nodes that can be reached from an entry point are included in the CFG.
3535 */
36- class CfgNode extends TCfgNode {
36+ class CfgNode extends CfgImpl :: TCfgNode {
3737 /** Gets the name of the primary QL class for this node. */
3838 string getAPrimaryQlClass ( ) { none ( ) }
3939
@@ -53,13 +53,13 @@ class CfgNode extends TCfgNode {
5353 final predicate isCondition ( ) { exists ( this .getASuccessor ( any ( ConditionalSuccessor bs ) ) ) }
5454
5555 /** Gets the scope of this node. */
56- final CfgScope getScope ( ) { result = getNodeCfgScope ( this ) }
56+ final CfgScope getScope ( ) { result = CfgImpl :: getNodeCfgScope ( this ) }
5757
5858 /** Gets the basic block that this control flow node belongs to. */
5959 BasicBlock getBasicBlock ( ) { result .getANode ( ) = this }
6060
6161 /** Gets a successor node of a given type, if any. */
62- final CfgNode getASuccessor ( SuccessorType t ) { result = getASuccessor ( this , t ) }
62+ final CfgNode getASuccessor ( SuccessorType t ) { result = CfgImpl :: getASuccessor ( this , t ) }
6363
6464 /** Gets an immediate successor, if any. */
6565 final CfgNode getASuccessor ( ) { result = this .getASuccessor ( _) }
@@ -78,15 +78,15 @@ class CfgNode extends TCfgNode {
7878}
7979
8080/** The type of a control flow successor. */
81- class SuccessorType extends TSuccessorType {
81+ class SuccessorType extends CfgImpl :: TSuccessorType {
8282 /** Gets a textual representation of successor type. */
8383 string toString ( ) { none ( ) }
8484}
8585
8686/** Provides different types of control flow successor types. */
8787module SuccessorTypes {
8888 /** A normal control flow successor. */
89- class NormalSuccessor extends SuccessorType , TSuccessorSuccessor {
89+ class NormalSuccessor extends SuccessorType , CfgImpl :: TSuccessorSuccessor {
9090 final override string toString ( ) { result = "successor" }
9191 }
9292
@@ -99,9 +99,9 @@ module SuccessorTypes {
9999 boolean value ;
100100
101101 ConditionalSuccessor ( ) {
102- this = TBooleanSuccessor ( value ) or
103- this = TEmptinessSuccessor ( value ) or
104- this = TMatchingSuccessor ( value )
102+ this = CfgImpl :: TBooleanSuccessor ( value ) or
103+ this = CfgImpl :: TEmptinessSuccessor ( value ) or
104+ this = CfgImpl :: TMatchingSuccessor ( value )
105105 }
106106
107107 /** Gets the Boolean value of this successor. */
@@ -125,7 +125,7 @@ module SuccessorTypes {
125125 *
126126 * `x >= 0` has both a `true` successor and a `false` successor.
127127 */
128- class BooleanSuccessor extends ConditionalSuccessor , TBooleanSuccessor { }
128+ class BooleanSuccessor extends ConditionalSuccessor , CfgImpl :: TBooleanSuccessor { }
129129
130130 /**
131131 * An emptiness control flow successor.
@@ -158,7 +158,7 @@ module SuccessorTypes {
158158 * \___/
159159 * ```
160160 */
161- class EmptinessSuccessor extends ConditionalSuccessor , TEmptinessSuccessor {
161+ class EmptinessSuccessor extends ConditionalSuccessor , CfgImpl :: TEmptinessSuccessor {
162162 override string toString ( ) { if value = true then result = "empty" else result = "non-empty" }
163163 }
164164
@@ -189,7 +189,7 @@ module SuccessorTypes {
189189 * puts "one" puts "not one"
190190 * ```
191191 */
192- class MatchingSuccessor extends ConditionalSuccessor , TMatchingSuccessor {
192+ class MatchingSuccessor extends ConditionalSuccessor , CfgImpl :: TMatchingSuccessor {
193193 override string toString ( ) { if value = true then result = "match" else result = "no-match" }
194194 }
195195
@@ -207,7 +207,7 @@ module SuccessorTypes {
207207 * The exit node of `sum` is a `return` successor of the `return x + y`
208208 * statement.
209209 */
210- class ReturnSuccessor extends SuccessorType , TReturnSuccessor {
210+ class ReturnSuccessor extends SuccessorType , CfgImpl :: TReturnSuccessor {
211211 final override string toString ( ) { result = "return" }
212212 }
213213
@@ -230,7 +230,7 @@ module SuccessorTypes {
230230 *
231231 * The node `puts "done"` is `break` successor of the node `break`.
232232 */
233- class BreakSuccessor extends SuccessorType , TBreakSuccessor {
233+ class BreakSuccessor extends SuccessorType , CfgImpl :: TBreakSuccessor {
234234 final override string toString ( ) { result = "break" }
235235 }
236236
@@ -253,7 +253,7 @@ module SuccessorTypes {
253253 *
254254 * The node `x >= 0` is `next` successor of the node `next`.
255255 */
256- class NextSuccessor extends SuccessorType , TNextSuccessor {
256+ class NextSuccessor extends SuccessorType , CfgImpl :: TNextSuccessor {
257257 final override string toString ( ) { result = "next" }
258258 }
259259
@@ -278,7 +278,7 @@ module SuccessorTypes {
278278 *
279279 * The node `x -= 1` is `redo` successor of the node `redo`.
280280 */
281- class RedoSuccessor extends SuccessorType , TRedoSuccessor {
281+ class RedoSuccessor extends SuccessorType , CfgImpl :: TRedoSuccessor {
282282 final override string toString ( ) { result = "redo" }
283283 }
284284
@@ -302,7 +302,7 @@ module SuccessorTypes {
302302 *
303303 * The node `puts "Retry"` is `retry` successor of the node `retry`.
304304 */
305- class RetrySuccessor extends SuccessorType , TRetrySuccessor {
305+ class RetrySuccessor extends SuccessorType , CfgImpl :: TRetrySuccessor {
306306 final override string toString ( ) { result = "retry" }
307307 }
308308
@@ -323,7 +323,7 @@ module SuccessorTypes {
323323 * The exit node of `m` is an exceptional successor of the node
324324 * `raise "x > 2"`.
325325 */
326- class RaiseSuccessor extends SuccessorType , TRaiseSuccessor {
326+ class RaiseSuccessor extends SuccessorType , CfgImpl :: TRaiseSuccessor {
327327 final override string toString ( ) { result = "raise" }
328328 }
329329
@@ -344,7 +344,7 @@ module SuccessorTypes {
344344 * The exit node of `m` is an exit successor of the node
345345 * `exit 1`.
346346 */
347- class ExitSuccessor extends SuccessorType , TExitSuccessor {
347+ class ExitSuccessor extends SuccessorType , CfgImpl :: TExitSuccessor {
348348 final override string toString ( ) { result = "exit" }
349349 }
350350}
0 commit comments