Previous Table of Contents Next


3.4 OMG IDL Grammar

(34) <add_expr> ::= <mult_expr>
| <add_expr> “+? <mult_expr>
| <add_expr> “-? <mult_expr>
(35) <mult_expr> ::= <unary_expr>
| <mult_expr> “*? <unary_expr>
| <mult_expr> “/? <unary_expr>
| <mult_expr> “%? <unary_expr>
(36) <unary_expr> ::= <unary_operator> <primary_expr>
| <primary_expr>
(37) <unary_operator> ::= “-?
| “+?
| “~?
(38) <primary_expr> ::= <scoped_name>
| <literal>
| “(? <const_exp> “)?
(39) <literal> ::= <integer_literal>
| <string_literal>
| <wide_string_literal>
| <character_literal>
| <wide_character_literal>
| <fixed_pt_literal>
| <floating_pt_literal>
| <boolean_literal>
(40) <boolean_literal> ::= “TRUE?
| “FALSE?
(41) <positive_int_const> ::= <const_exp>
(42) <type_dcl> ::= “typedef? <type_declarator>
| <struct_type>
| <union_type>
| <enum_type>
| “native? <simple_declarator>
| <constr_forward_decl>
(43) <type_declarator> ::= <type_spec> <declarators>
(44) <type_spec> ::= <simple_type_spec>
| <constr_type_spec>
(45) <simple_type_spec> ::= <base_type_spec>
| <template_type_spec>
| <scoped_name>
(46) <base_type_spec> ::= <floating_pt_type>
| <integer_type>
| <char_type>
| <wide_char_type>
| <boolean_type>
| <octet_type>
| <any_type>
| <object_type>
| <value_base_type>
(47) <template_type_spec> ::= <sequence_type>

| <string_type>

| <wide_string_type>

| <fixed_pt_type>

(48) <constr_type_spec>

(49) <declarators>

(50) <declarator>

(51) <simple_declarator>

(52) <complex_declarator>

(53) <floating_pt_type>

(54) <integer_type>

(55) <signed_int>

(56) <signed_short_int>

(57) <signed_long_int>

(58) <signed_longlong_int>

(59) <unsigned_int>

(60) <unsigned_short_int>

(61) <unsigned_long_int>

(62) <unsigned_longlong_int>

(63) <char_type>

(64) <wide_char_type>

(65) <boolean_type>

(66) <octet_type>

(67) <any_type>

(68) <object_type>

(69) <struct_type>

(70) <member_list>

(71) <member>

(72) <union_type>

(73) <switch_type_spec>

(74) <switch_body>

::= <struct_type>
| <union_type>
| <enum_type>
::= <declarator> { “,? <declarator> }∗
::= <simple_declarator>
| <complex_declarator>
::= <identifier>
::= <array_declarator>
::= “float?
| “double?
| “long? “double?
::= <signed_int>
| <unsigned_int>
::= <signed_short_int>
| <signed_long_int>
| <signed_longlong_int>
::= “short?
::= “long?
::= “long? “long?
::= <unsigned_short_int>
| <unsigned_long_int>
| <unsigned_longlong_int>
::= “unsigned? “short?
::= “unsigned? “long?
::= “unsigned? “long? “long?
::= “char?
::= “wchar?
::= “boolean?
::= “octet?
::= “any?
::= “Object?
::= “struct? <identifier> “{? <member_list> “}?
::= <member>+
::= <type_spec> <declarators> “;?
::= “union? <identifier> “switch?
“(? <switch_type_spec> “)?
“{? <switch_body> “}?
::= <integer_type>
| <char_type>
| <boolean_type>
| <enum_type>
| <scoped_name>
::= <case>+

(75) <case> ::= <case_label>+ <element_spec> “;?
(76) <case_label> ::= “case? <const_exp> “:?
| “default? “:?
(77) <element_spec> ::= <type_spec> <declarator>
(78) <enum_type> ::= “enum? <identifier> “{? <enumerator> { “,? <enumerator> }∗ “}?
(79) <enumerator> ::= <identifier>
(80) <sequence_type> ::= “sequence? “<? <simple_type_spec> “,?
<positive_int_const> “>?
| “sequence? “<? <simple_type_spec> “>?
(81) <string_type> ::= “string? “<? <positive_int_const> “>?
| “string?
(82) <wide_string_type> ::= “wstring? “<? <positive_int_const> “>?
| “wstring?
(83) <array_declarator> ::= <identifier> <fixed_array_size>+
(84) <fixed_array_size> ::= “[? <positive_int_const> “]?
(85) <attr_dcl> ::= <readonly_attr_spec>
| <attr_spec>
(86) <except_dcl> ::= “exception? <identifier> “{“ <member>* “}?
(87) <op_dcl> ::= [ <op_attribute> ] <op_type_spec>
<identifier> <parameter_dcls>
[ <raises_expr> ] [ <context_expr> ]
(88) <op_attribute> ::= “oneway?
(89) <op_type_spec> ::= <param_type_spec>
| “void?
(90) <parameter_dcls> ::= “(? <param_dcl> { “,? <param_dcl> }∗ “)?
| “(? “)?
(91) <param_dcl> ::= <param_attribute> <param_type_spec>
<simple_declarator>
(92) <param_attribute> ::= “in?
| “out?
| “inout?
(93) <raises_expr> ::= “raises? “(? <scoped_name> { “,? <scoped_name> }∗ “)?
(94) <context_expr> ::= “context? “(? <string_literal> { “,? <string_literal> }∗ “)?
(95) <param_type_spec> ::= <base_type_spec>
| <string_type>
| <wide_string_type>
| <scoped_name>
(96) <fixed_pt_type> ::= “fixed? “<“ <positive_int_const> “,?
<positive_int_const> “>?
(97) <fixed_pt_const_type> ::= “fixed?
(98) <value_base_type> ::= “ValueBase?
(99) <constr_forward_decl> ::= “struct? <identifier>
| “union? <identifier>

   (100) <import> ::= “import? <imported_scope> “;?

   (101) <imported_scope> ::= <scoped_name> | <string_literal>

   (102) <type_id_dcl> ::= “typeid? <scoped_name> <string_literal>

   (103) <type_prefix_dcl> ::= “typeprefix? <scoped_name> <string_literal>

   (104) <readonly_attr_spec> ::= “readonly? “attribute? <param_type_spec> <readonly_attr_declarator> (105)<readonly_attr_declarator >::= <simple_declarator> <raises_expr>

   | <simple_declarator> { “,? <simple_declarator> }*

   (106) <attr_spec> ::= “attribute? <param_type_spec> <attr_declarator>

   (107) <attr_declarator> ::= <simple_declarator> <attr_raises_expr>

   | <simple_declarator> { “,? <simple_declarator> }*

   (108) <attr_raises_expr> ::= <get_excep_expr> [ <set_excep_expr> ] | <set_excep_expr>

   (109) <get_excep_expr> ::= “getraises? <exception_list>

   (110) <set_excep_expr> ::= “setraises? <exception_list>

   (111) <exception_list> ::= “(? <scoped_name> { “,? <scoped_name> } * “)?

   Note – Grammar rules 1 through 111 with the exception of the last three lines of rule 2 constitutes the portion of IDL that is not related to components.

   (112) <component> ::= <component_dcl>

   | <component_forward_dcl> (113)<component_forward_dcl>::= “component? <identifier>

   (114) <component_dcl> ::= <component_header> “{? <component_body> “}?

   (115) <component_header> ::= “component? <identifier> [ <component_inheritance_spec> ] [ <supported_interface_spec> ]

   (116)<supported_interface_spec> ::= “supports? <scoped_name> { “,? <scoped_name> }* (117)<component_inheritance_spec>::= “:? <scoped_name>

   (118) <component_body> ::= <component_export>*

   (119) <component_export> ::= <provides_dcl> “;? | <uses_dcl> “;? | <emits_dcl> “;? | <publishes_dcl> “;? | <consumes_dcl> “;? | <attr_dcl> “;?

   (120) <provides_dcl> ::= “provides? <interface_type> <identifier>

   (121) <interface_type> ::= <scoped_name> | “Object?

   (122) <uses_dcl> ::= “uses? [ “multiple? ] < interface_type> <identifier>

   (123) <emits_dcl> ::= “emits? <scoped_name> <identifier>

   (124) <publishes_dcl> ::= “publishes? <scoped_name> <identifier>

   (125) <consumes_dcl> ::= “consumes? <scoped_name> <identifier>

   (126) <home_dcl> ::= <home_header> <home_body>

   (127) <home_header> ::= “home? <identifier> [ <home_inheritance_spec> ] [ <supported_interface_spec> ] “manages? <scoped_name> [ <primary_key_spec> ]

   (128)<home_inheritance_spec> ::= “:? <scoped_name>

   (129) <primary_key_spec> ::= “primarykey? <scoped_name>

   (130) <home_body> ::= “{? <home_export>* “}?

   (131) <home_export ::= <export> | <factory_dcl> “;? | <finder_dcl> “;?

   (132) <factory_dcl> ::= “factory? <identifier> “(“ [ <init_param_decls> ] “)? [ <raises_expr> ]

   (133) <finder_dcl> ::= “finder? <identifier> “(“ [ <init_param_decls> ] “)? [ <raises_expr> ]

   (134) <event> ::= ( <event_dcl> | <event_abs_dcl> | <event_forward_dcl>)

   (135) <event_forward_dcl> ::= [ “abstract? ] “eventtype? <identifier>

   (136) <event_abs_dcl> ::= “abstract? “eventtype? <identifier> [ <value_inheritance_spec> ] “{? <export>* “}?

   (137) <event_dcl> ::= <event_header> “{? <value_element> * “}?

   (138) <event_header> ::= [ “custom? ] “eventtype? <identifier> [ <value_inheritance_spec> ]