mirror of
https://github.com/AdaCore/PolyORB.git
synced 2026-02-12 13:01:15 -08:00
And keep it compatible with python 2 TN: TC17-010 Change-Id: I8c949bb8a916508e01c59dee340dbf4fc9de6c12
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.* instantiations.
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.