Unoidl syntax description |
Contents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Introduction |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The unoidl is an idl language (interface description language) which is similar to the corba idl. Idl is a language to describe interfaces and types independently of any programming language and hardware platform. An idl description is used by the idl compiler to generate code for these interfaces in a selected target language. The generated code provides the use of the described interfaces in the selected target language. The mapping of the idl description to the target language was defined in an appropriate language binding. All possible idl definitions will be described now. The reader who is intimate in C++ programming will see, that the syntax of the idl is similar to the C++ syntax. Because the lexical conventions of the idl and the structure of the definitions have a large degree with the ANSI standard for C++. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Keywords |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following table shows all keywords of the unoidl. All the keywords are reserved and cannot be used as an identifier.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IDL language specification |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Definition: (1) <idl_specification> := <definition>+ (2) <definition> := <type_decl> ";" | <module_decl> ";" | <constant_decl> ";" | <exception_decl> ";" | <constants_decl> ";" | <service_decl> ";" (3) <type_decl> := <interface> | <struct_decl> | <enum_decl> | <union_decl> | "typedef" <type_spec> <declarator> {"," <declarator> }* (4) <interface> := <interface_decl> | <forward_decl> (5) <forward_decl> := "interface" <identifier> (6) <interface_decl> := <interface_header> "{" <interface_body> "}" (7) <interface_header> := "interface" <identifier> [ <interface_inheritance> ] (8) <interface_inheritance> := ":" <interface_name> (9) <interface_name> := <scoped_name> (10) <scoped_name> := <identifier> | "::" <scoped_name> | <scoped_name> "::" <identifier> (11) <interface_body> := <export>+ (12) <export> := <attribute_decl> ";" | <operation_decl> ";" (13) <attribute_decl> := <attribute_head> <type_spec> <declarator> { "," <declarator> }* (14) <attribute_head> := "[" ["readonly" ","] "attribute" "]" | "[" "attribute" ["," "readonly"] "]" (15) <declarator> := <identifier> | <array_declarator> (16) <array_declarator> := <identifier> <array_size>+ (17) <array_size> := "[" <positive_int> "]" (18) <positive_int> := <const_expr> (19) <type_spec> := <simple_type_spec> | constr_type_spec> (20) <simple_type_spec> := <base_type_spec> | <template_type_spec> | <scoped_name> (21) <base_type_spec> := <integer_type> | <floating_point_type> | <char_type> | <byte_type> | <boolean_type> | <string_type> | <any_type> | <type_type> (22) <template_type> := <sequence_type> | <array_type> (23) <sequence_type> := "sequence" "<" <type_spec> ">" (24) <array_type> := <type_spec> <array_size>+ (25) <floating_point_type> := "float" | "double" (26) <integer_type> := <signed_int> | <unsinged_int> (27) <signed_int> := "short" | "long" | "hyper" (28) <unsigned_int> := "unsigned" "short" | "unsigned" "long" | "unsigned" "hyper" (29) <char_type> := "char" (30) <type_type> := "type" (31) <string_type> := "string" (32) <byte_type> := "byte" (33) <any_type" := "any" (34) <boolean_type> := "boolean" (35) <constr_type_spec> := <struct_type> | <enum_type> | <union_type> (36) <struct_type> := "struct" <identifier> [ <struct_inheritance> ] "{" <member>+ "}" (37) <struct_inheritance> := ":" <scoped_name> (38) <member> := <type_spec> <declarator> { "," <declarator> }* (39) enum_type> := enum <identifier> "{" <enumerator> { "," <enumerator> }* "}" (40) <enumerator> := <identifier> [ "=" <positive_int> ] (41) <union_type> := "union" <identifier> "switch" "(" <switch_type_spec> ")" "{" <switch_body> "}" (42) <switch_type_spec> := <integer_type> | <enum_type> | <scoped_name> (43) <switch_body> := <case>+ (44) <case> := <case_label> <element_spec> ";" (45) <case_label> := "case" <const_expr> ":" | "default" ":"; (46) <element_spec> := <type_spec> <declarator> (47) <exception_decl> := "exception" <identifier> [ <exception_inheritance> ] "{" <member>* "}" (48) <exception_inheritance> := ":" <scoped_name> (49) <module_decl> := "module" <identifier> "{" <definition>+ "}" (50) <constant_decl> := "const" <const_type> <identifier> "=" <const_expr> (51) <const_type> := <integer_type> | <char_type> | <boolean_type> | <floating_point_type> | <string_type> | <scoped_name> (52) <const_expr> := <or_expr> (53) <or_expr> := <xor_expr> | <or_expr> "|" <xor_expr> (54) <xor_expr> := <and_expr> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Basetypes |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The unoidl supports the following basetypes:
The values TRUE and FALSE (True and False) are defined for the boolean type. The type byte is a 1 byte type and represents a type which is not modified by the transport to another computer. The representation of the type char can be different on a computer which hardware/software architecture is different. It depends on the representation of the used charset. The type any is a type which can represent all possible idl types. The type type is a metatype which describes other types defined in IDL. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comments |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comments are used to describe the source code. If the comment support a special convention, it can be used for automatically generation of documentation. The unoidl support 4 kinds of comments:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array (not final, arrays can not be used in UNO at this time) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Arrays are not final specified in the UNO IDL and can not be used with UNO at this time!!! |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Union (not final, unions can not be used in UNO at this time) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Unions are not final specified in the UNO IDL and can not be used with UNO at this time!!! |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Author: Jürgen
Schmidt ($Date: 2004/10/29 06:35:09 $) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|