2 * @file be_visitor_ccm_pre_proc.cpp
6 //=============================================================================
8 #include "be_visitor_ccm_pre_proc.h"
9 #include "be_visitor_context.h"
10 #include "be_visitor_xplicit_pre_proc.h"
12 #include "be_operation.h"
13 #include "be_argument.h"
14 #include "be_exception.h"
15 #include "be_structure.h"
16 #include "be_sequence.h"
17 #include "be_valuetype.h"
18 #include "be_module.h"
19 #include "be_template_module.h"
20 #include "be_template_module_inst.h"
22 #include "be_typedef.h"
23 #include "be_connector.h"
24 #include "be_provides.h"
26 #include "be_publishes.h"
28 #include "be_consumes.h"
29 #include "be_extended_port.h"
30 #include "be_porttype.h"
31 #include "be_eventtype.h"
32 #include "be_eventtype_fwd.h"
34 #include "be_finder.h"
35 #include "be_extern.h"
37 #include "ast_generator.h"
39 #include "utl_exceptlist.h"
40 #include "utl_namelist.h"
43 #include "fe_interface_header.h"
44 #include "global_extern.h"
45 #include "nr_extern.h"
47 const char *LW_EXCEP_NAMES
[] =
52 "ExceededConnectionLimit",
58 const char *ADDL_EXCEP_NAMES
[] =
65 const int N_LW_EXCEPS
=
66 sizeof (LW_EXCEP_NAMES
) / sizeof (char *);
67 const int N_ADDL_EXCEPS
=
68 sizeof (ADDL_EXCEP_NAMES
) / sizeof (char *);
70 be_exception
*LW_EXCEPS
[N_LW_EXCEPS
];
71 be_exception
*ADDL_EXCEPS
[N_ADDL_EXCEPS
];
73 be_visitor_ccm_pre_proc::be_visitor_ccm_pre_proc (
74 be_visitor_context
*ctx
)
75 : be_visitor_component_scope (ctx
),
76 module_id_ ("Components"),
78 already_connected_ (0),
79 invalid_connection_ (0),
81 exceeded_connection_limit_ (0),
86 unknown_key_value_ (0),
87 duplicate_key_value_ (0),
90 ccm_lookups_done_ (false)
94 be_visitor_ccm_pre_proc::~be_visitor_ccm_pre_proc ()
96 this->module_id_
.destroy ();
100 be_visitor_ccm_pre_proc::visit_root (be_root
*node
)
102 /// Do this before traversing the tree so the traversal
103 /// will pick up the implied uses nodes we add, if any.
104 /// No need to check for the -GM option here - what's
105 /// generated by this call depends only on the contents
106 /// of the ciao_ami_recep_names_ queue.
107 int const status
= this->generate_ami4ccm_uses ();
111 ACE_ERROR_RETURN ((LM_ERROR
,
112 ACE_TEXT ("be_visitor_ccm_pre_proc::")
113 ACE_TEXT ("visit_root - ")
114 ACE_TEXT ("generate_ami4ccm_uses() ")
115 ACE_TEXT ("failed\n")),
119 if (this->visit_scope (node
) == -1)
121 ACE_ERROR_RETURN ((LM_ERROR
,
122 ACE_TEXT ("be_visitor_ccm_pre_proc::")
123 ACE_TEXT ("visit_root - ")
124 ACE_TEXT ("visit scope failed\n")),
132 be_visitor_ccm_pre_proc::visit_module (be_module
*node
)
134 if (this->visit_scope (node
) == -1)
136 ACE_ERROR_RETURN ((LM_ERROR
,
137 ACE_TEXT ("be_visitor_ccm_pre_proc::")
138 ACE_TEXT ("visit_module - ")
139 ACE_TEXT ("visit scope failed\n")),
147 be_visitor_ccm_pre_proc::visit_component (be_component
*node
)
149 /// Waiting to do this until a component is seen will ensure
150 /// that Components.idl is present and the lookups will
151 /// succeed. The flag ensures that the lookup is done only
153 if (!this->ccm_lookups_done_
)
155 if (this->lookup_cookie () == -1)
157 ACE_ERROR_RETURN ((LM_ERROR
,
158 ACE_TEXT ("be_visitor_ccm_pre_proc::")
159 ACE_TEXT ("visit_root - ")
160 ACE_TEXT ("Components::Cookie ")
161 ACE_TEXT ("lookup failed\n")),
165 if (this->lookup_exceptions () == -1)
167 ACE_ERROR_RETURN ((LM_ERROR
,
168 ACE_TEXT ("be_visitor_ccm_pre_proc::")
169 ACE_TEXT ("visit_root - ")
170 ACE_TEXT ("component exception ")
171 ACE_TEXT ("lookups failed\n")),
175 this->ccm_lookups_done_
= true;
178 // Set working node for all port code generation.
181 if (this->visit_scope (node
) == -1)
183 ACE_ERROR_RETURN ((LM_ERROR
,
184 ACE_TEXT ("be_visitor_ccm_pre_proc::")
185 ACE_TEXT ("visit_component - ")
186 ACE_TEXT ("code generation for ")
187 ACE_TEXT ("scope3 failed\n")),
195 be_visitor_ccm_pre_proc::visit_connector (be_connector
*node
)
197 return this->visit_component (node
);
201 be_visitor_ccm_pre_proc::visit_provides (be_provides
*node
)
203 if (node
->provides_type ()->is_local ())
208 if (!be_global
->gen_lwccm ())
210 // If this facet comes from a porttype, the instantiated
211 // port/mirrorport name is prefixed to the facet name.
212 ACE_CString
prefix ("provide_");
213 prefix
+= this->ctx_
->port_prefix ();
215 AST_Operation
*provides_op
= 0;
216 UTL_ScopedName
*op_name
=
217 this->create_scoped_name (prefix
.c_str (),
218 node
->local_name ()->get_string (),
221 ACE_NEW_RETURN (provides_op
,
222 be_operation (node
->provides_type (),
223 AST_Operation::OP_noflags
,
229 provides_op
->set_defined_in (comp_
);
230 provides_op
->set_imported (comp_
->imported ());
231 provides_op
->set_name (op_name
);
233 if (0 == comp_
->be_add_operation (provides_op
))
235 ACE_ERROR_RETURN ((LM_ERROR
,
236 ACE_TEXT ("be_visitor_ccm_pre_proc::")
237 ACE_TEXT ("visit_provides - ")
238 ACE_TEXT ("be_add_operation() failed\n")),
247 be_visitor_ccm_pre_proc::visit_uses (be_uses
*node
)
249 if (node
->uses_type ()->is_local ())
254 if (!be_global
->gen_lwccm ())
256 if (node
->is_multiple ())
258 if (this->gen_connect_multiple (node
) == -1)
260 ACE_ERROR_RETURN ((LM_ERROR
,
261 ACE_TEXT ("be_visitor_ccm_pre_proc::")
262 ACE_TEXT ("visit_uses - ")
263 ACE_TEXT ("gen_connect_multiple failed\n")),
267 if (this->gen_disconnect_multiple (node
) == -1)
269 ACE_ERROR_RETURN ((LM_ERROR
,
270 ACE_TEXT ("be_visitor_ccm_pre_proc::")
271 ACE_TEXT ("visit_uses - ")
272 ACE_TEXT ("gen_disconnect_multiple failed\n")),
276 if (this->gen_get_connection_multiple (node
) == -1)
278 ACE_ERROR_RETURN ((LM_ERROR
,
279 ACE_TEXT ("be_visitor_ccm_pre_proc::")
280 ACE_TEXT ("visit_uses - ")
281 ACE_TEXT ("gen_get_connection_single failed\n")),
287 if (this->gen_connect_single (node
) == -1)
289 ACE_ERROR_RETURN ((LM_ERROR
,
290 ACE_TEXT ("be_visitor_ccm_pre_proc::")
291 ACE_TEXT ("visit_uses - ")
292 ACE_TEXT ("gen_connect_single failed\n")),
296 if (this->gen_disconnect_single (node
) == -1)
298 ACE_ERROR_RETURN ((LM_ERROR
,
299 ACE_TEXT ("be_visitor_ccm_pre_proc::")
300 ACE_TEXT ("visit_uses - ")
301 ACE_TEXT ("gen_disconnect_single failed\n")),
305 if (this->gen_get_connection_single (node
) == -1)
307 ACE_ERROR_RETURN ((LM_ERROR
,
308 ACE_TEXT ("be_visitor_ccm_pre_proc::")
309 ACE_TEXT ("visit_uses - ")
310 ACE_TEXT ("gen_get_connection_single failed\n")),
320 be_visitor_ccm_pre_proc::visit_publishes (be_publishes
*node
)
322 if (!be_global
->gen_noeventccm ())
324 if (this->gen_subscribe (node
) == -1)
326 ACE_ERROR_RETURN ((LM_ERROR
,
327 ACE_TEXT ("be_visitor_ccm_pre_proc::")
328 ACE_TEXT ("visit_publishes - ")
329 ACE_TEXT ("gen_subscribe failed\n")),
333 if (this->gen_unsubscribe (node
) == -1)
335 ACE_ERROR_RETURN ((LM_ERROR
,
336 ACE_TEXT ("be_visitor_ccm_pre_proc::")
337 ACE_TEXT ("visit_publishes - ")
338 ACE_TEXT ("gen_unsubscribe failed\n")),
346 be_visitor_ccm_pre_proc::visit_emits (be_emits
*node
)
348 if (!be_global
->gen_noeventccm ())
350 if (this->gen_emits_connect (node
) == -1)
352 ACE_ERROR_RETURN ((LM_ERROR
,
353 ACE_TEXT ("be_visitor_ccm_pre_proc::")
354 ACE_TEXT ("visit_emits - ")
355 ACE_TEXT ("gen_emits_connect failed\n")),
359 if (this->gen_emits_disconnect (node
) == -1)
361 ACE_ERROR_RETURN ((LM_ERROR
,
362 ACE_TEXT ("be_visitor_ccm_pre_proc::")
363 ACE_TEXT ("visit_emits - ")
364 ACE_TEXT ("gen_emits_disconnect failed\n")),
372 be_visitor_ccm_pre_proc::visit_consumes (be_consumes
*node
)
374 if (!be_global
->gen_noeventccm ())
376 if (this->gen_get_consumer (node
) == -1)
378 ACE_ERROR_RETURN ((LM_ERROR
,
379 ACE_TEXT ("be_visitor_ccm_pre_proc::")
380 ACE_TEXT ("visit_comsumes - ")
381 ACE_TEXT ("gen_get_consumer failed\n")),
389 be_visitor_ccm_pre_proc::visit_home (be_home
*node
)
391 AST_Interface
*xplicit
= this->create_explicit (node
);
395 ACE_ERROR_RETURN ((LM_ERROR
,
396 ACE_TEXT ("be_visitor_ccm_pre_proc::")
397 ACE_TEXT ("visit_home - code generation ")
398 ACE_TEXT ("for explicit interface failed\n")),
402 AST_Interface
*implicit
= this->create_implicit (node
);
406 ACE_ERROR_RETURN ((LM_ERROR
,
407 ACE_TEXT ("be_visitor_ccm_pre_proc::")
408 ACE_TEXT ("visit_home - code generation ")
409 ACE_TEXT ("for implicit interface failed\n")),
413 if (this->gen_implicit_ops (node
, implicit
) == -1)
415 ACE_ERROR_RETURN ((LM_ERROR
,
416 ACE_TEXT ("be_visitor_ccm_pre_proc::")
417 ACE_TEXT ("visit_home - ")
418 ACE_TEXT ("code generation for primary key ")
419 ACE_TEXT ("operations failed\n")),
423 if (this->create_equivalent (node
, xplicit
, implicit
) == 0)
425 ACE_ERROR_RETURN ((LM_ERROR
,
426 ACE_TEXT ("be_visitor_ccm_pre_proc::")
427 ACE_TEXT ("visit_home - code generation ")
428 ACE_TEXT ("for equivalent interface failed\n")),
436 be_visitor_ccm_pre_proc::visit_eventtype (be_eventtype
*node
)
438 if (!be_global
->gen_noeventccm ())
440 if (node
->ccm_pre_proc_gen ())
445 if (this->create_event_consumer (node
) == -1)
447 ACE_ERROR_RETURN ((LM_ERROR
,
448 ACE_TEXT ("be_visitor_ccm_pre_proc::")
449 ACE_TEXT ("visit_eventtype - code generation ")
450 ACE_TEXT ("for consumer failed\n")),
454 node
->ccm_pre_proc_gen (true);
460 be_visitor_ccm_pre_proc::visit_eventtype_fwd (be_eventtype_fwd
*node
)
463 dynamic_cast<be_eventtype
*> (node
->full_definition ());
465 return this->visit_eventtype (fd
);
469 be_visitor_ccm_pre_proc::gen_implicit_ops (be_home
*node
,
470 AST_Interface
*implicit
)
472 if (this->gen_create (node
, implicit
) == -1)
474 ACE_ERROR_RETURN ((LM_ERROR
,
475 ACE_TEXT ("be_visitor_ccm_pre_proc::")
476 ACE_TEXT ("gen_implicit_ops - ")
477 ACE_TEXT ("gen_create failed\n")),
481 AST_Type
*pk
= node
->primary_key ();
488 if (!be_global
->gen_lwccm ())
490 if (this->gen_find_by_primary_key (node
, implicit
) == -1)
492 ACE_ERROR_RETURN ((LM_ERROR
,
493 ACE_TEXT ("be_visitor_ccm_pre_proc::")
494 ACE_TEXT ("gen_implicit_ops - ")
495 ACE_TEXT ("gen_find_by_primary_key failed\n")),
500 if (this->gen_remove (node
, implicit
) == -1)
502 ACE_ERROR_RETURN ((LM_ERROR
,
503 ACE_TEXT ("be_visitor_ccm_pre_proc::")
504 ACE_TEXT ("gen_implicit_ops - ")
505 ACE_TEXT ("gen_remove failed\n")),
509 if (!be_global
->gen_lwccm ())
511 if (this->gen_get_primary_key (node
, implicit
) == -1)
513 ACE_ERROR_RETURN ((LM_ERROR
,
514 ACE_TEXT ("be_visitor_ccm_pre_proc::")
515 ACE_TEXT ("gen_implicit_ops - ")
516 ACE_TEXT ("gen_get_primary_key failed\n")),
524 // **************************************************************
527 be_visitor_ccm_pre_proc::gen_connect_single (be_uses
*node
)
529 // If this facet comes from a porttype, the instantiated
530 // port/mirrorport name is prefixed to the receptacle name.
531 ACE_CString
prefix ("connect_");
532 prefix
+= this->ctx_
->port_prefix ();
534 UTL_ScopedName
*op_full_name
=
535 this->create_scoped_name (prefix
.c_str (),
536 node
->local_name ()->get_string (),
539 be_operation
*op
= 0;
541 be_operation (be_global
->void_type (),
542 AST_Operation::OP_noflags
,
547 op
->set_defined_in (comp_
);
548 op
->set_imported (comp_
->imported ());
549 op
->set_name (op_full_name
);
550 Identifier
arg_id ("conxn");
551 UTL_ScopedName
arg_name (&arg_id
,
553 be_argument
*arg
= 0;
555 be_argument (AST_Argument::dir_IN
,
560 op
->be_add_argument (arg
);
562 UTL_ExceptList
*tail
= 0;
563 ACE_NEW_RETURN (tail
,
564 UTL_ExceptList (this->invalid_connection_
,
567 UTL_ExceptList
*connect_single
= 0;
568 ACE_NEW_RETURN (connect_single
,
569 UTL_ExceptList (this->already_connected_
,
572 op
->be_add_exceptions (connect_single
);
574 if (0 == comp_
->be_add_operation (op
))
583 be_visitor_ccm_pre_proc::gen_disconnect_single (be_uses
*node
)
585 // If this facet comes from a porttype, the instantiated
586 // port/mirrorport name is prefixed to the receptacle name.
587 ACE_CString
prefix ("disconnect_");
588 prefix
+= this->ctx_
->port_prefix ();
590 UTL_ScopedName
*op_full_name
=
591 this->create_scoped_name (prefix
.c_str (),
592 node
->local_name ()->get_string (),
595 be_operation
*op
= 0;
597 be_operation (node
->uses_type (),
598 AST_Operation::OP_noflags
,
603 op
->set_name (op_full_name
);
604 op
->set_defined_in (comp_
);
605 op
->set_imported (comp_
->imported ());
606 UTL_ExceptList
*disconnect_single
= 0;
607 ACE_NEW_RETURN (disconnect_single
,
608 UTL_ExceptList (this->no_connection_
,
611 op
->be_add_exceptions (disconnect_single
);
613 if (0 == comp_
->be_add_operation (op
))
622 be_visitor_ccm_pre_proc::gen_get_connection_single (be_uses
*node
)
624 // If this facet comes from a porttype, the instantiated
625 // port/mirrorport name is prefixed to the receptacle name.
626 ACE_CString
prefix ("get_connection_");
627 prefix
+= this->ctx_
->port_prefix ();
629 UTL_ScopedName
*op_full_name
=
630 this->create_scoped_name (prefix
.c_str (),
631 node
->local_name ()->get_string (),
634 be_operation
*op
= 0;
636 be_operation (node
->uses_type (),
637 AST_Operation::OP_noflags
,
642 op
->set_name (op_full_name
);
643 op
->set_defined_in (comp_
);
644 op
->set_imported (comp_
->imported ());
646 if (0 == comp_
->be_add_operation (op
))
655 be_visitor_ccm_pre_proc::gen_connect_multiple (be_uses
*node
)
657 // If this facet comes from a porttype, the instantiated
658 // port/mirrorport name is prefixed to the receptacle name.
659 ACE_CString
prefix ("connect_");
660 prefix
+= this->ctx_
->port_prefix ();
662 UTL_ScopedName
*op_full_name
=
663 this->create_scoped_name (prefix
.c_str (),
664 node
->local_name ()->get_string (),
668 be_operation
*op
= 0;
670 be_operation (this->cookie_
,
671 AST_Operation::OP_noflags
,
676 op
->set_name (op_full_name
);
677 op
->set_defined_in (comp_
);
678 op
->set_imported (comp_
->imported ());
679 Identifier
arg_id ("connection");
680 UTL_ScopedName
arg_name (&arg_id
,
682 be_argument
*arg
= 0;
684 be_argument (AST_Argument::dir_IN
,
689 op
->be_add_argument (arg
);
690 UTL_ExceptList
*tail
= 0;
691 ACE_NEW_RETURN (tail
,
692 UTL_ExceptList (this->invalid_connection_
,
695 UTL_ExceptList
*connect_multiple
= 0;
696 ACE_NEW_RETURN (connect_multiple
,
697 UTL_ExceptList (this->exceeded_connection_limit_
,
700 op
->be_add_exceptions (connect_multiple
);
702 if (0 == comp_
->be_add_operation (op
))
711 be_visitor_ccm_pre_proc::gen_disconnect_multiple (be_uses
*node
)
713 // If this facet comes from a porttype, the instantiated
714 // port/mirrorport name is prefixed to the receptacle name.
715 ACE_CString
prefix ("disconnect_");
716 prefix
+= this->ctx_
->port_prefix ();
718 UTL_ScopedName
*op_full_name
=
719 this->create_scoped_name (prefix
.c_str (),
720 node
->local_name ()->get_string (),
723 be_operation
*op
= 0;
725 be_operation (node
->uses_type (),
726 AST_Operation::OP_noflags
,
731 op
->set_name (op_full_name
);
732 op
->set_defined_in (comp_
);
733 op
->set_imported (comp_
->imported ());
734 Identifier
arg_id ("ck");
735 UTL_ScopedName
arg_name (&arg_id
,
737 be_argument
*arg
= 0;
739 be_argument (AST_Argument::dir_IN
,
744 op
->be_add_argument (arg
);
745 UTL_ExceptList
*disconnect_multiple
= 0;
746 ACE_NEW_RETURN (disconnect_multiple
,
747 UTL_ExceptList (this->invalid_connection_
,
750 op
->be_add_exceptions (disconnect_multiple
);
752 if (0 == comp_
->be_add_operation (op
))
761 be_visitor_ccm_pre_proc::gen_get_connection_multiple (be_uses
*node
)
763 // If this facet comes from a porttype, the instantiated
764 // port/mirrorport name is prefixed to the receptacle name.
765 ACE_CString
prefix ("get_connections_");
766 prefix
+= this->ctx_
->port_prefix ();
768 UTL_ScopedName
*op_full_name
=
769 this->create_scoped_name (prefix
.c_str (),
770 node
->local_name ()->get_string (),
774 // Look up the implied IDL typedef created in the front end.
775 // It will be the return type of the created operation. The
776 // sequence was originally created with the port prefix (if
777 // any) in its name, so we must use it here.
778 ACE_CString
connections_string (this->ctx_
->port_prefix ());
779 connections_string
+= node
->local_name ()->get_string ();
780 connections_string
+= "Connections";
781 Identifier
connections_id (connections_string
.c_str ());
782 UTL_ScopedName
connections_name (&connections_id
,
784 AST_Decl
*d
= comp_
->lookup_by_name (&connections_name
,
786 be_typedef
*td
= dynamic_cast<be_typedef
*> (d
);
787 connections_id
.destroy ();
789 be_operation
*op
= 0;
792 AST_Operation::OP_noflags
,
797 op
->set_name (op_full_name
);
798 op
->set_defined_in (comp_
);
799 op
->set_imported (comp_
->imported ());
801 if (0 == comp_
->be_add_operation (op
))
810 be_visitor_ccm_pre_proc::gen_push_op (be_eventtype
*node
,
811 AST_Interface
*consumer
)
813 if (!be_global
->gen_noeventccm ())
815 UTL_ScopedName
*op_full_name
=
816 this->create_scoped_name ("push_",
820 be_operation
*push_op
= 0;
821 ACE_NEW_RETURN (push_op
,
822 be_operation (be_global
->void_type (),
823 AST_Operation::OP_noflags
,
828 push_op
->set_defined_in (consumer
);
829 push_op
->set_imported (node
->imported ());
830 push_op
->set_name (op_full_name
);
831 ACE_CString
arg_string ("the_",
834 arg_string
+= node
->local_name ();
835 Identifier
arg_id (arg_string
.fast_rep ());
836 UTL_ScopedName
arg_name (&arg_id
,
838 be_argument
*arg
= 0;
840 be_argument (AST_Argument::dir_IN
,
845 push_op
->be_add_argument (arg
);
847 if (0 == consumer
->be_add_operation (push_op
))
856 be_visitor_ccm_pre_proc::gen_subscribe (be_publishes
*node
)
858 if ((be_global
->gen_lwccm ()) ||(be_global
->gen_noeventccm ()))
863 UTL_ScopedName
*op_name
=
864 this->create_scoped_name ("subscribe_",
865 node
->local_name ()->get_string (),
868 be_operation
*op
= 0;
870 be_operation (this->cookie_
,
871 AST_Operation::OP_noflags
,
876 op
->set_defined_in (comp_
);
877 op
->set_imported (comp_
->imported ());
878 op
->set_name (op_name
);
880 AST_Interface
*i
= this->lookup_consumer (node
);
888 ACE_ERROR_RETURN ((LM_ERROR
,
889 ACE_TEXT ("be_visitor_ccm_pre_proc::")
890 ACE_TEXT ("gen_subscribe - ")
891 ACE_TEXT ("consumer lookup failed\n")),
895 Identifier
arg_id ("consumer");
896 UTL_ScopedName
arg_name (&arg_id
,
898 be_argument
*arg
= 0;
900 be_argument (AST_Argument::dir_IN
,
904 op
->be_add_argument (arg
);
905 UTL_ExceptList
*subscribe
= 0;
906 ACE_NEW_RETURN (subscribe
,
907 UTL_ExceptList (this->exceeded_connection_limit_
,
910 op
->be_add_exceptions (subscribe
);
912 if (0 == comp_
->be_add_operation (op
))
921 be_visitor_ccm_pre_proc::gen_unsubscribe (be_publishes
*node
)
923 if (be_global
->gen_lwccm () ||be_global
->gen_noeventccm ())
928 AST_Interface
*i
= this->lookup_consumer (node
);
932 ACE_ERROR_RETURN ((LM_ERROR
,
933 ACE_TEXT ("be_visitor_ccm_pre_proc::")
934 ACE_TEXT ("gen_unsubscribe - ")
935 ACE_TEXT ("consumer lookup failed\n")),
939 UTL_ScopedName
*op_name
=
940 this->create_scoped_name ("unsubscribe_",
941 node
->local_name ()->get_string (),
944 be_operation
*op
= 0;
947 AST_Operation::OP_noflags
,
952 op
->set_defined_in (comp_
);
953 op
->set_imported (comp_
->imported ());
954 op
->set_name (op_name
);
955 Identifier
arg_id ("ck");
956 UTL_ScopedName
arg_name (&arg_id
,
958 be_argument
*arg
= 0;
960 be_argument (AST_Argument::dir_IN
,
964 op
->be_add_argument (arg
);
965 UTL_ExceptList
*unsubscribe
= 0;
966 ACE_NEW_RETURN (unsubscribe
,
967 UTL_ExceptList (this->invalid_connection_
,
970 op
->be_add_exceptions (unsubscribe
);
972 if (0 == comp_
->be_add_operation (op
))
981 be_visitor_ccm_pre_proc::gen_emits_connect (be_emits
*node
)
983 if ((be_global
->gen_lwccm ()) ||(be_global
->gen_noeventccm ()))
988 UTL_ScopedName
*op_name
=
989 this->create_scoped_name ("connect_",
990 node
->local_name ()->get_string (),
993 be_operation
*op
= 0;
995 be_operation (be_global
->void_type (),
996 AST_Operation::OP_noflags
,
1001 op
->set_name (op_name
);
1002 op
->set_defined_in (comp_
);
1003 op
->set_imported (comp_
->imported ());
1004 AST_Interface
*i
= this->lookup_consumer (node
);
1012 ACE_ERROR_RETURN ((LM_ERROR
,
1013 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1014 ACE_TEXT ("gen_emits_connect - ")
1015 ACE_TEXT ("consumer lookup failed\n")),
1019 Identifier
arg_id ("consumer");
1020 UTL_ScopedName
arg_name (&arg_id
,
1022 be_argument
*arg
= 0;
1023 ACE_NEW_RETURN (arg
,
1024 be_argument (AST_Argument::dir_IN
,
1028 op
->be_add_argument (arg
);
1029 UTL_ExceptList
*emits_connect
= 0;
1030 ACE_NEW_RETURN (emits_connect
,
1031 UTL_ExceptList (this->already_connected_
,
1034 op
->be_add_exceptions (emits_connect
);
1036 if (0 == comp_
->be_add_operation (op
))
1045 be_visitor_ccm_pre_proc::gen_emits_disconnect (be_emits
*node
)
1047 if ((be_global
->gen_lwccm ()) ||(be_global
->gen_noeventccm ()))
1052 AST_Interface
*i
= this->lookup_consumer (node
);
1056 ACE_ERROR_RETURN ((LM_ERROR
,
1057 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1058 ACE_TEXT ("gen_emits_disconnect - ")
1059 ACE_TEXT ("consumer lookup failed\n")),
1063 UTL_ScopedName
*op_name
=
1064 this->create_scoped_name ("disconnect_",
1065 node
->local_name ()->get_string (),
1068 be_operation
*op
= 0;
1071 AST_Operation::OP_noflags
,
1076 op
->set_name (op_name
);
1077 op
->set_defined_in (comp_
);
1078 op
->set_imported (comp_
->imported ());
1079 UTL_ExceptList
*emits_disconnect
= 0;
1080 ACE_NEW_RETURN (emits_disconnect
,
1081 UTL_ExceptList (this->no_connection_
,
1084 op
->be_add_exceptions (emits_disconnect
);
1086 if (0 == comp_
->be_add_operation (op
))
1095 be_visitor_ccm_pre_proc::gen_get_consumer (be_consumes
*node
)
1097 if (be_global
->gen_lwccm () || be_global
->gen_noeventccm ())
1102 AST_Interface
*i
= this->lookup_consumer (node
);
1106 ACE_ERROR_RETURN ((LM_ERROR
,
1107 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1108 ACE_TEXT ("gen_get_consumer - ")
1109 ACE_TEXT ("consumer lookup failed\n")),
1113 UTL_ScopedName
*op_name
=
1114 this->create_scoped_name ("get_consumer_",
1115 node
->local_name ()->get_string (),
1118 be_operation
*op
= 0;
1121 AST_Operation::OP_noflags
,
1126 op
->set_name (op_name
);
1127 op
->set_defined_in (comp_
);
1128 op
->set_imported (comp_
->imported ());
1130 if (0 == comp_
->be_add_operation (op
))
1139 be_visitor_ccm_pre_proc::gen_create (be_home
*node
,
1140 AST_Interface
*implicit
)
1142 UTL_ScopedName
*op_name
= this->create_scoped_name (0,
1146 be_operation
*op
= 0;
1148 be_operation (node
->managed_component (),
1149 AST_Operation::OP_noflags
,
1154 op
->set_name (op_name
);
1155 AST_Type
*pk
= node
->primary_key ();
1156 UTL_ExceptList
*exceps
= 0;
1157 ACE_NEW_RETURN (exceps
,
1158 UTL_ExceptList (this->create_failure_
,
1162 if (pk
!= 0 && !be_global
->gen_lwccm ())
1164 Identifier
arg_id ("key");
1165 UTL_ScopedName
arg_name (&arg_id
,
1167 AST_Argument
*arg
= 0;
1168 ACE_NEW_RETURN (arg
,
1169 be_argument (AST_Argument::dir_IN
,
1174 op
->be_add_argument (arg
);
1176 UTL_ExceptList
*tail
= 0;
1177 ACE_NEW_RETURN (tail
,
1178 UTL_ExceptList (this->invalid_key_
,
1181 UTL_ExceptList
*middle
= 0;
1182 ACE_NEW_RETURN (middle
,
1183 UTL_ExceptList (this->duplicate_key_value_
,
1186 exceps
->nconc (middle
);
1189 op
->be_add_exceptions (exceps
);
1190 op
->set_defined_in (implicit
);
1191 op
->set_imported (node
->imported ());
1193 if (0 == implicit
->be_add_operation (op
))
1202 be_visitor_ccm_pre_proc::gen_find_by_primary_key (be_home
*node
,
1203 AST_Interface
*implicit
)
1205 UTL_ScopedName
*op_name
= this->create_scoped_name (0,
1206 "find_by_primary_key",
1209 be_operation
*op
= 0;
1211 be_operation (node
->managed_component (),
1212 AST_Operation::OP_noflags
,
1217 op
->set_name (op_name
);
1218 AST_Type
*pk
= node
->primary_key ();
1219 Identifier
arg_id ("key");
1220 UTL_ScopedName
arg_name (&arg_id
,
1222 AST_Argument
*arg
= 0;
1223 ACE_NEW_RETURN (arg
,
1224 be_argument (AST_Argument::dir_IN
,
1229 op
->be_add_argument (arg
);
1231 UTL_ExceptList
*tail
= 0;
1232 UTL_ExceptList
*middle
= 0;
1234 if (!be_global
->gen_lwccm ())
1236 ACE_NEW_RETURN (tail
,
1237 UTL_ExceptList (this->invalid_key_
,
1240 ACE_NEW_RETURN (middle
,
1241 UTL_ExceptList (this->unknown_key_value_
,
1246 UTL_ExceptList
*exceps
= 0;
1247 ACE_NEW_RETURN (exceps
,
1248 UTL_ExceptList (this->finder_failure_
,
1251 op
->be_add_exceptions (exceps
);
1252 op
->set_defined_in (implicit
);
1253 op
->set_imported (node
->imported ());
1255 if (0 == implicit
->be_add_operation (op
))
1264 be_visitor_ccm_pre_proc::gen_remove (be_home
*node
,
1265 AST_Interface
*implicit
)
1267 UTL_ScopedName
*op_name
= this->create_scoped_name (0,
1271 be_operation
*op
= 0;
1273 be_operation (be_global
->void_type (),
1274 AST_Operation::OP_noflags
,
1279 op
->set_name (op_name
);
1280 AST_Type
*pk
= node
->primary_key ();
1281 Identifier
arg_id ("key");
1282 UTL_ScopedName
arg_name (&arg_id
,
1284 AST_Argument
*arg
= 0;
1285 ACE_NEW_RETURN (arg
,
1286 be_argument (AST_Argument::dir_IN
,
1291 op
->be_add_argument (arg
);
1293 UTL_ExceptList
*tail
= 0;
1294 UTL_ExceptList
*middle
= 0;
1296 if (!be_global
->gen_lwccm ())
1298 ACE_NEW_RETURN (tail
,
1299 UTL_ExceptList (this->invalid_key_
,
1302 ACE_NEW_RETURN (middle
,
1303 UTL_ExceptList (this->unknown_key_value_
,
1308 UTL_ExceptList
*exceps
= 0;
1309 ACE_NEW_RETURN (exceps
,
1310 UTL_ExceptList (this->remove_failure_
,
1313 op
->be_add_exceptions (exceps
);
1314 op
->set_defined_in (implicit
);
1315 op
->set_imported (node
->imported ());
1317 if (0 == implicit
->be_add_operation (op
))
1326 be_visitor_ccm_pre_proc::gen_get_primary_key (be_home
*node
,
1327 AST_Interface
*implicit
)
1329 UTL_ScopedName
*op_name
= this->create_scoped_name (0,
1333 be_operation
*op
= 0;
1335 be_operation (node
->primary_key (),
1336 AST_Operation::OP_noflags
,
1341 op
->set_name (op_name
);
1342 Identifier
arg_id ("comp");
1343 UTL_ScopedName
arg_name (&arg_id
,
1345 AST_Argument
*arg
= 0;
1346 ACE_NEW_RETURN (arg
,
1347 be_argument (AST_Argument::dir_IN
,
1348 node
->managed_component (),
1352 op
->be_add_argument (arg
);
1353 op
->set_defined_in (implicit
);
1354 op
->set_imported (node
->imported ());
1356 if (0 == implicit
->be_add_operation (op
))
1365 be_visitor_ccm_pre_proc::gen_extended_port (be_porttype
*pt
)
1367 if (this->visit_scope (pt
) == -1)
1369 ACE_ERROR_RETURN ((LM_ERROR
,
1370 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1371 ACE_TEXT ("gen_extended_port - ")
1372 ACE_TEXT ("visit_scope for porttype failed\n")),
1380 be_visitor_ccm_pre_proc::lookup_cookie ()
1382 if (this->cookie_
== 0)
1384 Identifier
local_id ("Cookie");
1385 UTL_ScopedName
local_name (&local_id
,
1387 UTL_ScopedName
cookie_name (&this->module_id_
,
1390 idl_global
->root ()->lookup_by_name (&cookie_name
,
1392 local_id
.destroy ();
1396 idl_global
->err ()->lookup_error (&cookie_name
);
1400 this->cookie_
= dynamic_cast<be_valuetype
*> (d
);
1402 if (this->cookie_
== 0)
1404 idl_global
->err ()->valuetype_expected (d
);
1413 be_visitor_ccm_pre_proc::lookup_exceptions ()
1417 for (int i
= 0; i
< N_LW_EXCEPS
; ++i
)
1419 status
= this->lookup_one_exception (LW_EXCEP_NAMES
[i
],
1428 this->already_connected_
= LW_EXCEPS
[0];
1429 this->invalid_connection_
= LW_EXCEPS
[1];
1430 this->no_connection_
= LW_EXCEPS
[2];
1431 this->exceeded_connection_limit_
= LW_EXCEPS
[3];
1432 this->create_failure_
= LW_EXCEPS
[4];
1433 this->remove_failure_
= LW_EXCEPS
[5];
1434 this->finder_failure_
= LW_EXCEPS
[6];
1436 if (!be_global
->gen_lwccm ())
1438 for (int j
= 0; j
< N_ADDL_EXCEPS
; ++j
)
1440 status
= this->lookup_one_exception (ADDL_EXCEP_NAMES
[j
],
1449 this->invalid_key_
= ADDL_EXCEPS
[0];
1450 this->unknown_key_value_
= ADDL_EXCEPS
[1];
1451 this->duplicate_key_value_
= ADDL_EXCEPS
[2];
1458 be_visitor_ccm_pre_proc::lookup_one_exception (const char *name
,
1459 be_exception
*&result
)
1461 Identifier
id (name
);
1462 UTL_ScopedName
local_name (&id
,
1464 UTL_ScopedName
scoped_name (&this->module_id_
,
1467 idl_global
->root ()->lookup_by_name (&scoped_name
,
1473 idl_global
->err ()->lookup_error (&scoped_name
);
1477 result
= dynamic_cast<be_exception
*> (d
);
1488 be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype
*node
)
1491 UTL_Scope
*s
= node
->defined_in ();
1493 UTL_ScopedName
*consumer_name
=
1494 this->create_scoped_name (0,
1495 node
->local_name (),
1497 ScopeAsDecl (node
->defined_in ()));
1499 /// We need to create event consumers even for forward
1500 /// declared eventtypes. Since forward declarations can
1501 /// appear any number of times, we need to check that this
1502 /// event consumer hasn't already been created.
1503 if (s
->lookup_by_name (consumer_name
, true) != 0)
1508 AST_Interface
*event_consumer
= 0;
1509 AST_Module
*m
= dynamic_cast<AST_Module
*> (s
);
1511 // We're at global scope here so we need to fool the scope stack
1512 // for a minute so the correct repo id can be calculated at
1513 // interface construction time.
1514 idl_global
->scopes ().push (s
);
1516 Identifier
parent_id ("EventConsumerBase");
1517 UTL_ScopedName
parent_local_name (&parent_id
,
1519 UTL_ScopedName
parent_full_name (&this->module_id_
,
1520 &parent_local_name
);
1521 UTL_NameList
parent_list (&parent_full_name
,
1523 FE_InterfaceHeader
header (consumer_name
,
1528 ACE_NEW_RETURN (event_consumer
,
1529 be_interface (header
.name (),
1531 header
.n_inherits (),
1532 header
.inherits_flat (),
1533 header
.n_inherits_flat (),
1537 parent_id
.destroy ();
1540 idl_global
->scopes ().pop ();
1542 event_consumer
->set_defined_in (s
);
1543 event_consumer
->set_imported (node
->imported ());
1544 event_consumer
->set_name (consumer_name
);
1546 dynamic_cast<be_interface
*> (event_consumer
);
1547 bec
->original_interface (node
);
1549 // Set repo id to 0, so it will be recomputed on the next access,
1550 // and set the prefix to the eventtype's prefix. All this is
1551 // necessary in case the eventtype's prefix was modified after
1552 // its declaration. We assume 'implied IDL' means that the
1553 // derived event consumer interface should have the same prefix.
1554 event_consumer
->repoID (0);
1555 event_consumer
->prefix (const_cast<char*> (node
->prefix ()));
1557 dynamic_cast<be_type
*> (event_consumer
)->gen_fwd_helper_name ();
1558 m
->be_add_interface (event_consumer
);
1559 return this->gen_push_op (node
,
1564 be_visitor_ccm_pre_proc::lookup_consumer (be_field
*node
)
1566 AST_Type
*impl
= node
->field_type ();
1567 ACE_CString
rettype_string (impl
->local_name ()->get_string ());
1568 rettype_string
+= "Consumer";
1569 Identifier
rettype_id (rettype_string
.fast_rep ());
1571 impl
->defined_in ()->lookup_by_name_local (&rettype_id
, false);
1572 rettype_id
.destroy ();
1579 AST_Interface
*i
= dynamic_cast<AST_Interface
*> (d
);
1583 idl_global
->err ()->interface_expected (d
);
1591 be_visitor_ccm_pre_proc::create_explicit (be_home
*node
)
1593 be_visitor_xplicit_pre_proc
v (this->ctx_
);
1595 if (v
.visit_home (node
) != 0)
1597 ACE_ERROR_RETURN ((LM_ERROR
,
1598 ACE_TEXT ("be_visitor_ccm_pre_proc::")
1599 ACE_TEXT ("create_explicit - ")
1600 ACE_TEXT ("home xplicit visitor failed\n")),
1604 return v
.xplicit ();
1608 be_visitor_ccm_pre_proc::create_implicit (be_home
*node
)
1610 Identifier
*parent_id
= 0;
1611 ACE_NEW_RETURN (parent_id
,
1612 Identifier ("KeylessCCMHome"),
1615 UTL_ScopedName
*parent_local_name
= 0;
1616 ACE_NEW_RETURN (parent_local_name
,
1617 UTL_ScopedName (parent_id
, 0),
1620 UTL_ScopedName
*parent_full_name
= 0;
1621 ACE_NEW_RETURN (parent_full_name
,
1622 UTL_ScopedName (this->module_id_
.copy (),
1626 UTL_NameList
parent_list (parent_full_name
, 0);
1628 UTL_NameList
*parent_list_ptr
= 0;
1630 if (node
->primary_key () == 0)
1632 parent_list_ptr
= &parent_list
;
1635 FE_InterfaceHeader
header (0,
1641 // We're at global scope here so we need to fool the scope stack
1642 // for a minute so the correct repo id can be calculated at
1643 // interface construction time.
1644 idl_global
->scopes ().push (node
->defined_in ());
1646 UTL_ScopedName
*implicit_name
=
1647 this->create_scoped_name (0,
1648 node
->local_name (),
1650 ScopeAsDecl (node
->defined_in ()));
1652 be_interface
*i
= 0;
1654 be_interface (implicit_name
,
1656 header
.n_inherits (),
1657 header
.inherits_flat (),
1658 header
.n_inherits_flat (),
1664 idl_global
->scopes ().pop ();
1667 parent_list
.destroy ();
1669 // So we can generate the proper typecode.
1670 i
->home_equiv (true);
1672 i
->set_name (implicit_name
);
1673 i
->set_defined_in (node
->defined_in ());
1674 i
->set_imported (node
->imported ());
1676 i
->gen_fwd_helper_name ();
1677 i
->original_interface (node
);
1678 AST_Module
*m
= dynamic_cast<AST_Module
*> (node
->defined_in ());
1679 m
->be_add_interface (i
);
1685 be_visitor_ccm_pre_proc::create_equivalent (be_home
*node
,
1686 AST_Interface
*xplicit
,
1687 AST_Interface
*implicit
)
1689 UTL_Scope
*s
= node
->defined_in ();
1690 UTL_ScopedName
*equiv_name
=
1691 this->create_scoped_name (0,
1692 node
->local_name (),
1695 UTL_NameList
tail (implicit
->name (),
1697 UTL_NameList
parent_list (xplicit
->name (),
1699 FE_InterfaceHeader
header (0,
1705 // We're at global scope here so we need to fool the scope stack
1706 // for a minute so the correct repo id can be calculated at
1707 // interface construction time.
1708 idl_global
->scopes ().push (node
->defined_in ());
1710 be_interface
*retval
= 0;
1711 ACE_NEW_RETURN (retval
,
1712 be_interface (equiv_name
,
1714 header
.n_inherits (),
1715 header
.inherits_flat (),
1716 header
.n_inherits_flat (),
1722 idl_global
->scopes ().pop ();
1724 // So we can generate the proper typecode.
1725 retval
->home_equiv (true);
1727 retval
->set_name (equiv_name
);
1728 retval
->set_defined_in (s
);
1729 retval
->set_imported (node
->imported ());
1730 retval
->gen_fwd_helper_name ();
1731 retval
->original_interface (node
);
1733 UTL_ScopedName
*unmangled_name
=
1734 static_cast<UTL_ScopedName
*> (node
->name ()->copy ());
1735 UTL_ScopedName
*mangled_name
=
1736 this->create_scoped_name (0,
1737 node
->local_name (),
1738 "_tao_home_name_extension",
1740 node
->set_name (mangled_name
);
1741 AST_Module
*m
= dynamic_cast<AST_Module
*> (s
);
1743 /// Calling be_add_interface() here calls add_to_referenced(),
1744 /// which will give a redef error.
1745 m
->add_to_scope (retval
);
1747 node
->set_name (unmangled_name
);
1752 be_visitor_ccm_pre_proc::create_scoped_name (const char *prefix
,
1753 const char *local_name
,
1757 ACE_CString
local_string (prefix
,
1760 local_string
+= local_name
;
1761 local_string
+= suffix
;
1762 Identifier
*local_id
= 0;
1763 ACE_NEW_RETURN (local_id
,
1764 Identifier (local_string
.fast_rep ()),
1766 UTL_ScopedName
*last_segment
= 0;
1767 ACE_NEW_RETURN (last_segment
,
1768 UTL_ScopedName (local_id
,
1771 UTL_ScopedName
*full_name
=
1772 static_cast<UTL_ScopedName
*> (parent
->name ()->copy ());
1773 full_name
->nconc (last_segment
);
1778 be_visitor_ccm_pre_proc::compute_inheritance (be_home
*node
)
1780 UTL_NameList
*retval
= 0;
1782 if (node
->base_home () == 0)
1784 Identifier
*local_id
= 0;
1785 ACE_NEW_RETURN (local_id
,
1786 Identifier ("CCMHome"),
1788 UTL_ScopedName
*local_name
= 0;
1789 ACE_NEW_RETURN (local_name
,
1790 UTL_ScopedName (local_id
,
1793 UTL_ScopedName
*full_name
= 0;
1794 ACE_NEW_RETURN (full_name
,
1795 UTL_ScopedName (this->module_id_
.copy (),
1798 ACE_NEW_RETURN (retval
,
1799 UTL_NameList (full_name
,
1806 ACE_CString
new_local (
1807 node
->base_home ()->local_name ()->get_string ()
1809 new_local
+= "Explicit";
1810 UTL_ScopedName
*parent_name
=
1811 static_cast<UTL_ScopedName
*> (node
->base_home ()->name ()->copy ());
1812 parent_name
->last_component ()->replace_string (new_local
.c_str ());
1813 ACE_NEW_RETURN (retval
,
1814 UTL_NameList (parent_name
,
1819 long n_supports
= node
->n_inherits ();
1820 UTL_ScopedName
*supported_name
= 0;
1821 UTL_NameList
*conc_value
= 0;
1823 for (long i
= 0; i
< n_supports
; ++i
)
1826 static_cast<UTL_ScopedName
*> (node
->inherits ()[i
]->name ()->copy ());
1827 ACE_NEW_RETURN (conc_value
,
1828 UTL_NameList (supported_name
,
1831 retval
->nconc (conc_value
);
1838 be_visitor_ccm_pre_proc::generate_ami4ccm_uses ()
1840 /// The interfaces in the list below are from this IDL file,
1841 /// which then must be processed with the -GC option, so we
1842 /// know we'll get here - a good place to generate the *A.idl
1843 /// file containing the local interfaces and connector
1844 /// associated with each interface in the list.
1846 ACE_Unbounded_Queue
<char *> &ccm_ami_receps
=
1847 idl_global
->ciao_ami_recep_names ();
1849 /// If the queue is empty, we're done.
1850 if (ccm_ami_receps
.size () == 0)
1855 for (ACE_Unbounded_Queue
<char *>::CONST_ITERATOR
i (
1863 UTL_ScopedName
*sn
=
1864 FE_Utils::string_to_scoped_name (*item
);
1867 idl_global
->scopes ().top_non_null ();
1869 AST_Decl
*d
= s
->lookup_by_name (sn
, true);
1873 idl_global
->err ()->lookup_error (sn
);
1886 be_uses
*u
= dynamic_cast<be_uses
*> (d
);
1890 ACE_ERROR_RETURN ((LM_ERROR
,
1891 ACE_TEXT ("be_visitor_ccm_pre_proc")
1892 ACE_TEXT ("::generate_ami4ccm_uses - ")
1893 ACE_TEXT ("narrow to receptacle ")
1894 ACE_TEXT ("failed\n")),
1898 be_interface
*iface
=
1899 dynamic_cast<be_interface
*> (u
->uses_type ());
1901 /// The real AMI_xxx exists only in the *A.idl file, so
1902 /// we create a dummy as the uses type for the implied
1903 /// receptacle created below, but only if it hasn't
1904 /// already been created for this uses type.
1906 be_interface
*ami_iface
=
1907 dynamic_cast<be_interface
*> (iface
->ami4ccm_uses ());
1911 ACE_CString
iname ("AMI4CCM_");
1913 iname
+= iface
->local_name ();
1914 Identifier
itmp_id (iname
.c_str ());
1915 UTL_ScopedName
itmp_sn (&itmp_id
, 0);
1917 s
= iface
->defined_in ();
1918 idl_global
->scopes ().push (s
);
1919 ACE_NEW_RETURN (ami_iface
,
1920 be_interface (&itmp_sn
,
1929 idl_global
->scopes ().pop ();
1931 /// Make it imported so it doesn't trigger
1932 /// any unwanted code generation.
1933 ami_iface
->set_imported (true);
1935 s
->add_to_scope (ami_iface
);
1936 iface
->ami4ccm_uses (ami_iface
);
1939 /// Now create the receptacle, passing in
1940 /// the local interface created above as the
1941 /// uses type. We don't generate anything
1942 /// in the main IDL file from the interface's
1943 /// contents, so it's ok that it's empty.
1945 ACE_CString
uname ("sendc_");
1946 uname
+= u
->local_name ()->get_string ();
1947 Identifier
utmp_id (uname
.c_str ());
1948 UTL_ScopedName
utmp_sn (&utmp_id
, 0);
1950 s
= u
->defined_in ();
1951 idl_global
->scopes ().push (s
);
1952 be_uses
*ami_uses
= 0;
1953 ACE_NEW_RETURN (ami_uses
,
1959 s
->add_to_scope (ami_uses
);
1960 idl_global
->scopes ().pop ();
1962 if (u
->is_multiple ())
1965 AST_Type *t = u->uses_type ();
1966 ACE_CString fname (t->file_name ());
1968 char *path = ACE_OS::realpath (fname.c_str (), dummy);
1969 ACE_DEBUG ((LM_DEBUG, "utype file: %s\n", path));
1971 // Grammar ensures this narrowing will never be 0.
1973 dynamic_cast<AST_Component
*> (s
);
1974 FE_Utils::create_uses_multiple_stuff (c
, ami_uses
);