OSI Method definition
OSI supports a number of method types, which are supported by BNF. The OSI Method BNF provides entry points to following methods types:
- function
- expression
- template
- window
The window definition in scripts is planned but not supported so far.
// The OSI Method BNF provides entry points methods:
// C++ function
// OSI function
// template
// window
OSIMethod := '$@' // defined for providing the bnf class name
// OSI specifications ...
OSIFunction := [meth_dcl] expr_code [';']
// method definitions
method := [block_intro(*)] method_spec
method_spec := xml_template | text_template | function | form | control
// xml templates (this is not as simple like this!!!)
xml_template := xml_def | xml_expr_dcl
xml_def := beg_template [xml_header] [xml_variables] xml_spec end_template
xml_header := beg_header meth_dcl end_header
xml_variables := beg_variables member(*) end_variables
xml_spec := beg_process templ_text end_process
xml_expr_dcl := _xtemplate expr_dcl
// text templates
//text_template := templ_def | templ_code | templ_expr_dcl
text_template := templ_def | templ_expr_dcl
templ_def := t_template meth_dcl '$' templ_code
templ_code == [var_templ] templ_text
var_templ := t_variables [ member(*) ] t_process
t_variables := _dollar _variables _dollar
t_process := _dollar _process _dollar
templ_expr_dcl := _template expr_dcl
// template text ( == - ignore keywords )
templ_text == templ_string(*)
templ_string == embedded_expr | templ_char | fixtext
templ_char := templ_nl | templ_comment | dollar | bss
dollar := '\\$'
templ_comment := '\\/'
templ_nl := bsn | bsb
// template statements
embedded_expr := comp_expr | output_expr | if_expr | else_expr | end_expr | while_expr | for_expr | switch_expr | case_expr | other_expr | break_expr | leave_expr | continue_expr | return_expr
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
break_expr := _dollar _break _dollar
leave_expr := _dollar _leave_ _dollar
continue_expr := _dollar _continue _dollar
output_expr := _dollar [operand] _dollar
// OSI functions: entry points: OSIFunction, function
function := _function expr_spec
expr_spec := expr_dcl | expr_def
expr_dcl := meth_dcl ';'
expr_def := meth_dcl expr_code [';']
// expr_code kommt weiter hinten
var_defs := _variables [ member(*) ]
init_code := _init [ statement(*) ]
proc_code := [ _process ] statement(*)
error_code := _on_error [ statement(*) ]
final_code := _final [ statement(*) ]
// window definition (not yet implemented
form := _form identifier [';']
// control definition (not yet implemented
control := _control identifier [';']
// expr_code müssen hier liegen, damit statement nicht zu früh kommt
expr_code := '{' [var_defs] [init_code] [proc_code] [error_code] [final_code] '}'
// OQL keywords
_function := 'function' | _function_
_function_ :: 'FUNCTION'
_form := 'form' | __form
__form :: 'FORM'
_control := 'control' | __control
__control :: 'CONTROL'
_variables := 'variables' | __variables
__variables :: 'VARIABLES'
_init := 'init' | __init
__init :: 'INIT'
_process := 'process' | __process
__process :: 'PROCESS' | 'BEGINSEQ'
_on_error := 'on_error' | __on_error
__on_error :: 'ON_ERROR' | 'RECOVER'
_final := 'final' | __final
__final :: 'FINAL' | 'ENDSEQ'
//t_variables :: '$variables$'| '$VARIABLES$'
//t_process :: '$process$' | '$PROCESS$'
//t_end :: '$end' | '$END'
t_template :: '$template' | '$TEMPLATE'
_end := 'end' | 'END'
_dollar := '$'
_template := 'template' | __template
__template :: 'TEMPLATE'
_xtemplate := 'xtemplate' | __xtemplate
__xtemplate :: 'XTEMPLATE'
beg_template :: '<template>'
end_template :: '</template>'
beg_header :: '<header>'
end_header :: '</header>'
beg_variables :: '<variables>'
end_variables :: '</variables>'
beg_process :: '<process>'
end_process :: '</process>'
// OQL specifications END
// comment line characters
CC := '//'
// bnf references
common_symbols ::= class(OSICommon)
block_intro ::= ref(block_intro)
comment_block ::= ref(comment_block)
identifier ::= ref(identifier)
_default ::= ref(_default)
stmt_symbols ::= class(OSIStatement)
statement ::= ref(statement)
istatement ::= ref(istatement)
block ::= ref(block)
for_condition ::= ref(for_condition)
_if ::= ref(_if)
_else ::= ref(_else)
_while ::= ref(_while)
_for ::= ref(_for)
_switch ::= ref(_switch)
_case ::= ref(_case)
_return ::= ref(_return)
_leave_ ::= ref(_leave_)
_continue ::= ref(_continue)
_break ::= ref(_break)
oper_symbols ::= class(OSIOperand)
operand ::= ref(operand)
simple_op ::= ref(simple_op)
member_symbols ::= class(OSIMember)
meth_dcl ::= ref(meth_dcl)
member ::= ref(member)
imember ::= ref(imember)
std_symbols ::= class(BNFStandardSymbols)
string ::= ref(std_string)
fixtext ::= ref(std_fixtext)
bss ::= ref(std_bss)
bsb ::= ref(std_bsb)
bsn ::= ref(std_bsn)