Unoidl syntax description |
Contents |
||||||||||||||||||||||||||||||||||||||||||||||||||
Introduction Keywords Basetypes Comments Constants Enumeration Structure Typedef Exception Interface Module Service |
||||||||||||||||||||||||||||||||||||||||||||||||||
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 provide 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.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Basetypes |
||||||||||||||||||||||||||||||||||||||||||||||||||
The unoidl support 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. |
||||||||||||||||||||||||||||||||||||||||||||||||||
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:
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
A constant definition begin with the keyword const following by the identifier of a type (base_type), the identifier of the constant and the assignment of a value. The value must be in the range of the used type. The definition ends with a semicolon. It is also possible to assign an expression. You can combine values/expressions of the type [unsigned] hyper| long | short with the operators *, /, %, +, -, <<, >>, &, ^ and | which are known of C++. |
||||||||||||||||||||||||||||||||||||||||||||||||||
Enumeration |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
An enumeration definition begin with the keyword enum following by the identifier of the enumeration type. The body of the definition is bound with { } and the complete definition ends with a semicolon. The body exists of an ordered list of identifiers. It is possible to assign such an identifier a value of the type long. The default numbering of the values is linear and begin with 0 and crows with 1. If an identifier has an value, all following identifiers without a value are numbered depending on these last assignment of a value. All enum values of the body are also known in the scope of enumeration type itself. |
||||||||||||||||||||||||||||||||||||||||||||||||||
Structure |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
The definition of a structure begins with the keyword struct following by the identifier of the structure. The body of the definition is bound with { } and the complete definition ends with a semicolon. Inside the body it is possible to define some elements. An element definition begins with the identifier of the type following by the identifier of the element name. The definition end with a semicolon. The body of the structure is a new namespace. Inside this namespace it is possible to use all identifiers as names which are definite. It is possible to define an inheritance for the structure. An inheritance will be defined after the name identifier by a colon following an identifier of the parent structure. Inheritance of structures is UNO specific and not CORBA compatible. |
||||||||||||||||||||||||||||||||||||||||||||||||||
Typedef |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
A type definition begins with the keyword typedef following by an identifier of an existing type and the identifier of the new type. The definitions ends with a semicolon |
||||||||||||||||||||||||||||||||||||||||||||||||||
Exception |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
The definition of an exception begins with the keyword exception following by the identifier of the exception. The body of the definition is bound with { } and the complete definition ends with a semicolon. Inside the body it is possible to define some members. A member definition begins with the identifier of the type following by the identifier of the member name. The definition end with a semicolon. The body of the structure is a new namespace. Inside this namespace it is possible to use all identifiers as names which are definite. It is possible to define an inheritance for the exception. An inheritance will be defined after the name identifier by a colon following an identifier of the parent exception. Inheritance of exceptions is UNO specific and not CORBA compatible. |
||||||||||||||||||||||||||||||||||||||||||||||||||
Interface |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
An interface definition begins with an header which is bound with
[ ]. The header consists of an uik (universal interface key)
definition and an ident definition. The definition begins with the
keyword uik following
by a 32 byte number which is split in 5 blocks (8-4-4-8-8 byte)
and bound in ( ). The ident definition begins with the keyword
ident following by the
name of the interface and a version number. After the header
follows the keyword interfaces and an identifier for the interface
name. Optionally, an inheritance definition can follow. An
inheritance definition begins with a colon and one or more
identifiers of existing interfaces. The body of the interface is
bound with { } and the definition ends with a semicolon.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Module |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
A module definition begins with the keyword module following by the identifier of the module. The body of the definition is bound with { } and the complete definition ends with a semicolon. A module opens a new namespace and there can be defined all valid idl definitions. |
||||||||||||||||||||||||||||||||||||||||||||||||||
Service |
||||||||||||||||||||||||||||||||||||||||||||||||||
Definition:
A service definition begins with the keyword service
following by an identifier for the name of the service. Services
are principally for description and are UNO specific. The body of
the definition is bound with { } and the complete definition ends
with a semicolon.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Author: Jürgen Schmidt ($Date: 2004/10/29 02:01:05 $) |
||||||||||||||||||||||||||||||||||||||||||||||||||
|