[omniORB] Problems using IDL from Visibroker users

Sai-Lai Lo S.Lo@orl.co.uk
21 Aug 1998 16:55:15 +0100


Bert,

It is a common mistake to ignore the following IDL syntax rules:

1. (CORBA spec. section 3.2.3) Identifiers that differ only in case
   collide and yield a compilation error.
2. (CORBA spec. section 3.2.3) There is only *ONE NAMESPACE* for OMG IDL
   identifiers. Using the same identifier for a constant and an interface,
   for example, produces a compilation error.
3. (CORBA spec. section 3.13) Names and Scoping contains a detail
   description of how identifiers are brought into the current scope
   through usage.


> 2) People on comp.object.corba tell me this is a bug in omniorb:

> module M {
 
>     interface I
>     {
>         readonly attribute double x;
>         void foo( out double x );
>     };
 
> };

> omniidl2: "tst.idl", line 6: illegal redefinition ::M::I::dowithx::x, ::M::I,
> ::M::I::x

This indeed is a bug in omniidl2 because the 'x' in the operation foo
is defined within the scope of the operation and does not clash with the
attribute 'x'.

However,

> 3) I guess this is wrong, too:

> module M {

>     typedef double X;
 
>     interface I
>     {
>         void foo( out X x );
>     };
 
> };

> omniidl2: "tst.idl", line 7: identifier used with two differing spellings: "x"
> and "X"
> omniidl2: "tst.idl", line 7: redefinition after use, ::M::I::foo::x,
> ::M::I::foo, ::M::X


This is an error in the idl because X clashes with x.


> 1) TypeCode and InterfaceDef are not defined:

> module M {
 
>     interface I
>     {
>         attribute TypeCode t;
>         attribute InterfaceDef i;
>     };
 
> };

> omniidl2: "tst.idl", line 5: error in lookup of symbol: TypeCode
> omniidl2: "tst.idl", line 6: error in lookup of symbol: InterfaceDef

TypeCode and InterfaceDef are types defined in module CORBA. So the IDL
should really be:

module M {
 
     interface I
     {
         attribute CORBA::TypeCode t;
         attribute CORBA::InterfaceDef i;
     };
 
 };

However, since omniORB2 does not (yet) support IR, you'll find the above
does not compile because omniidl2 does not recognise CORBA::InterfaceDef.


Regards,

Sai-Lai


-- 
Dr. Sai-Lai Lo                          |       Research Scientist
                                        |
E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
                                        |       24a Trumpington Street
Tel:            +44 223 343000          |       Cambridge CB2 1QA
Fax:            +44 223 313542          |       ENGLAND