Files
PolyORB/compilers/idlac
Thomas Quinot 706789fc26 In CORBA specification terminology, a regular (non-local)
interface is 'unconstrained'.

[Imported from Perforce change 9176 at 2006-12-01 21:16:23]

Subversion-branch: /trunk/polyorb
Subversion-revision: 36694
2005-03-04 12:12:21 +00:00
..
2005-01-12 11:37:04 +00:00
2005-01-10 10:06:17 +00:00
2003-04-24 13:31:42 +00:00
2005-01-10 10:06:17 +00:00
2005-01-14 18:01:08 +00:00
2005-01-10 10:06:17 +00:00
2005-01-10 10:06:17 +00:00

The following expansion occurs on the IDL tree
----------------------------------------------

- <fixed_type_specs>
  a simple typedef:

  typedef fixed<8,2> Megabucks[3];
->
  {fixed(8,2,Fixed_8_2)}
{fixed(DIGITS,SCALE,NAME)} is a new node kind for fixed type declarations.
It is mapped to "type NAME is delta 10 ** -SCALE digits DIGITS;"

  typedef fixed<8,2>{Fixed_8_2} Megabucks[3];
  // The N_Fixed_Type node has a new attribute which is
  // a pointer to the expanded {fixed} node.

  typedef sequence<sequence<foo>> SeqSeqFoo;
->
  N1:{seq(Name=IDL_SEQUENCE_foo,Bound=0,Element_Type=foo)}
  N2:{seq(Name=IDL_SEQUENCE_SEQUENCE_foo,Bound=0,Element_Type=N1)}
  typedef N2 SeqSeqFoo;

{seq} is a new node kind for generic CORBA.Sequences.* instanciations.
It is a named node, and holds a reference to the original sequence
node as its Original_Node field.
The {seq} node replaces the original sequence node wherever
it is used, *and* is inserted in the scope where it is used,
before the declaration that uses it.

- For complex_declarators in struct members

- <constr_type_specs> -> <type_dcl>

eg
  typedef enum Color {Red, Green, Blue} RGB
->
  enum Color {Red, Green, Blue};
  typedef enum Color RGB;

- In a union, the default label shall be the only
  element in its label_list:
  own case:

  union U switch (long) {
    case 1: long foo;
    case 2: long bar;
    case 3: default: long baz;
  }
->
  union U switch(long) {
    case 1: long foo;
    case 2: long bar;
    default: long baz; // Covers the 3 case as well anyway.
  }

- A usage occurence of an interface name within its parent scope
  must resolve to denote a forward declaration of this interface:

  module M {
    interface I { ... };
    typedef I J;
  }
->
  module M {
    interface I;
    interface I { ... };
    typedef I J;
  }
(where the N_Scoped_Name "I" in the typedef shall have a Value
that designates the newly-inserted N_Forward_Interface node.).

- Exception members:

  exception E { members... };
->
  struct E_Members {
    members...
  };
  exception E{members_type: ...} { members... };

(where Members_Type is a new Node_Id attribute of node K_Exception
that designates the expanded struct <exception>_Members).

- Repository IDs for all interfaces:
  interface I { exports ... };
-> 
  interface I{RepositoryID="IDL:/.../I:1.0"} { exports ... };
(where {RepositoryID} is a new attribute of N_Interface).

- Bounded string types -> typedefs.