[omniORB] multiple interfaces in one file space

Duncan Grisby dgrisby@uk.research.att.com
Wed, 29 Nov 2000 10:15:24 +0000


On Tuesday 28 November, Fred Cook wrote:

> If I remember correctly the OMG standard states that in order to have
> two (or more) interfaces in one file they have to be inside a module
> declaration.  Is this correct?

No, that is not correct. The IDL grammar starts:

  <specification>  ::=  <definition>+
     <definition>  ::=  <type_dcl> ";"
                   |    <const_dcl> ";"
                   |    <except_dcl> ";"
                   |    <interface> ";"
                   |    <module> ";"
                   |    <value> ";"

So you can see that any number of declarations, of any of the listed
kinds, can be at the top-level of an IDL file. It's always good
practice to put everything inside a module, though.

omniidl actually deviates from the specification in one minor respect,
in that it uses <specification> ::= <definition>* . i.e. it permits a
totally empty IDL file, which ought to be illegal according to the
spec. I did that since it seems more sensible to me, and doesn't
really do any harm.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --