Module Completion

INTERNAL: Do not use.

Provides classes representing control flow completions.

A completion represents how a statement or expression terminates.

There are six kinds of completions: normal completion, return completion, break completion, continue completion, goto completion, and throw completion.

Normal completions are further subdivided into Boolean completions and all other normal completions. A Boolean completion adds the information that the expression terminated with the given boolean value due to a subexpression terminating with the other given Boolean value. This is only relevant for conditional contexts in which the value controls the control-flow successor.

Goto successors are further subdivided into label gotos, case gotos, and default gotos.

Import path

semmle.code.csharp.controlflow.Completion

Imports

csharp

The default C# QL library.

Predicates

foreachEmptiness

Holds if cfe is the element inside foreach statement fs that has the emptiness completion.

switchMatching

Holds if cfe is the element inside case statement cs, belonging to switch statement ss, that has the matching completion.

Classes

BooleanCompletion

A completion that represents evaluation of an expression with a Boolean value.

BreakCompletion

A completion that represents evaluation of a statement or an expression resulting in a break (in a loop or in a switch statement).

BreakNormalCompletion

A completion that represents evaluation of a statement or expression resulting in a loop break.

Completion

A completion of a statement or an expression.

ConditionalCompletion

A completion that represents evaluation of an expression, whose value determines the successor. Either a Boolean completion (BooleanCompletion), a nullness completion (NullnessCompletion), a matching completion (MatchingCompletion), or an emptiness completion (EmptinessCompletion).

ContinueCompletion

A completion that represents evaluation of a statement or an expression resulting in a loop continuation (a continue statement).

EmptinessCompletion

A completion that represents evaluation of an emptiness test, for example a test in a foreach statement.

ExitCompletion

A completion that represents evaluation of a statement or an expression resulting in a program exit, for example System.Environment.Exit(0).

FalseCompletion

A Boolean false completion.

GotoCaseCompletion

A completion that represents evaluation of a statement or an expression resulting in a goto case jump.

GotoCompletion

A completion that represents evaluation of a statement or an expression resulting in a goto jump.

GotoDefaultCompletion

A completion that represents evaluation of a statement or an expression resulting in a goto default jump.

GotoLabelCompletion

A completion that represents evaluation of a statement or an expression resulting in a goto label jump.

MatchingCompletion

A completion that represents matching, for example a case statement in a switch statement.

NormalCompletion

A completion that represents normal evaluation of a statement or an expression.

NullnessCompletion

A completion that represents evaluation of an expression that is either null or non-null.

ReturnCompletion

A completion that represents evaluation of a statement or an expression resulting in a return from a callable.

SimpleCompletion

A class to make TNormalCompletion a NormalCompletion

ThrowCompletion

A completion that represents evaluation of a statement or an expression resulting in a thrown exception.

TrueCompletion

A Boolean true completion.