
Each statement can be marked with a label. The label must be followed by a statement, which can also be an
"empty statement".
The scope of a label is the function in which it was declared, i.e. a "goto" statement cannot jump from the
current function to another function.
12.5.6.2 Composite statements
A composite statement (also known as a block) is a series of zero or several statements that is enclosed by
brackets ("{" and "}"). The closing bracket ("}") must not be followed by a semicolon. Each statement can be
replaced by a block. A composite statement that does not comprise any statements is a special case and is
known as an "empty statement".
12.5.6.3 Expression statement
Each expression becomes a statement when a semicolon (";") is added. An expression also becomes a
statement, if the expression is only followed by blank spaces to the end of the line, and the expression is not
continued in the next line.
12.5.6.4 Empty statement
An empty statement does not execute any statements and consists of a block statement without statements,
i.e. it consists of the "{ }" symbol. Empty statements are implemented in control flow statements without
actions (e.g. "while (!iskey()) {}") or if a label is defined exactly before the closing bracket of a block statement.
An empty statement does not end with a semicolon.
12.5.6.5 Assert expression
The program is aborted with a runtime error if the expression is logical "false"
Note:
This expression protects against "impossible" or invalid conditions. In the following example, a
negative fibonacci number is invalid. The assert statement marks this error as a programming error.
Assert statements should only ever highlight programmer errors and never user inputs.
Example:
fibonacci(n)
{
assert n > 0
new a = 0, b = 1
for (new i = 2; i < n; i++)
{
new c = a + b
a = b
b = c
}
return a + b
}
174
Rev. 01
Содержание myDatalogEASY IoTmini
Страница 2: ......
Страница 11: ...Chapter 2 Declaration of conformity Chapter 2 Declaration of conformity Rev 01 11 ...
Страница 12: ......
Страница 34: ......
Страница 66: ......
Страница 78: ......
Страница 82: ......
Страница 186: ......
Страница 194: ......
Страница 196: ......
Страница 202: ......
Страница 205: ...Chapter 19 Document history Chapter 19 Document history Rev Date Changes 01 28 08 2020 First version Rev 01 205 ...
Страница 206: ......
Страница 208: ......