An empty statement does nothing.
statement
: ';'
;
An empty statement is used when there are no operations to perform in a context where a statement is required.
A block statement allows a list of statements where a single statement is allowed.
statementBlock
: block
;
block
: '{' (statement)* '}'
;
A block statement is executed as follows:
statement in the block then to the next statement and so on until the last statement is reached. After the last statement the execution is transferred at the end of the block. The end of the block will not be reached if: (a) a return statement is reached or (b) an error has occured.The assign statement assigns the value of an evaluable to an assignable.
statementAssign
: assignable '=' evaluable
;
An assign statement is executed as follows:
evaluable is assignable directly or by implicit conversion to the type of the assignable.The variable declaration statement is used to define variable in the context of the enclosing block.
statementVar
: 'var' ID (('=' evaluable) | 'as' scalarTypeInstance)
;
A variable declare statement is executed as follows:
evaluable is evaluated. The value produced by the evaluable will be the value of the variable.scalarTypeInstance is called to obtain the value of the variable.The function call statement is used to call methods (of functions igoring their return value) outside expressions.
functionCall
: obj '->' functionCallMethod functionCallArguments
;
statementIf
: 'if' '(' evaluable ')' t=statement ('else' f=statement)?
;
The if statement is executed as follows:
bool type. The compiler validates that the type of the of the value produced by the evaluable is assignable directly or by implicit conversion to bool.true then the execution is transferred to the t statement.false then the execution is transferred to the f statement.statementForEach
: 'foreach' ID 'in' evaluable statement
;
The foreach statement is executed as follows:
collection type. The compiler validates that the type of the of the value produced by the evaluable is assignable directly or by implicit conversion to collection.ID identifier.statement.statement
: 'break' ';'
;
statement
: 'continue' ';'
;
statementReturn
: 'return' expression
;
entityDeleteStatement
: 'DELETE' ID '(' expression ')'
| 'DELETE' variable
| 'DELETE' 'CHILD' v1=variable relationshipName=ID v2=variable
;
entityPutStatement
: 'PUT' variable
;
entityIncrement
: 'INCREMENT' property evaluable
;