2 //=============================================================================
4 * @file reopened_modules.idl
6 * This file contains examples of IDL code that has
7 * caused problems in the past for the TAO IDL
8 * compiler. This test is to make sure the problems
12 * @author Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
14 //=============================================================================
17 // These examples test the lookup abilities of the
18 // TAO IDL compiler, with reopened modules.
20 // Tests lookup function when modules are reopened by
21 // a chain of inclusions.
22 #include
"reopen_include2.idl"
40 // 'AA::BB::' should be implicit
42 // 'AA::' should be implicit
43 void op2
(in BB
::x1 obj
);
45 void op3
(in AA
::BB
::x1 obj
);
51 // Each occurrence of Party and Person should be
52 // recognized as being in the same scope as the
53 // previous occurrence(s).
61 attribute Party someParty
;
69 attribute Person somePerson
;
73 // Should be no problem in lookup of all the
74 // arguments in Operation.
93 void Operation
(in ::Outside
::Tricky p1
,
94 out ::Outside
::Reopened
::Tricky p2
,
95 inout
::Outside
::Reopened
::Newdef p3
);
98 // This particular combination used to cause IDL compiler
99 // to go into an infinite loop looking for return type to
100 // getInfo(). Partial solution got rid of infinite loop,
101 // but erroneously returned ::com from lookup.
115 com
::mr
::info getInfo
();
119 // Modules X and Y are also included from reopene_include2.idl.
120 // There were problems with the lookup of Y::Z and X::Ex.
133 void method
() raises
(X
::Ex
);
137 // Reopened from reopen_include2.idl inclusion. There
138 // was a problem with the inheritance lookup.
142 interface blah_intfc
;
149 interface blah0
: blah_intfc
155 // Had lookup problems with the operation args and
160 interface frag_iface
{};
165 typedef long ret_long
;
170 frag
::ret_long op
(in frag
::dub_seq inarg
,
171 inout frag
::pug inoutarg
,
172 out frag
::frag_iface outarg
);
175 // Had problems with second opening of module using
176 // types declared between the openings.
180 typedef long longdef
;
183 typedef long longdef2
;
185 struct bar
{short s
;};
197 void op
(in bar inarg
);
205 typedef sequence
<X2
> X2Seq
;
207 interface X3
: X1
, X2
215 // Interface B was not getting redefined, so
216 // definition of C would cause an error.
227 attribute
::mB
::B theB
;
233 interface B
: ::mA
::A
235 attribute
::mA
::A theA
;
241 interface C
: ::mB
::B
246 // The example below uncovered errors in the logic of
247 // AST_Module::fe_add_interface_fwd() and
248 // AST_Module::add_to_previous() that were causing
249 // AST_Module::look_in_previous() (and thus lookup_by_name)
250 // to fail on the last line.
255 typedef string foo_type
;
268 foo
::foo_type member
;
272 // Tests forward declared interface as element type.
273 // Had to override visit_interface_fwd()
274 // for the be_visitor_sequence_base_template_args
275 // visitor to fix this. Also had to separate calls
276 // to nested_type_name() into individual insertions
277 // into the code generating stream, because of side
286 typedef sequence
<TestType
> ub_TestTypeSeq
;
287 typedef sequence
<TestType
, 3> bd_TestTypeSeq
;
292 interface TestType
{};
295 // We had a problem with the inheritance list
296 // in the declaration of A_mod::B_mod::Foo, in
297 // both stub and skeleton files.
304 interface Foo
: A_mod
::Foo
{};
308 /// Similar to example at the top of this file,
309 /// but with more openings and deeper nesting.
318 const unsigned short FRED
= 123;
332 const unsigned short JIM
= 240;
344 typedef string < ::m1
::m2
::m3a
::m4b
::JIM
> StringJIM
;
345 typedef string <m1
::m2
::m3a
::m4b
::JIM
> StringJIM_0
;
346 typedef string <m2
::m3a
::m4b
::JIM
> StringJIM_1
;
347 typedef string <m3a
::m4b
::JIM
> StringJIM_2
;