company logo

BNF entry points for ODL and OSI

The OSI/ODL BNF provides two entry points for importing schema definitions (ODL) and for running script files (OSI).

OSI is an ODL/OQL extension, which provides additional features for script interfaces. OSI supports defining global expressions and variables. When calling an OSI script without entry point, the global expression with the name "main" is used as entry point. Parameters passed to the entry point are passed as string parameters in the sequence as defined when calling the script.

ODL differs between state and behavior. Usually, an interface describes behavior, while a literal (structure or enumeration) describes a state. Classes may define states and behavior. Inheritance relationship is restricted to behavior. Thus, classes and interfaces may inherit behavior from other interfaces but not from a class. Classes may inherit from other classes by EXTENDS relationships, only.


// The OSI BNF provides two entry points for importing schema definitions (ODL) and for

// running script files (OSI).

// ODABA Script Interface (OSI)

// OSI is an ODL/OQL extension, which provides additional features for script interfaces.

// OSI supports defining global expressions and variables. When calling an OSI script

// whithout entry point, the global expression with the name 'main' is used as entry point.

// Parameters passed to the entry point are passed as string parameters in the sequence as defined

// when calling the script.

OSI                   := [data_source] [debug_info] osi_element(*)

debug_info            := _debugprocs '=' location ';'

osi_element           := [block_intro(*)] osi_definition

_debugprocs           := 'debug_procedures'  | __debugprocs

__debugprocs          :: 'DEBUG_PROCEDURES'

// ODL Schema

// ODL differs between state and behaviour. Usually, an interface describes behaviour,

// while a literal (structure or enumeration) describes a state. Classes may define states

// and behaviour. Inheritance relationship is restricted to behaviour. Thus, classes and

// interfaces may inherit behaviour from other interfaces but not from a class. Classes

// may inherit from other classes by EXTENDS relationships, only.

ODL                   := [data_source] sc_elements

// schema_dcl    

sc_elements           := sc_element(*)

sc_element            := [block_intro(*)] [update_option] sc_definition

sc_definition         := schema_dcl | mod_elements | extensions_dcl

schema_dcl            := schema identifier [sc_options] '{' sc_elements '}' [';']

sc_options            := [sc_option(*)] [mod_options]

sc_option             := project_root | db_path

project_root          := location

db_path               := location

// module_dcl    

mod_elements          := mod_element(*)

mod_element           := [block_intro(*)] [update_option] [mod_definition]

mod_definition        := module_dcl | ns_elements

module_dcl            := _module identifier [mod_options] '{' mod_elements '}' [';']

mod_options           := [mod_option(*)] [ns_options]

mod_option            := context_interface | dll_name

context_interface     := identifier

dll_name              := identifier

// namespace_dcl    

ns_elements           := ns_element(*)

ns_element            := [block_intro(*)] [update_option] [ns_definition]

ns_definition         := namespace_dcl | odl_elements

namespace_dcl         := _namespace identifier [ns_options] '{' ns_elements '}' [';']

ns_options            := [ns_option(*)]

ns_option             := _active

odl_elements          := odl_element(*)

odl_element           := [block_intro(*)] [lang_definition]

lang_definition       := cppdefinition | javadefinition | csharpdefinition | jscriptdefinition | osidefinition | phpdefinition

cppdefinition         := _cpp cpp_definition

javadefinition        := _java java_definition

csharpdefinition      := _csharp csharp_definition

jscriptdefinition     := _jscript jscript_definition

phpdefinition         := _php php_definition

osidefinition         := [_osi] odl_definition

//   standard key words

schema                := 'schema'       | __schema

__schema              :: 'SCHEMA'

_module               := 'module'       | __module

__module              :: 'MODULE'

_namespace            := 'namespace'    | __namespace

__namespace           :: 'NAMESPACE'

_active               := 'active'       | __active

__active              :: 'ACTIVE'

_cpp                  := 'cpp'          | __cpp

__cpp                 :: 'CPP'

_java                 := 'java'         | __java

__java                :: 'JAVA'

_csharp               := 'csharp'       | __csharp

__csharp              :: 'CSHARP'

_jscript              := 'jscript'      | __jscript

__jscript             :: 'JSCRIPT'

_php                  := 'php'          | __php

__php                 :: 'PHP'

_osi                  := 'osi'          | __osi

__osi                 :: 'OSI'

//    ODABA keyword extensions

// comment line characters

CC                    := '//'

// bnf references

std_symbols          ::= class(BNFStandardSymbols)

string               ::= ref(std_string)

constant             ::= ref(std_constant)

spec_symbols         ::= class(BNFSpecialSymbols)

multiple_line        ::= ref(spec_line)

common_symbols       ::= class(OSICommon)

comment_block        ::= ref(comment_block)

identifier           ::= ref(identifier)

location             ::= ref(location)

block_intro          ::= ref(block_intro)

update_option        ::= ref(update_option)

data_source          ::= ref(data_source)

language_symbols     ::= class(OSILanguage)

cpp_definition       ::= ref(cpp_definition)

java_definition      ::= ref(java_definition)

csharp_definition    ::= ref(csharp_definition)

jscript_definition   ::= ref(jscript_definition)

php_definition       ::= ref(php_definition)

member_symbols       ::= class(OSIMember)

odl_definition       ::= ref(odl_definition)

osi_definition       ::= ref(osi_definition)

extensions_dcl       ::= ref(extensions_dcl)