Statements¶
Statements control execution and side effects within blocks.
Overview¶
The SOURCE
statement declares a data source for the pipeline.
Output¶
The OUTPUT
statement specifies how results are emitted from the pipeline.
Using¶
The USING
clause references adapters and external modules.
Transform¶
The TRANSFORM
statement defines transformation steps in the pipeline.
Stream¶
The STREAM
mode processes data as a continuous flow.
Buffer¶
The BUFFER
mode collects data before processing.
For Loops¶
The FOR
and FOR EACH
statements provide iteration over collections.
If Statements¶
The IF
statement provides conditional branching.
Enumerations¶
The ENUM
statement defines enumerated types.
For Each¶
The FOREACH
statement provides a shortcut for iteration.
Input¶
The INPUT
keyword references the pipeline input data.
Parallel¶
The PARALLEL
statement enables concurrent execution.
Abort¶
The ABORT
statement terminates execution immediately.
Throw¶
The THROW
statement raises an exception.
Try¶
The TRY
statement handles errors and exceptions.
Shared¶
The SHARED
statement declares shared memory resources.
Functions¶
The FUNC
statement declares functions.
Types¶
The TYPE
statement declares custom types.
Return¶
The RETURN
statement exits from functions.
Modify¶
The MODIFY
statement changes existing values.
Where¶
The WHERE
clause provides filtering conditions.
Set¶
The SET
statement performs assignments.
Init¶
The INIT
statement provides initial values.
statement ::= letStmt | ifStmt | forStmt | tryStmt | callStmt
| sharedWrite | suspendStmt | abortStmt | throwStmt
| nestedOutput | expressionStmt | ;
Variable binding¶
LET
introduces a new variable bound to the result of an expression【F:language/src/test/kotlin/v2/ebnf.txt†L82-L82】.
Control flow¶
ifStmt ::= IF expression block ( ELSE block )?
forStmt ::= ( FOR EACH | FOR ) IDENTIFIER IN expression block
Conditionals and loops evaluate expressions to drive branching and iteration【F:language/src/test/kotlin/v2/ebnf.txt†L83-L85】.
Error handling¶
TRY
evaluates an expression and binds an error to the given identifier if one
occurs【F:language/src/test/kotlin/v2/ebnf.txt†L85-L85】.
Calls and mutation¶
callStmt ::= optAwait CALL IDENTIFIER "(" argList? ")" arrow IDENTIFIER ";"
sharedWrite ::= IDENTIFIER "[" expression? "]" "=" expression ";"
Call statements invoke suspended functions, while sharedWrite
mutates shared
memory slots【F:language/src/test/kotlin/v2/ebnf.txt†L86-L90】.
Suspension and termination¶
suspendStmt ::= SUSPEND expression ";"
abortStmt ::= ABORT expression? ";"
throwStmt ::= THROW expression? ";"
These statements pause or terminate execution, optionally carrying an expression【F:language/src/test/kotlin/v2/ebnf.txt†L90-L92】.
Nested output and expressions¶
Nested OUTPUT
blocks and bare expressions complete the statement set【F:language/src/test/kotlin/v2/ebnf.txt†L93-L94】.