If the condition yields `true`, the first block is executed. When and if execution reaches an end point, the program continues with the statement following the `if` statement.
If the condition yields `false`, the else part is executed if present.
The following two examples are semantically equivalent:
```ttcn3 example
if (cond1) {
// consequence 1
} else if (cond2) {
// consequence 2
} else {
// alternative
}
```
```ttcn3 example
if (cond1) {
// consequence 1
} else {
if (cond2) {
// consequence 2
} else {
// alternative
}
}
```
### `select` statements
The `select` statement evaluates a condition once and compares the result to a
set of cases. The first case that matches the condition is executed.
The condition may be preceded by a simple statement, which executes before the
condition is evaluated. The scope of variables declared within that simple
statement shall be limited to the select-statement.
The condition shall be an boolean expression. If the condition yields `true`,
the block is executed. When and if execution reaches an end point, the program
continues with the statement following the `while` statement.
### Do-while statement
The `do`-`while` statement executes a block based on the evaluation of its condition one or more times.
```ebnf
DoWhileStmt = "do" Block "while" "(" Expr ")".
```
The condition shall be an boolean expression.
The code block is executed. When and if execution reaches an end point, the condition is evaluated. If the condition yields `true`, the block is executed again. If the condition yields `false`, the program continues with the statement following the `do`-`while` statement.
### Break statement
The `break` statement terminates the execution of the innermost loop, `alt` or `interleave` statement.
```ebnf
BreakStmt = "break".
```
A `break` statement that is not within a loop shall cause an error.
### Continue statement
The `continue` statement terminates the current iteration of the innermost loop and continues with the next iteration.
```ebnf
ContinueStmt = "continue".
```
A `continue` statement that is not within a loop shall cause an error.
## `repeat`
The `repeat` statement re-evaluates the innermost `alt` statement.
```ebnf
RepeatStmt = "repeat".
```
## `goto` statement
The `goto` statement transfers control to a statement with a matching label