Previous | Table of Contents | Next |
OMG IDL provides constructs for naming data types; that is, it provides C language-like declarations that associate an identifier
with a type. OMG IDL uses the typedef keyword to associate a name with a data type; a name is also associated with a data
type via the struct, union, enum, and native declarations; the syntax is:
(42) <type_dcl> ::= “typedef? <type_declarator> | <struct_type> | <union_type> | <enum_type> | “native? <simple_declarator> | <constr_forward_decl>
(43) <type_declarator> ::= <type_spec> <declarators>
For type declarations, OMG IDL defines a set of type specifiers to represent typed values. The syntax is as follows:
(44) <type_spec> ::= <simple_type_spec> | <constr_type_spec>
(45) <simple_type_spec> ::= <base_type_spec> | <template_type_spec> | <scoped_name>
(47) <template_type_spec> ::= <sequence_type>| <string_type>| <wide_string_type>| <fixed_pt_type>
(48) <constr_type_spec> ::= <struct_type>| <union_type>| <enum_type>
(49) <declarators> ::= <declarator> { “,? <declarator> }∗
(50) <declarator> ::= <simple_declarator> | <complex_declarator>
(51) <simple_declarator> ::= <identifier>
(52) <complex_declarator> ::= <array_declarator>
(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>
The <scoped_name> in <simple_type_spec> must be a previously defined type introduced by an interface declaration (<interface_dcl>
- see Section 3.8, “Interface
Declaration
), a value declaration (<value_dcl>, <value_box_dcl> or <abstract_value_dcl>
- see Section 3.9, “Value Declaration) or a type declaration
(<type_dcl>
- see Section 3.11, “Type Declaration). Note that exceptions are not
considered types in this context.
As seen above, OMG IDL type specifiers consist of scalar data types and type constructors. OMG IDL type specifiers can be
used in operation declarations to assign data types to operation parameters. The next sections describe basic and constructed
type specifiers.