OSI statement definition
Statements can be defined in ODL as well (e.g. defining the source for a transient member) . Mainly, however, statements are part of OSI scripts.
statement |= [debug_opt] istatement
istatement := basic_stmt | if_block | case_block | while_block | for_block | syntax_op | ';'
basic_stmt := stmt_operlist ';'
stmt_operlist := doperand [stoplist_ext(*)]
stoplist_ext := ',' doperand
doperand := [debug_opt] operand
if_block := _if condition bstatement [ else_stmt ]
else_stmt := [debug_opt] _else bstatement
while_block := _while condition bstatement
for_block := _for for_condition bstatement
for_condition := '(' basic_stmt basic_stmt stmt_operlist ')'
case_block := _switch condition '{' [ case_stmt(*) ] [ other_stmt ] '}'
case_stmt := [debug_opt] _case simple_op ':' [statement(*)] // statement war bisher obligatorisch, ffuehrt aber be C++ zu fehler
other_stmt := [debug_opt] _default ':' statement(*)
condition := '(' doperand ')' // in order to support multiple values, condition should be defined operand_list
bstatement := block | statement
// template statements
imbedded_expr := comp_expr | output_expr | if_expr | else_expr | end_expr | while_expr | for_expr | switch_expr | case_expr | other_expr |return_expr
output_expr := _dollar [operand] _dollar
comp_expr := _dollar block _dollar
if_expr := _dollar _if operand _dollar
else_expr := _dollar _else _dollar
end_expr := _dollar _end _dollar
while_expr := _dollar _while operand _dollar
for_expr := _dollar _for for_condition _dollar
switch_expr := _dollar _switch operand _dollar
case_expr := _dollar _case simple_op _dollar
other_expr := _dollar _default _dollar
return_expr := _dollar _return operand _dollar
// common
debug_opt := '#' [ auto_run ]
auto_run := ':' identifier
syntax_op := return_op | error_op | leave_op | continue_op | break_op | exception_op | nv_op | eh_op
return_op := _return [operand] ';'
error_op := _error [operand] ';'
eh_op := _exceptions [err_handling] ';'
nv_op := _null_value [err_handling] ';'
err_handling := _accept | _ignore | _exception
exception_op := _exception [operand] ';'
leave_op := _leave_ ';'
break_op := _break ';'
continue_op := _continue ';'
// block and expr_code have to be defined here!!
block := '{' [ statement(*) ] '}'
// standard key words
_exception := 'exception' | __exception
__exception :: 'EXCEPTION'
// OQL keywords
_if :: 'if' | 'IF'
_else :: 'else' | 'ELSE'
_while :: 'while' | 'WHILE'
_for :: 'for' | 'FOR'
_continue :: 'continue' | 'CONTINUE'
_leave_ :: 'leave' | 'LEAVE'
_break :: 'break' | 'BREAK'
_error :: 'error' | 'ERROR'
_return :: 'return' | 'RETURN'
_end :: 'end' | 'END'
_null_value :: '#NullValue' | '#NULLVALUE'
_exceptions :: '#Exceptions'| '#EXCEPTIONS'
_ignore := 'ignore' | 'IGNORE'
_accept := 'accept' | 'ACCEPT'
_dollar := '$'
// OQL specifications END
// comment line characters
CC := '//'
// bnf references
common_symbols ::= class(OSICommon)
identifier ::= ref(identifier)
_switch ::= ref(_switch)
_case ::= ref(_case)
_default ::= ref(_default)
oper_symbols ::= class(OSIOperand)
operand ::= ref(operand)
simple_op ::= ref(simple_op)

