Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / TAO_IDL / be / be_generator.cpp
blobe4774e03b17f0462fad1fbff262f9252b434dbb8
1 /*
3 COPYRIGHT
5 Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
6 States of America. All Rights Reserved.
8 This product is protected by copyright and distributed under the following
9 license restricting its use.
11 The Interface Definition Language Compiler Front End (CFE) is made
12 available for your use provided that you include this license and copyright
13 notice on all media and documentation and the software program in which
14 this product is incorporated in whole or part. You may copy and extend
15 functionality (but may not remove functionality) of the Interface
16 Definition Language CFE without charge, but you are not authorized to
17 license or distribute it to anyone else except as part of a product or
18 program developed by you or with the express written consent of Sun
19 Microsystems, Inc. ("Sun").
21 The names of Sun Microsystems, Inc. and any of its subsidiaries or
22 affiliates may not be used in advertising or publicity pertaining to
23 distribution of Interface Definition Language CFE as permitted herein.
25 This license is effective until terminated by Sun for failure to comply
26 with this license. Upon termination, you shall destroy or return all code
27 and documentation for the Interface Definition Language CFE.
29 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
30 ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
32 DEALING, USAGE OR TRADE PRACTICE.
34 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
35 ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
36 TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
38 SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
39 RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
40 INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
42 IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
43 ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
44 DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
46 Use, duplication, or disclosure by the government is subject to
47 restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
48 Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
49 52.227-19.
51 Sun, Sun Microsystems and the Sun logo are trademarks or registered
52 trademarks of Sun Microsystems, Inc.
54 SunSoft, Inc.
55 2550 Garcia Avenue
56 Mountain View, California 94043
58 NOTE:
60 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
61 trademarks or registered trademarks of Sun Microsystems, Inc.
65 // Implementation of BE generator class.
67 // This implements the same protocol as AST_Generator but creates instances
68 // of the BE-subclassed classes instead of of AST classes.
70 #include "be_generator.h"
71 #include "be_root.h"
72 #include "be_predefined_type.h"
73 #include "be_module.h"
74 #include "be_valuebox.h"
75 #include "be_valuetype.h"
76 #include "be_valuetype_fwd.h"
77 #include "be_eventtype.h"
78 #include "be_eventtype_fwd.h"
79 #include "be_component.h"
80 #include "be_component_fwd.h"
81 #include "be_home.h"
82 #include "be_porttype.h"
83 #include "be_mirror_port.h"
84 #include "be_connector.h"
85 #include "be_template_module.h"
86 #include "be_template_module_inst.h"
87 #include "be_template_module_ref.h"
88 #include "be_param_holder.h"
89 #include "be_provides.h"
90 #include "be_uses.h"
91 #include "be_publishes.h"
92 #include "be_emits.h"
93 #include "be_consumes.h"
94 #include "be_union.h"
95 #include "be_union_fwd.h"
96 #include "be_structure.h"
97 #include "be_structure_fwd.h"
98 #include "be_exception.h"
99 #include "be_operation.h"
100 #include "be_enum.h"
101 #include "be_field.h"
102 #include "be_argument.h"
103 #include "be_attribute.h"
104 #include "be_union_branch.h"
105 #include "be_union_label.h"
106 #include "be_constant.h"
107 #include "be_expression.h"
108 #include "be_enum_val.h"
109 #include "be_array.h"
110 #include "be_sequence.h"
111 #include "be_map.h"
112 #include "be_string.h"
113 #include "be_typedef.h"
114 #include "be_native.h"
115 #include "be_fixed.h"
116 #include "be_factory.h"
117 #include "be_finder.h"
118 #include "utl_identifier.h"
119 #include "nr_extern.h"
120 #include "ace/config-all.h"
122 AST_Root *
123 be_generator::create_root (UTL_ScopedName *n)
125 be_root *retval = nullptr;
126 ACE_NEW_RETURN (retval,
127 be_root (n),
128 nullptr);
130 return retval;
133 AST_PredefinedType *
134 be_generator::create_predefined_type (AST_PredefinedType::PredefinedType t,
135 UTL_ScopedName *n)
137 be_predefined_type *retval = nullptr;
138 ACE_NEW_RETURN (retval,
139 be_predefined_type (t,
141 nullptr);
143 return retval;
146 AST_Module *
147 be_generator::create_module (UTL_Scope *s,
148 UTL_ScopedName *n)
150 AST_Module *retval = nullptr;
152 // Check for another module of the same name in this scope.
153 for (UTL_ScopeActiveIterator iter (s, UTL_Scope::IK_decls);
154 !iter.is_done ();
155 iter.next ())
157 // Can't just check node type here, since it could be a
158 // template module or template module instantiation.
159 AST_Module *m = dynamic_cast<AST_Module*> (iter.item ());
161 if (m && m->local_name ()->compare (n->last_component ()))
163 // Create this new module with referance to the
164 // "first" previous module found in scope.
165 ACE_NEW_RETURN (retval, be_module (n, m), nullptr);
166 retval->prefix (const_cast<char *> (m->prefix ()));
167 return retval;
171 // Since the scope didn't contain the same module name, it
172 // doesn't mean that we haven't see it before. If the scope
173 // is itself a module, and has been previously opened, any
174 // of the previous openings may contain a previous opening
175 // of the module we're creating.
176 AST_Module *prev_module = dynamic_cast<AST_Module*> (s);
177 if (prev_module)
179 while (!!(prev_module = prev_module->previous_opening ()))
181 for (UTL_ScopeActiveIterator iter (prev_module, UTL_Scope::IK_decls);
182 !iter.is_done ();
183 iter.next ())
185 AST_Module *m = dynamic_cast<AST_Module*> (iter.item ());
186 if (m && m->local_name ()->compare (n->last_component ()))
188 // Create this new module with referance to the
189 // "first" previous module found in scope.
190 ACE_NEW_RETURN (retval, be_module (n, m), nullptr);
191 return retval;
197 // There is no previous module to be found
198 ACE_NEW_RETURN (retval, be_module (n), nullptr);
199 return retval;
202 AST_Interface *
203 be_generator::create_interface (UTL_ScopedName *n,
204 AST_Type **ih,
205 long nih,
206 AST_Interface **ih_flat,
207 long nih_flat,
208 bool l,
209 bool a)
211 be_interface *retval = nullptr;
212 ACE_NEW_RETURN (retval,
213 be_interface (n,
215 nih,
216 ih_flat,
217 nih_flat,
220 nullptr);
222 /// Trigger this interation over the included pragmas when the
223 /// first local interface is seen in the main file. In an
224 /// executor IDL file (the case we want), this happens near the
225 /// top. In other files, it will do no harm.
226 if (l && idl_global->in_main_file ())
228 FE_Utils::create_implied_ami_uses_stuff ();
231 return retval;
234 AST_InterfaceFwd *
235 be_generator::create_interface_fwd (UTL_ScopedName *n,
236 bool is_local,
237 bool is_abstract)
239 AST_Interface *full_defn = this->create_interface (n,
240 nullptr,
242 nullptr,
244 is_local,
245 is_abstract);
247 be_interface_fwd *retval = nullptr;
248 ACE_NEW_RETURN (retval,
249 be_interface_fwd (full_defn,
251 nullptr);
253 full_defn->fwd_decl (retval);
254 return retval;
257 AST_ValueBox *
258 be_generator::create_valuebox (UTL_ScopedName *n,
259 AST_Type *boxed_type)
261 be_valuebox *retval = nullptr;
262 ACE_NEW_RETURN (retval,
263 be_valuebox (boxed_type,
265 nullptr);
267 return retval;
270 AST_ValueType *
271 be_generator::create_valuetype (UTL_ScopedName *n,
272 AST_Type **inherits,
273 long n_inherits,
274 AST_Type *inherits_concrete,
275 AST_Interface **inherits_flat,
276 long n_inherits_flat,
277 AST_Type **supports_list,
278 long n_supports,
279 AST_Type *supports_concrete,
280 bool is_abstract,
281 bool is_truncatable,
282 bool is_custom)
284 be_valuetype *retval = nullptr;
285 ACE_NEW_RETURN (retval,
286 be_valuetype (n,
287 inherits,
288 n_inherits,
289 inherits_concrete,
290 inherits_flat,
291 n_inherits_flat,
292 supports_list,
293 n_supports,
294 supports_concrete,
295 is_abstract,
296 is_truncatable,
297 is_custom),
298 nullptr);
300 return retval;
303 AST_ValueTypeFwd *
304 be_generator::create_valuetype_fwd (UTL_ScopedName *n,
305 bool is_abstract)
307 AST_ValueType *full_defn = this->create_valuetype (n,
308 nullptr,
310 nullptr,
311 nullptr,
313 nullptr,
315 nullptr,
316 is_abstract,
317 false,
318 false);
320 be_valuetype_fwd *retval = nullptr;
321 ACE_NEW_RETURN (retval,
322 be_valuetype_fwd (full_defn,
324 nullptr);
326 full_defn->fwd_decl (retval);
327 return retval;
330 AST_EventType *
331 be_generator::create_eventtype (UTL_ScopedName *n,
332 AST_Type **inherits,
333 long n_inherits,
334 AST_Type *inherits_concrete,
335 AST_Interface **inherits_flat,
336 long n_inherits_flat,
337 AST_Type **supports_list,
338 long n_supports,
339 AST_Type *supports_concrete,
340 bool is_abstract,
341 bool is_truncatable,
342 bool is_custom)
344 be_eventtype *retval = nullptr;
345 ACE_NEW_RETURN (retval,
346 be_eventtype (n,
347 inherits,
348 n_inherits,
349 inherits_concrete,
350 inherits_flat,
351 n_inherits_flat,
352 supports_list,
353 n_supports,
354 supports_concrete,
355 is_abstract,
356 is_truncatable,
357 is_custom),
358 nullptr);
360 return retval;
363 AST_EventTypeFwd *
364 be_generator::create_eventtype_fwd (UTL_ScopedName *n,
365 bool is_abstract)
367 AST_EventType *full_defn = this->create_eventtype (n,
368 nullptr,
370 nullptr,
371 nullptr,
373 nullptr,
375 nullptr,
376 is_abstract,
377 false,
378 false);
380 be_eventtype_fwd *retval = nullptr;
381 ACE_NEW_RETURN (retval,
382 be_eventtype_fwd (full_defn,
384 nullptr);
386 full_defn->fwd_decl (retval);
387 return retval;
390 AST_Component *
391 be_generator::create_component (UTL_ScopedName *n,
392 AST_Component *base_component,
393 AST_Type **supports_list,
394 long n_supports,
395 AST_Interface **supports_flat,
396 long n_supports_flat)
398 be_component *retval = nullptr;
399 ACE_NEW_RETURN (retval,
400 be_component (n,
401 base_component,
402 supports_list,
403 n_supports,
404 supports_flat,
405 n_supports_flat),
406 nullptr);
408 return retval;
411 AST_ComponentFwd *
412 be_generator::create_component_fwd (UTL_ScopedName *n)
414 AST_Component *full_defn = this->create_component (n,
415 nullptr,
416 nullptr,
418 nullptr,
421 be_component_fwd *retval = nullptr;
422 ACE_NEW_RETURN (retval,
423 be_component_fwd (full_defn,
425 nullptr);
427 full_defn->fwd_decl (retval);
428 return retval;
431 AST_Home *
432 be_generator::create_home (UTL_ScopedName *n,
433 AST_Home *base_home,
434 AST_Component *managed_component,
435 AST_Type *primary_key,
436 AST_Type **supports_list,
437 long n_supports,
438 AST_Interface **supports_flat,
439 long n_supports_flat)
441 be_home *retval = nullptr;
442 ACE_NEW_RETURN (retval,
443 be_home (n,
444 base_home,
445 managed_component,
446 primary_key,
447 supports_list,
448 n_supports,
449 supports_flat,
450 n_supports_flat),
451 nullptr);
453 return retval;
456 AST_Exception *
457 be_generator::create_exception (UTL_ScopedName *n,
458 bool is_local,
459 bool is_abstract)
461 be_exception *retval = nullptr;
462 ACE_NEW_RETURN (retval,
463 be_exception (n,
464 is_local,
465 is_abstract),
466 nullptr);
468 return retval;
471 AST_Structure *
472 be_generator::create_structure (UTL_ScopedName *n,
473 bool is_local,
474 bool is_abstract)
476 be_structure *retval = nullptr;
477 ACE_NEW_RETURN (retval,
478 be_structure (n,
479 is_local,
480 is_abstract),
481 nullptr);
483 return retval;
486 AST_StructureFwd *
487 be_generator::create_structure_fwd (UTL_ScopedName *n)
489 AST_Structure *full_defn = this->create_structure (n,
490 false,
491 false);
492 be_structure_fwd *retval = nullptr;
493 ACE_NEW_RETURN (retval,
494 be_structure_fwd (full_defn,
496 nullptr);
498 full_defn->fwd_decl (retval);
499 return retval;
502 AST_Enum *
503 be_generator::create_enum (UTL_ScopedName *n,
504 bool is_local,
505 bool is_abstract)
507 be_enum *retval = nullptr;
508 ACE_NEW_RETURN (retval,
509 be_enum (n,
510 is_local,
511 is_abstract),
512 nullptr);
514 return retval;
517 AST_Operation *
518 be_generator::create_operation (AST_Type *rt,
519 AST_Operation::Flags fl,
520 UTL_ScopedName *n,
521 bool is_local,
522 bool is_abstract)
524 be_operation *retval = nullptr;
525 ACE_NEW_RETURN (retval,
526 be_operation (rt,
529 is_local,
530 is_abstract),
531 nullptr);
533 return retval;
536 AST_Field *
537 be_generator::create_field (AST_Type *ft,
538 UTL_ScopedName *n,
539 AST_Field::Visibility vis)
541 be_field *retval = nullptr;
542 ACE_NEW_RETURN (retval,
543 be_field (ft,
545 vis),
546 nullptr);
548 return retval;
551 AST_Argument *
552 be_generator::create_argument (AST_Argument::Direction d,
553 AST_Type *ft,
554 UTL_ScopedName *n)
556 be_argument *retval = nullptr;
557 ACE_NEW_RETURN (retval,
558 be_argument (d,
561 nullptr);
563 return retval;
566 AST_Attribute *
567 be_generator::create_attribute (bool ro,
568 AST_Type *ft,
569 UTL_ScopedName *n,
570 bool is_local,
571 bool is_abstract)
573 be_attribute *retval = nullptr;
574 ACE_NEW_RETURN (retval,
575 be_attribute (ro,
578 is_local,
579 is_abstract),
580 nullptr);
582 return retval;
585 AST_Union *
586 be_generator::create_union (AST_ConcreteType *dt,
587 UTL_ScopedName *n,
588 bool is_local,
589 bool is_abstract)
591 be_union *retval = nullptr;
592 ACE_NEW_RETURN (retval,
593 be_union (dt,
595 is_local,
596 is_abstract),
597 nullptr);
599 return retval;
602 AST_UnionFwd *
603 be_generator::create_union_fwd (UTL_ScopedName *n)
605 AST_Union *full_defn = this->create_union (nullptr,
607 false,
608 false);
609 be_union_fwd *retval = nullptr;
610 ACE_NEW_RETURN (retval,
611 be_union_fwd (full_defn,
613 nullptr);
615 full_defn->fwd_decl (retval);
616 return retval;
619 AST_UnionBranch *
620 be_generator::create_union_branch (UTL_LabelList *ll,
621 AST_Type *ft,
622 UTL_ScopedName *n)
624 be_union_branch *retval = nullptr;
625 ACE_NEW_RETURN (retval,
626 be_union_branch (ll,
629 nullptr);
631 return retval;
634 AST_UnionLabel *
635 be_generator::create_union_label (AST_UnionLabel::UnionLabel ul,
636 AST_Expression *lv)
638 be_union_label *retval = nullptr;
639 ACE_NEW_RETURN (retval,
640 be_union_label (ul,
641 lv),
642 nullptr);
644 return retval;
647 AST_Constant *
648 be_generator::create_constant (AST_Expression::ExprType et,
649 AST_Expression *ev,
650 UTL_ScopedName *n)
652 be_constant *retval = nullptr;
653 ACE_NEW_RETURN (retval,
654 be_constant (et,
657 nullptr);
659 return retval;
662 AST_Expression *
663 be_generator::create_expr (UTL_ScopedName *n)
665 be_expression *retval = nullptr;
666 ACE_NEW_RETURN (retval,
667 be_expression (n),
668 nullptr);
670 return retval;
673 AST_Expression *
674 be_generator::create_expr (AST_Expression *b,
675 AST_Expression::ExprType t)
677 be_expression *retval = nullptr;
678 ACE_NEW_RETURN (retval,
679 be_expression (b,
681 nullptr);
683 return retval;
686 AST_Expression *
687 be_generator::create_expr (AST_Expression::ExprComb c,
688 AST_Expression *v1,
689 AST_Expression *v2)
691 be_expression *retval = nullptr;
692 ACE_NEW_RETURN (retval,
693 be_expression (c,
695 v2),
696 nullptr);
698 return retval;
701 AST_Expression *
702 be_generator::create_expr (ACE_CDR::Long l)
704 be_expression *retval = nullptr;
705 ACE_NEW_RETURN (retval,
706 be_expression (l),
707 nullptr);
709 return retval;
712 AST_Expression *
713 be_generator::create_expr (ACE_CDR::LongLong l)
715 be_expression *retval = nullptr;
716 ACE_NEW_RETURN (retval,
717 be_expression (l),
718 nullptr);
720 return retval;
723 AST_Expression *
724 be_generator::create_expr (ACE_CDR::Boolean b)
726 be_expression *retval = nullptr;
727 ACE_NEW_RETURN (retval,
728 be_expression (b),
729 nullptr);
731 return retval;
734 AST_Expression *
735 be_generator::create_expr (ACE_CDR::ULong l)
737 be_expression *retval = nullptr;
738 ACE_NEW_RETURN (retval,
739 be_expression (l),
740 nullptr);
742 return retval;
745 AST_Expression *
746 be_generator::create_expr (ACE_CDR::ULongLong l)
748 be_expression *retval = nullptr;
749 ACE_NEW_RETURN (retval,
750 be_expression (l),
751 nullptr);
753 return retval;
756 AST_Expression *
757 be_generator::create_expr (ACE_CDR::ULong l,
758 AST_Expression::ExprType t)
760 be_expression *retval = nullptr;
761 ACE_NEW_RETURN (retval,
762 be_expression (l, t),
763 nullptr);
765 return retval;
768 AST_Expression *
769 be_generator::create_expr (UTL_String *s)
771 be_expression *retval = nullptr;
772 ACE_NEW_RETURN (retval,
773 be_expression (s),
774 nullptr);
776 return retval;
779 AST_Expression *
780 be_generator::create_expr (ACE_CDR::Char c)
782 be_expression *retval = nullptr;
783 ACE_NEW_RETURN (retval,
784 be_expression (c),
785 nullptr);
787 return retval;
790 AST_Expression *
791 be_generator::create_expr (ACE_OutputCDR::from_wchar wc)
793 be_expression *retval = nullptr;
794 ACE_NEW_RETURN (retval,
795 be_expression (wc),
796 nullptr);
798 return retval;
801 AST_Expression *
802 be_generator::create_expr (char *s)
804 be_expression *retval = nullptr;
805 ACE_NEW_RETURN (retval,
806 be_expression (s),
807 nullptr);
809 return retval;
812 AST_Expression *
813 be_generator::create_expr (ACE_CDR::Double d)
815 be_expression *retval = nullptr;
816 ACE_NEW_RETURN (retval,
817 be_expression (d),
818 nullptr);
820 return retval;
823 AST_Expression *
824 be_generator::create_expr (const ACE_CDR::Fixed &f)
826 be_expression *retval = nullptr;
827 ACE_NEW_RETURN (retval,
828 be_expression (f),
829 nullptr);
831 return retval;
834 AST_EnumVal *
835 be_generator::create_enum_val (ACE_CDR::ULong v,
836 UTL_ScopedName *n)
838 be_enum_val *retval = nullptr;
839 ACE_NEW_RETURN (retval,
840 be_enum_val (v,
842 nullptr);
844 return retval;
847 AST_Array *
848 be_generator::create_array (UTL_ScopedName *n,
849 ACE_CDR::ULong ndims,
850 UTL_ExprList *dims,
851 bool is_local,
852 bool is_abstract)
854 be_array *retval = nullptr;
855 ACE_NEW_RETURN (retval,
856 be_array (n,
857 ndims,
858 dims,
859 is_local,
860 is_abstract),
861 nullptr);
863 return retval;
866 AST_Sequence *
867 be_generator::create_sequence (AST_Expression *v,
868 AST_Type *bt,
869 UTL_ScopedName *n,
870 bool is_local,
871 bool is_abstract)
873 be_sequence *retval = nullptr;
874 ACE_NEW_RETURN (retval,
875 be_sequence (v,
878 is_local,
879 is_abstract),
880 nullptr);
882 return retval;
885 AST_Map *
886 be_generator::create_map (AST_Expression *v,
887 AST_Type *kt,
888 AST_Type *vt,
889 UTL_ScopedName *n,
890 bool is_local,
891 bool is_abstract)
893 be_map *retval = nullptr;
894 ACE_NEW_RETURN (retval,
895 be_map (v,
899 is_local,
900 is_abstract),
901 nullptr);
903 return retval;
906 AST_String *
907 be_generator::create_string (AST_Expression *v)
909 Identifier id ("string");
910 UTL_ScopedName n (&id,
911 nullptr);
913 be_string *retval = nullptr;
914 ACE_NEW_RETURN (retval,
915 be_string (AST_Decl::NT_string,
919 nullptr);
921 return retval;
924 AST_String *
925 be_generator::create_wstring (AST_Expression *v)
927 Identifier id (sizeof (ACE_CDR::WChar) == 1
928 ? "string"
929 : "wstring");
930 UTL_ScopedName n (&id,
931 nullptr);
932 AST_Decl::NodeType nt = sizeof (ACE_CDR::WChar) == 1
933 ? AST_Decl::NT_string
934 : AST_Decl::NT_wstring;
936 be_string *retval = nullptr;
937 ACE_NEW_RETURN (retval,
938 be_string (nt,
941 sizeof (ACE_CDR::WChar)),
942 nullptr);
944 return retval;
947 AST_Fixed *
948 be_generator::create_fixed (AST_Expression *digits,
949 AST_Expression *scale)
951 Identifier id ("fixed");
952 UTL_ScopedName name (&id, nullptr);
953 AST_Fixed *retval = nullptr;
954 ACE_NEW_RETURN (retval, be_fixed (&name, digits, scale), nullptr);
955 return retval;
958 AST_Typedef *
959 be_generator::create_typedef (AST_Type *bt,
960 UTL_ScopedName *n,
961 bool is_local,
962 bool is_abstract)
964 be_typedef *retval = nullptr;
965 ACE_NEW_RETURN (retval,
966 be_typedef (bt,
968 is_local,
969 is_abstract),
970 nullptr);
972 return retval;
975 AST_Native *
976 be_generator::create_native (UTL_ScopedName *n)
978 be_native *retval = nullptr;
979 ACE_NEW_RETURN (retval,
980 be_native (n),
981 nullptr);
983 return retval;
986 AST_Factory *
987 be_generator::create_factory (UTL_ScopedName *n)
989 be_factory *retval = nullptr;
990 ACE_NEW_RETURN (retval,
991 be_factory (n),
992 nullptr);
994 return retval;
997 AST_Finder *
998 be_generator::create_finder (UTL_ScopedName *n)
1000 be_finder *retval = nullptr;
1001 ACE_NEW_RETURN (retval,
1002 be_finder (n),
1003 nullptr);
1005 return retval;
1008 AST_PortType *
1009 be_generator::create_porttype (UTL_ScopedName *n)
1011 be_porttype *retval = nullptr;
1012 ACE_NEW_RETURN (retval,
1013 be_porttype (n),
1014 nullptr);
1016 return retval;
1019 AST_Provides *
1020 be_generator::create_provides (UTL_ScopedName *n,
1021 AST_Type *provides_type)
1023 be_provides *retval = nullptr;
1024 ACE_NEW_RETURN (retval,
1025 be_provides (n,
1026 provides_type),
1027 nullptr);
1029 return retval;
1032 AST_Uses *
1033 be_generator::create_uses (UTL_ScopedName *n,
1034 AST_Type *uses_type,
1035 bool is_multiple)
1037 be_uses *retval = nullptr;
1038 ACE_NEW_RETURN (retval,
1039 be_uses (n,
1040 uses_type,
1041 is_multiple),
1042 nullptr);
1044 return retval;
1047 AST_Publishes *
1048 be_generator::create_publishes (UTL_ScopedName *n,
1049 AST_Type *publishes_type)
1051 be_publishes *retval = nullptr;
1052 ACE_NEW_RETURN (retval,
1053 be_publishes (n,
1054 publishes_type),
1055 nullptr);
1057 return retval;
1060 AST_Emits *
1061 be_generator::create_emits (UTL_ScopedName *n,
1062 AST_Type *emits_type)
1064 be_emits *retval = nullptr;
1065 ACE_NEW_RETURN (retval,
1066 be_emits (n,
1067 emits_type),
1068 nullptr);
1070 return retval;
1072 AST_Consumes *
1073 be_generator::create_consumes (UTL_ScopedName *n,
1074 AST_Type *consumes_type)
1076 be_consumes *retval = nullptr;
1077 ACE_NEW_RETURN (retval,
1078 be_consumes (n,
1079 consumes_type),
1080 nullptr);
1082 return retval;
1085 AST_Extended_Port *
1086 be_generator::create_extended_port (
1087 UTL_ScopedName *n,
1088 AST_PortType *porttype_ref)
1090 be_extended_port *retval = nullptr;
1091 ACE_NEW_RETURN (retval,
1092 be_extended_port (n,
1093 porttype_ref),
1094 nullptr);
1096 return retval;
1099 AST_Mirror_Port *
1100 be_generator::create_mirror_port (
1101 UTL_ScopedName *n,
1102 AST_PortType *porttype_ref)
1104 be_mirror_port *retval = nullptr;
1105 ACE_NEW_RETURN (retval,
1106 be_mirror_port (n,
1107 porttype_ref),
1108 nullptr);
1110 return retval;
1113 AST_Connector *
1114 be_generator::create_connector (
1115 UTL_ScopedName *n,
1116 AST_Connector *base_connector)
1118 be_connector *retval = nullptr;
1119 ACE_NEW_RETURN (retval,
1120 be_connector (n,
1121 base_connector),
1122 nullptr);
1124 return retval;
1127 AST_Template_Module *
1128 be_generator::create_template_module (
1129 UTL_ScopedName *n,
1130 FE_Utils::T_PARAMLIST_INFO *template_params)
1132 be_template_module *retval = nullptr;
1133 ACE_NEW_RETURN (retval,
1134 be_template_module (n,
1135 template_params),
1136 nullptr);
1138 return retval;
1141 AST_Template_Module_Inst *
1142 be_generator::create_template_module_inst (
1143 UTL_ScopedName *n,
1144 AST_Template_Module *ref,
1145 FE_Utils::T_ARGLIST *template_args)
1147 be_template_module_inst *retval = nullptr;
1148 ACE_NEW_RETURN (retval,
1149 be_template_module_inst (n,
1150 ref,
1151 template_args),
1152 nullptr);
1154 return retval;
1157 AST_Template_Module_Ref *
1158 be_generator::create_template_module_ref (
1159 UTL_ScopedName *n,
1160 AST_Template_Module *ref,
1161 UTL_StrList *param_refs)
1163 be_template_module_ref *retval = nullptr;
1164 ACE_NEW_RETURN (retval,
1165 be_template_module_ref (n,
1166 ref,
1167 param_refs),
1168 nullptr);
1170 return retval;
1173 AST_Param_Holder *
1174 be_generator::create_param_holder (
1175 UTL_ScopedName *parameter_name,
1176 FE_Utils::T_Param_Info *info)
1178 be_param_holder *retval = nullptr;
1179 ACE_NEW_RETURN (retval,
1180 be_param_holder (parameter_name,
1181 info),
1182 nullptr);
1184 return retval;