Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / ast / ast_generator.cpp
blobec289b43547813c59b3698a4bb76fa56fe840f2f
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 // The generator protocol is explained in detail in the IDL CFE
66 // design document.
67 // The AST_Generator class provides operations to instantiate any
68 // of the AST nodes. It contains an operation for every constructor
69 // of every AST class.
71 #include "ast_root.h"
72 #include "ast_valuebox.h"
73 #include "ast_valuetype.h"
74 #include "ast_valuetype_fwd.h"
75 #include "ast_eventtype.h"
76 #include "ast_eventtype_fwd.h"
77 #include "ast_component.h"
78 #include "ast_component_fwd.h"
79 #include "ast_home.h"
80 #include "ast_mirror_port.h"
81 #include "ast_connector.h"
82 #include "ast_template_module.h"
83 #include "ast_template_module_inst.h"
84 #include "ast_template_module_ref.h"
85 #include "ast_param_holder.h"
86 #include "ast_provides.h"
87 #include "ast_uses.h"
88 #include "ast_publishes.h"
89 #include "ast_emits.h"
90 #include "ast_consumes.h"
91 #include "ast_exception.h"
92 #include "ast_enum.h"
93 #include "ast_attribute.h"
94 #include "ast_union.h"
95 #include "ast_union_fwd.h"
96 #include "ast_union_branch.h"
97 #include "ast_enum_val.h"
98 #include "ast_array.h"
99 #include "ast_sequence.h"
100 #include "ast_string.h"
101 #include "ast_structure_fwd.h"
102 #include "ast_typedef.h"
103 #include "ast_native.h"
104 #include "ast_factory.h"
105 #include "ast_finder.h"
106 #include "ast_fixed.h"
107 #include "ast_annotation_appl.h"
108 #include "ast_annotation_member.h"
110 #include "utl_identifier.h"
112 #include "nr_extern.h"
113 #include "ace/OS_NS_wchar.h"
115 #include "ast_generator.h"
117 AST_PredefinedType *
118 AST_Generator::create_predefined_type (AST_PredefinedType::PredefinedType t,
119 UTL_ScopedName *n)
121 AST_PredefinedType *retval = 0;
122 ACE_NEW_RETURN (retval,
123 AST_PredefinedType (t, n),
126 return retval;
129 AST_Module *
130 AST_Generator::create_module (UTL_Scope *s,
131 UTL_ScopedName *n)
133 AST_Module *retval = 0;
135 // Check for another module of the same name in the scope.
136 for (UTL_ScopeActiveIterator iter (s, UTL_Scope::IK_decls);
137 !iter.is_done ();
138 iter.next ())
140 // Can't just check node type here, since it could be a
141 // template module or template module instantiation.
142 AST_Module *m = dynamic_cast<AST_Module*> (iter.item ());
143 if (m && m->local_name ()->compare (n->last_component ()))
145 // Create this new module with referance to the
146 // "first" previous module found in scope.
147 ACE_NEW_RETURN (retval, AST_Module (n, m), 0);
148 retval->prefix (const_cast<char *> (m->prefix ()));
149 return retval;
153 // Since the scope didn't contain the same module name, it
154 // doesn't mean that we haven't see it before. If the scope
155 // is itself a module, and has been previously opened, any
156 // of the previous openings may contain a previous opening
157 // of the module we're creating.
158 AST_Module *prev_module = dynamic_cast<AST_Module*> (s);
159 if (prev_module)
161 while (!!(prev_module= prev_module->previous_opening ()))
163 for (UTL_ScopeActiveIterator iter (prev_module, UTL_Scope::IK_decls);
164 !iter.is_done ();
165 iter.next ())
167 AST_Module *m = dynamic_cast<AST_Module*> (iter.item ());
168 if (m && m->local_name ()->compare (n->last_component ()))
170 // Create this new module with referance to the
171 // "first" previous module found in scope.
172 ACE_NEW_RETURN (retval, AST_Module (n, m), 0);
173 return retval;
179 // There is no previous module to this one
180 ACE_NEW_RETURN (retval, AST_Module (n), 0);
181 return retval;
184 AST_Root *
185 AST_Generator::create_root (UTL_ScopedName *n)
187 AST_Root *retval = 0;
188 ACE_NEW_RETURN (retval,
189 AST_Root (n),
192 return retval;
195 AST_Interface *
196 AST_Generator::create_interface (UTL_ScopedName *n,
197 AST_Type **inherits,
198 long n_inherits,
199 AST_Interface **inherits_flat,
200 long n_inherits_flat,
201 bool is_local,
202 bool is_abstract)
204 AST_Interface *retval = 0;
205 ACE_NEW_RETURN (retval,
206 AST_Interface (n,
207 inherits,
208 n_inherits,
209 inherits_flat,
210 n_inherits_flat,
211 is_local,
212 is_abstract),
215 return retval;
218 AST_InterfaceFwd *
219 AST_Generator::create_interface_fwd (UTL_ScopedName *n,
220 bool is_local,
221 bool is_abstract)
223 AST_Interface
224 *full_defn = this->create_interface (n,
229 is_local,
230 is_abstract);
231 AST_InterfaceFwd *retval = 0;
232 ACE_NEW_RETURN (retval,
233 AST_InterfaceFwd (full_defn, n),
236 full_defn->fwd_decl (retval);
237 return retval;
240 AST_ValueType *
241 AST_Generator::create_valuetype (UTL_ScopedName *n,
242 AST_Type **inherits,
243 long n_inherits,
244 AST_Type *inherits_concrete,
245 AST_Interface **inherits_flat,
246 long n_inherits_flat,
247 AST_Type **supports_list,
248 long n_supports,
249 AST_Type *supports_concrete,
250 bool is_abstract,
251 bool is_truncatable,
252 bool is_custom)
254 AST_ValueType *retval = 0;
255 ACE_NEW_RETURN (retval,
256 AST_ValueType (n,
257 inherits,
258 n_inherits,
259 inherits_concrete,
260 inherits_flat,
261 n_inherits_flat,
262 supports_list,
263 n_supports,
264 supports_concrete,
265 is_abstract,
266 is_truncatable,
267 is_custom),
270 // The following helps with OBV_ namespace generation.
271 AST_Module *m = dynamic_cast<AST_Module*> (retval->defined_in ());
272 if (m)
274 m->set_has_nested_valuetype ();
277 return retval;
280 AST_ValueTypeFwd *
281 AST_Generator::create_valuetype_fwd (UTL_ScopedName *n,
282 bool is_abstract)
284 AST_ValueType *full_defn = this->create_valuetype (n,
293 is_abstract,
294 false,
295 false);
297 AST_ValueTypeFwd *retval = 0;
298 ACE_NEW_RETURN (retval,
299 AST_ValueTypeFwd (full_defn,
303 full_defn->fwd_decl (retval);
304 return retval;
307 AST_EventType *
308 AST_Generator::create_eventtype (UTL_ScopedName *n,
309 AST_Type **inherits,
310 long n_inherits,
311 AST_Type *inherits_concrete,
312 AST_Interface **inherits_flat,
313 long n_inherits_flat,
314 AST_Type **supports_list,
315 long n_supports,
316 AST_Type *supports_concrete,
317 bool is_abstract,
318 bool is_truncatable,
319 bool is_custom)
321 AST_EventType *retval = 0;
322 ACE_NEW_RETURN (retval,
323 AST_EventType (n,
324 inherits,
325 n_inherits,
326 inherits_concrete,
327 inherits_flat,
328 n_inherits_flat,
329 supports_list,
330 n_supports,
331 supports_concrete,
332 is_abstract,
333 is_truncatable,
334 is_custom),
337 // The following helps with OBV_ namespace generation.
338 AST_Module *m = dynamic_cast<AST_Module*> (retval->defined_in ());
340 if (m != 0)
342 m->set_has_nested_valuetype ();
345 return retval;
348 AST_EventTypeFwd *
349 AST_Generator::create_eventtype_fwd (UTL_ScopedName *n,
350 bool is_abstract)
352 AST_EventType *full_defn = this->create_eventtype (n,
361 is_abstract,
362 false,
363 false);
365 AST_EventTypeFwd *retval = 0;
366 ACE_NEW_RETURN (retval,
367 AST_EventTypeFwd (full_defn,
371 full_defn->fwd_decl (retval);
372 return retval;
375 AST_Component *
376 AST_Generator::create_component (UTL_ScopedName *n,
377 AST_Component *base_component,
378 AST_Type **supports_list,
379 long n_supports,
380 AST_Interface **supports_flat,
381 long n_supports_flat)
383 AST_Component *retval = 0;
384 ACE_NEW_RETURN (retval,
385 AST_Component (n,
386 base_component,
387 supports_list,
388 n_supports,
389 supports_flat,
390 n_supports_flat),
393 return retval;
396 AST_ComponentFwd *
397 AST_Generator::create_component_fwd (UTL_ScopedName *n)
399 AST_Component *full_defn = this->create_component (n,
406 AST_ComponentFwd *retval = 0;
407 ACE_NEW_RETURN (retval,
408 AST_ComponentFwd (full_defn,
412 full_defn->fwd_decl (retval);
413 return retval;
416 AST_Home *
417 AST_Generator::create_home (UTL_ScopedName *n,
418 AST_Home *base_home,
419 AST_Component *managed_component,
420 AST_Type *primary_key,
421 AST_Type **supports_list,
422 long n_supports,
423 AST_Interface **supports_flat,
424 long n_supports_flat)
426 AST_Home *retval = 0;
427 ACE_NEW_RETURN (retval,
428 AST_Home (n,
429 base_home,
430 managed_component,
431 primary_key,
432 supports_list,
433 n_supports,
434 supports_flat,
435 n_supports_flat),
438 return retval;
441 AST_Exception *
442 AST_Generator::create_exception (UTL_ScopedName *n,
443 bool is_local,
444 bool is_abstract)
446 AST_Exception *retval = 0;
447 ACE_NEW_RETURN (retval,
448 AST_Exception (n,
449 is_local,
450 is_abstract),
453 return retval;
456 AST_Structure *
457 AST_Generator::create_structure (UTL_ScopedName *n,
458 bool is_local,
459 bool is_abstract)
461 AST_Structure *retval = 0;
462 ACE_NEW_RETURN (retval,
463 AST_Structure (n,
464 is_local,
465 is_abstract),
468 return retval;
471 AST_StructureFwd *
472 AST_Generator::create_structure_fwd (UTL_ScopedName *n)
474 AST_Structure *full_defn = this->create_structure (n,
475 false,
476 false);
477 AST_StructureFwd *retval = 0;
478 ACE_NEW_RETURN (retval,
479 AST_StructureFwd (full_defn,
483 full_defn->fwd_decl (retval);
484 return retval;
487 AST_Enum *
488 AST_Generator::create_enum (UTL_ScopedName *n,
489 bool is_local,
490 bool is_abstract)
492 AST_Enum *retval = 0;
493 ACE_NEW_RETURN (retval,
494 AST_Enum (n,
495 is_local,
496 is_abstract),
499 return retval;
502 AST_Operation *
503 AST_Generator::create_operation (AST_Type *rt,
504 AST_Operation::Flags fl,
505 UTL_ScopedName *n,
506 bool is_local,
507 bool is_abstract)
509 AST_Operation *retval = 0;
510 ACE_NEW_RETURN (retval,
511 AST_Operation (rt,
514 is_local,
515 is_abstract),
518 return retval;
521 AST_Field *
522 AST_Generator::create_field (AST_Type *ft,
523 UTL_ScopedName *n,
524 AST_Field::Visibility vis)
526 AST_Field *retval = 0;
527 ACE_NEW_RETURN (retval,
528 AST_Field (ft,
530 vis),
533 return retval;
536 AST_Argument *
537 AST_Generator::create_argument (AST_Argument::Direction d,
538 AST_Type *ft,
539 UTL_ScopedName *n)
541 AST_Argument *retval = 0;
542 ACE_NEW_RETURN (retval,
543 AST_Argument (d,
548 return retval;
551 AST_Attribute *
552 AST_Generator::create_attribute (bool ro,
553 AST_Type *ft,
554 UTL_ScopedName *n,
555 bool is_local,
556 bool is_abstract)
558 AST_Attribute *retval = 0;
559 ACE_NEW_RETURN (retval,
560 AST_Attribute (ro,
563 is_local,
564 is_abstract),
567 return retval;
570 AST_Union *
571 AST_Generator::create_union (AST_ConcreteType *dt,
572 UTL_ScopedName *n,
573 bool is_local,
574 bool is_abstract)
576 AST_Union *retval = 0;
577 ACE_NEW_RETURN (retval,
578 AST_Union (dt,
580 is_local,
581 is_abstract),
584 return retval;
587 AST_UnionFwd *
588 AST_Generator::create_union_fwd (UTL_ScopedName *n)
590 AST_Union *full_defn = this->create_union (0,
592 false,
593 false);
594 AST_UnionFwd *retval = 0;
595 ACE_NEW_RETURN (retval,
596 AST_UnionFwd (full_defn,
600 full_defn->fwd_decl (retval);
601 return retval;
604 AST_UnionBranch *
605 AST_Generator::create_union_branch (UTL_LabelList *ll,
606 AST_Type *ft,
607 UTL_ScopedName *n)
609 AST_UnionBranch *retval = 0;
610 ACE_NEW_RETURN (retval,
611 AST_UnionBranch (ll,
616 return retval;
619 AST_UnionLabel *
620 AST_Generator::create_union_label (AST_UnionLabel::UnionLabel ul,
621 AST_Expression *v)
623 AST_UnionLabel *retval = 0;
624 ACE_NEW_RETURN (retval,
625 AST_UnionLabel (ul,
629 return retval;
632 AST_Constant *
633 AST_Generator::create_constant (AST_Expression::ExprType et,
634 AST_Expression *ev,
635 UTL_ScopedName *n)
637 AST_Constant *retval = 0;
638 ACE_NEW_RETURN (retval,
639 AST_Constant (et,
644 return retval;
647 AST_Expression *
648 AST_Generator::create_expr (UTL_ScopedName *n)
650 AST_Expression *retval = 0;
651 ACE_NEW_RETURN (retval,
652 AST_Expression (n),
655 return retval;
658 AST_Expression *
659 AST_Generator::create_expr (AST_Expression *v,
660 AST_Expression::ExprType t)
662 AST_Expression *retval = 0;
663 ACE_NEW_RETURN (retval,
664 AST_Expression (v,
668 return retval;
671 AST_Expression *
672 AST_Generator::create_expr (AST_Expression::ExprComb c,
673 AST_Expression *v1,
674 AST_Expression *v2)
676 AST_Expression *retval = 0;
677 ACE_NEW_RETURN (retval,
678 AST_Expression (c,
680 v2),
683 return retval;
686 AST_Expression *
687 AST_Generator::create_expr (ACE_CDR::Long v)
689 AST_Expression *retval = 0;
690 ACE_NEW_RETURN (retval,
691 AST_Expression (v),
694 return retval;
697 AST_Expression *
698 AST_Generator::create_expr (ACE_CDR::LongLong l)
700 AST_Expression *retval = 0;
701 ACE_NEW_RETURN (retval,
702 AST_Expression (l),
705 return retval;
708 AST_Expression *
709 AST_Generator::create_expr (ACE_CDR::Boolean b)
711 AST_Expression *retval = 0;
712 ACE_NEW_RETURN (retval,
713 AST_Expression (b),
716 return retval;
719 AST_Expression *
720 AST_Generator::create_expr (ACE_CDR::ULong v)
722 AST_Expression *retval = 0;
723 ACE_NEW_RETURN (retval,
724 AST_Expression (v),
727 return retval;
730 AST_Expression *
731 AST_Generator::create_expr (ACE_CDR::ULongLong l)
733 AST_Expression *retval = 0;
734 ACE_NEW_RETURN (retval,
735 AST_Expression (l),
738 return retval;
741 AST_Expression *
742 AST_Generator::create_expr (ACE_CDR::ULong v,
743 AST_Expression::ExprType t)
745 AST_Expression *retval = 0;
746 ACE_NEW_RETURN (retval,
747 AST_Expression (v, t),
750 return retval;
753 AST_Expression *
754 AST_Generator::create_expr (UTL_String *s)
756 AST_Expression *retval = 0;
757 ACE_NEW_RETURN (retval,
758 AST_Expression (s),
761 return retval;
764 AST_Expression *
765 AST_Generator::create_expr (ACE_CDR::Char c)
767 AST_Expression *retval = 0;
768 ACE_NEW_RETURN (retval,
769 AST_Expression (c),
772 return retval;
775 AST_Expression *
776 AST_Generator::create_expr (ACE_OutputCDR::from_wchar wc)
778 AST_Expression *retval = 0;
779 ACE_NEW_RETURN (retval,
780 AST_Expression (wc),
783 return retval;
786 AST_Expression *
787 AST_Generator::create_expr (char *s)
789 AST_Expression *retval = 0;
790 ACE_NEW_RETURN (retval,
791 AST_Expression (s),
794 return retval;
797 AST_Expression *
798 AST_Generator::create_expr (ACE_CDR::Double d)
800 AST_Expression *retval = 0;
801 ACE_NEW_RETURN (retval,
802 AST_Expression (d),
805 return retval;
808 AST_Expression *
809 AST_Generator::create_expr (const ACE_CDR::Fixed &f)
811 AST_Expression *retval = 0;
812 ACE_NEW_RETURN (retval,
813 AST_Expression (f),
816 return retval;
819 AST_EnumVal *
820 AST_Generator::create_enum_val (ACE_CDR::ULong v,
821 UTL_ScopedName *n)
823 AST_EnumVal *retval = 0;
824 ACE_NEW_RETURN (retval,
825 AST_EnumVal (v,
829 return retval;
832 AST_Array *
833 AST_Generator::create_array (UTL_ScopedName *n,
834 ACE_CDR::ULong ndims,
835 UTL_ExprList *dims,
836 bool is_local,
837 bool is_abstract)
839 AST_Array *retval = 0;
840 ACE_NEW_RETURN (retval,
841 AST_Array (n,
842 ndims,
843 dims,
844 is_local,
845 is_abstract),
848 return retval;
851 AST_Sequence *
852 AST_Generator::create_sequence (AST_Expression *ms,
853 AST_Type *bt,
854 UTL_ScopedName *n,
855 bool is_local,
856 bool is_abstract)
858 AST_Sequence *retval = 0;
859 ACE_NEW_RETURN (retval,
860 AST_Sequence (ms,
863 is_local,
864 is_abstract),
867 return retval;
870 AST_String *
871 AST_Generator::create_string (AST_Expression *ms)
873 Identifier id ("string");
874 UTL_ScopedName n (&id,
877 AST_String *retval = 0;
878 ACE_NEW_RETURN (retval,
879 AST_String (AST_Decl::NT_string,
881 ms),
884 return retval;
887 AST_String *
888 AST_Generator::create_wstring (AST_Expression *ms)
890 Identifier id (sizeof (ACE_CDR::WChar) == 1
891 ? "string"
892 : "wstring");
893 UTL_ScopedName n (&id,
895 AST_Decl::NodeType nt = sizeof (ACE_CDR::WChar) == 1
896 ? AST_Decl::NT_string
897 : AST_Decl::NT_wstring;
899 AST_String *retval = 0;
900 ACE_NEW_RETURN (retval,
901 AST_String (nt,
904 sizeof (ACE_OS::WChar)),
907 return retval;
910 AST_Fixed *
911 AST_Generator::create_fixed (AST_Expression *digits,
912 AST_Expression *scale)
914 Identifier id ("fixed");
915 UTL_ScopedName name (&id, 0);
916 AST_Fixed *retval = 0;
917 ACE_NEW_RETURN (retval, AST_Fixed (&name, digits, scale), 0);
918 return retval;
921 AST_Typedef *
922 AST_Generator::create_typedef (AST_Type *bt,
923 UTL_ScopedName *n,
924 bool is_local,
925 bool is_abstract)
927 AST_Typedef *retval = 0;
928 ACE_NEW_RETURN (retval,
929 AST_Typedef (bt,
931 is_local,
932 is_abstract),
935 return retval;
938 AST_Native *
939 AST_Generator::create_native (UTL_ScopedName *n)
941 AST_Native *retval = 0;
942 ACE_NEW_RETURN (retval,
943 AST_Native (n),
946 return retval;
949 AST_Factory *
950 AST_Generator::create_factory (UTL_ScopedName *n)
952 AST_Factory *retval = 0;
953 ACE_NEW_RETURN (retval,
954 AST_Factory (n),
957 return retval;
960 AST_Finder *
961 AST_Generator::create_finder (UTL_ScopedName *n)
963 AST_Finder *retval = 0;
964 ACE_NEW_RETURN (retval,
965 AST_Finder (n),
968 return retval;
971 AST_ValueBox *
972 AST_Generator::create_valuebox (UTL_ScopedName *n,
973 AST_Type *boxed_type)
975 AST_ValueBox *retval = 0;
976 ACE_NEW_RETURN (retval,
977 AST_ValueBox (n, boxed_type),
980 return retval;
983 AST_PortType *
984 AST_Generator::create_porttype (UTL_ScopedName *n)
986 AST_PortType *retval = 0;
987 ACE_NEW_RETURN (retval,
988 AST_PortType (n),
991 return retval;
994 AST_Provides *
995 AST_Generator::create_provides (UTL_ScopedName *n,
996 AST_Type *provides_type)
998 AST_Provides *retval = 0;
999 ACE_NEW_RETURN (retval,
1000 AST_Provides (n,
1001 provides_type),
1004 return retval;
1007 AST_Uses *
1008 AST_Generator::create_uses (UTL_ScopedName *n,
1009 AST_Type *uses_type,
1010 bool is_multiple)
1012 AST_Uses *retval = 0;
1013 ACE_NEW_RETURN (retval,
1014 AST_Uses (n,
1015 uses_type,
1016 is_multiple),
1019 return retval;
1022 AST_Publishes *
1023 AST_Generator::create_publishes (UTL_ScopedName *n,
1024 AST_Type *publishes_type)
1026 AST_Publishes *retval = 0;
1027 ACE_NEW_RETURN (retval,
1028 AST_Publishes (n,
1029 publishes_type),
1032 return retval;
1035 AST_Emits *
1036 AST_Generator::create_emits (UTL_ScopedName *n,
1037 AST_Type *emits_type)
1039 AST_Emits *retval = 0;
1040 ACE_NEW_RETURN (retval,
1041 AST_Emits (n,
1042 emits_type),
1045 return retval;
1047 AST_Consumes *
1048 AST_Generator::create_consumes (UTL_ScopedName *n,
1049 AST_Type *consumes_type)
1051 AST_Consumes *retval = 0;
1052 ACE_NEW_RETURN (retval,
1053 AST_Consumes (n,
1054 consumes_type),
1057 return retval;
1060 AST_Extended_Port *
1061 AST_Generator::create_extended_port (
1062 UTL_ScopedName *n,
1063 AST_PortType *porttype_ref)
1065 AST_Extended_Port *retval = 0;
1066 ACE_NEW_RETURN (retval,
1067 AST_Extended_Port (n,
1068 porttype_ref),
1071 return retval;
1074 AST_Mirror_Port *
1075 AST_Generator::create_mirror_port (
1076 UTL_ScopedName *n,
1077 AST_PortType *porttype_ref)
1079 AST_Mirror_Port *retval = 0;
1080 ACE_NEW_RETURN (retval,
1081 AST_Mirror_Port (n,
1082 porttype_ref),
1085 return retval;
1088 AST_Connector *
1089 AST_Generator::create_connector (
1090 UTL_ScopedName *n,
1091 AST_Connector *base_connector)
1093 AST_Connector *retval = 0;
1094 ACE_NEW_RETURN (retval,
1095 AST_Connector (n,
1096 base_connector),
1099 return retval;
1102 AST_Template_Module *
1103 AST_Generator::create_template_module (
1104 UTL_ScopedName *n,
1105 FE_Utils::T_PARAMLIST_INFO *template_params)
1107 AST_Template_Module *retval = 0;
1108 ACE_NEW_RETURN (retval,
1109 AST_Template_Module (n,
1110 template_params),
1113 return retval;
1116 AST_Template_Module_Inst *
1117 AST_Generator::create_template_module_inst (
1118 UTL_ScopedName *n,
1119 AST_Template_Module *ref,
1120 FE_Utils::T_ARGLIST *template_args)
1122 AST_Template_Module_Inst *retval = 0;
1123 ACE_NEW_RETURN (retval,
1124 AST_Template_Module_Inst (n,
1125 ref,
1126 template_args),
1129 return retval;
1132 AST_Template_Module_Ref *
1133 AST_Generator::create_template_module_ref (
1134 UTL_ScopedName *n,
1135 AST_Template_Module *ref,
1136 UTL_StrList *param_refs)
1138 AST_Template_Module_Ref *retval = 0;
1139 ACE_NEW_RETURN (retval,
1140 AST_Template_Module_Ref (n,
1141 ref,
1142 param_refs),
1145 return retval;
1148 AST_Param_Holder *
1149 AST_Generator::create_param_holder (
1150 UTL_ScopedName *parameter_name,
1151 FE_Utils::T_Param_Info *info)
1153 AST_Param_Holder *retval = 0;
1154 ACE_NEW_RETURN (retval,
1155 AST_Param_Holder (parameter_name,
1156 info),
1159 return retval;
1162 AST_Annotation_Decl *
1163 AST_Generator::create_annotation_decl (
1164 UTL_ScopedName *name)
1166 AST_Annotation_Decl *retval = 0;
1167 ACE_NEW_RETURN (retval, AST_Annotation_Decl (name), 0);
1168 return retval;
1171 AST_Annotation_Appl *
1172 AST_Generator::create_annotation_appl (
1173 UTL_ScopedName *name,
1174 AST_Annotation_Appl::Params *params)
1176 AST_Annotation_Appl *retval = 0;
1177 ACE_NEW_RETURN (retval, AST_Annotation_Appl (name, params), 0);
1178 return retval;
1181 AST_Annotation_Member *
1182 AST_Generator::create_annotation_member (
1183 AST_Expression::ExprType expr_type,
1184 AST_Type *type,
1185 UTL_ScopedName *name)
1187 AST_Annotation_Member *retval = 0;
1188 ACE_NEW_RETURN (retval, AST_Annotation_Member (expr_type, type, name), 0);
1189 return retval;