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
51 Sun, Sun Microsystems and the Sun logo are trademarks or registered
52 trademarks of Sun Microsystems, Inc.
56 Mountain View, California 94043
60 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
61 trademarks or registered trademarks of Sun Microsystems, Inc.
65 #ifndef _AST_GENERATOR_AST_GENERATOR_HH
66 #define _AST_GENERATOR_AST_GENERATOR_HH
68 #include "ast_operation.h"
69 #include "ast_argument.h"
70 #include "ast_predefined_type.h"
71 #include "ast_union_label.h"
72 #include "ast_porttype.h"
80 class AST_EventTypeFwd
;
81 class AST_Extended_Port
;
82 class AST_Mirror_Port
;
89 class AST_Template_Module
;
91 class AST_Template_Module_Inst
;
92 class AST_Template_Module_Ref
;
93 class AST_Param_Holder
;
97 #include "ast_annotation_appl.h"
99 class AST_Annotation_Member
;
101 // Defines base class for node generators.
103 class TAO_IDL_FE_Export AST_Generator
108 virtual ~AST_Generator () {}
112 // Create a node representing a predefined type.
113 virtual AST_PredefinedType
*create_predefined_type (
114 AST_PredefinedType::PredefinedType t
,
117 // Create a node representing a module.
118 virtual AST_Module
*create_module (UTL_Scope
*s
,
121 // Create a node representing a module which is the root of an AST.
122 virtual AST_Root
*create_root (UTL_ScopedName
*n
);
124 // Create a node representing an interface.
125 virtual AST_Interface
*create_interface (
129 AST_Interface
**inherits_flat
,
130 long n_inherits_flat
,
134 // Create a node representing a forward declaration of an interface.
135 virtual AST_InterfaceFwd
*create_interface_fwd (
140 // Create a node representing a valuetype.
141 virtual AST_ValueType
*create_valuetype (
145 AST_Type
*inherits_concrete
,
146 AST_Interface
**inherits_flat
,
147 long n_inherits_flat
,
148 AST_Type
**supports_list
,
150 AST_Type
*supports_concrete
,
155 // Create a node representing a forward declaration of a valuetype.
156 virtual AST_ValueTypeFwd
*create_valuetype_fwd (
160 // Create a node representing an eventtype.
161 virtual AST_EventType
*create_eventtype (
165 AST_Type
*inherits_concrete
,
166 AST_Interface
**inherits_flat
,
167 long n_inherits_flat
,
168 AST_Type
**supports_list
,
170 AST_Type
*supports_concrete
,
175 // Create a node representing a forward declaration of an eventtype.
176 virtual AST_EventTypeFwd
*create_eventtype_fwd (
180 // Create a node representing a component.
181 virtual AST_Component
*create_component (
183 AST_Component
*base_component
,
184 AST_Type
**supports_list
,
186 AST_Interface
**supports_flat
,
187 long n_supports_flat
);
189 // Create a node representing a forward declaration of a component.
190 virtual AST_ComponentFwd
*create_component_fwd (
193 // Create a node representing a component home.
194 virtual AST_Home
*create_home (
197 AST_Component
*managed_component
,
198 AST_Type
*primary_key
,
199 AST_Type
**support_lists
,
201 AST_Interface
**supports_flat
,
202 long n_supports_flat
);
204 // Create a node representing an exception.
205 virtual AST_Exception
*create_exception (
210 // Create a node representing a structure.
211 virtual AST_Structure
*create_structure (
216 // Create a node representing a forward declaration of a structure.
217 virtual AST_StructureFwd
*create_structure_fwd (UTL_ScopedName
*n
);
219 // Create a node representing an enum.
220 virtual AST_Enum
*create_enum (UTL_ScopedName
*n
,
224 // Create a node representing an operation on an interface.
225 virtual AST_Operation
*create_operation (
227 AST_Operation::Flags fl
,
232 // Create a node representing a field in a structure, exception or
234 virtual AST_Field
*create_field (AST_Type
*ft
,
236 AST_Field::Visibility vis
=
239 // Create a node representing an argument to an operation.
240 virtual AST_Argument
*create_argument (
241 AST_Argument::Direction d
,
245 // Create a node representing an attribute.
246 virtual AST_Attribute
*create_attribute (
253 // Create a node representing a union.
254 virtual AST_Union
*create_union (AST_ConcreteType
*dt
,
259 // Create a node representing a forward declaration of a union.
260 virtual AST_UnionFwd
*create_union_fwd (UTL_ScopedName
*n
);
262 // Create a node representing one branch in a union.
263 virtual AST_UnionBranch
*create_union_branch (
268 // Create a node representing a label on a union branch.
269 virtual AST_UnionLabel
*create_union_label (AST_UnionLabel::UnionLabel ul
,
272 // Create a node representing a constant
273 virtual AST_Constant
*create_constant (
274 AST_Expression::ExprType et
,
278 // Create various kinds of nodes representing expressions.
280 virtual AST_Expression
*create_expr (UTL_ScopedName
*n
);
282 virtual AST_Expression
*create_expr (AST_Expression
*v
,
283 AST_Expression::ExprType t
);
285 virtual AST_Expression
*create_expr (AST_Expression::ExprComb c
,
289 virtual AST_Expression
*create_expr (ACE_CDR::Long v
);
291 virtual AST_Expression
*create_expr (ACE_CDR::LongLong v
);
293 virtual AST_Expression
*create_expr (ACE_CDR::Boolean b
);
295 virtual AST_Expression
*create_expr (ACE_CDR::ULong v
);
297 virtual AST_Expression
*create_expr (ACE_CDR::ULongLong v
);
299 virtual AST_Expression
*create_expr (ACE_CDR::ULong v
,
300 AST_Expression::ExprType t
);
302 virtual AST_Expression
*create_expr (UTL_String
*s
);
304 virtual AST_Expression
*create_expr (char *s
);
306 virtual AST_Expression
*create_expr (ACE_CDR::Char c
);
308 virtual AST_Expression
*create_expr (ACE_OutputCDR::from_wchar wc
);
310 virtual AST_Expression
*create_expr (ACE_CDR::Double d
);
312 virtual AST_Expression
*create_expr (const ACE_CDR::Fixed
&f
);
314 // Create a node representing an enumerator.
315 virtual AST_EnumVal
*create_enum_val (ACE_CDR::ULong v
,
318 // Create a node representing an array type.
319 virtual AST_Array
*create_array (UTL_ScopedName
*n
,
320 ACE_CDR::ULong ndims
,
325 // Create a node representing a sequence type.
326 virtual AST_Sequence
*create_sequence (AST_Expression
*v
,
332 // Create a node representing a map type.
333 virtual AST_Map
*create_map (AST_Expression
*v
,
340 // Create a node representing a string type.
341 virtual AST_String
*create_string (AST_Expression
*v
);
343 // Create a node representing a wide string type.
344 virtual AST_String
*create_wstring (AST_Expression
*v
);
346 virtual AST_Fixed
*create_fixed (AST_Expression
*digits
,
347 AST_Expression
*scale
);
349 // Create a node representing a type renaming (typedef).
350 virtual AST_Typedef
*create_typedef (AST_Type
*bt
,
355 // Create a node representing a native.
356 virtual AST_Native
*create_native (UTL_ScopedName
*n
);
358 // Create a node representing an OBV or home factory construct.
359 virtual AST_Factory
*create_factory (UTL_ScopedName
*n
);
361 // Create a node representing an home finder construct.
362 virtual AST_Finder
*create_finder (UTL_ScopedName
*n
);
364 // Create a node representing a valuebox.
365 virtual AST_ValueBox
*create_valuebox (UTL_ScopedName
*n
,
366 AST_Type
*boxed_type
);
369 AST_PortType
*create_porttype (UTL_ScopedName
*n
);
372 AST_Provides
*create_provides (UTL_ScopedName
*n
,
373 AST_Type
*provides_type
);
376 AST_Uses
*create_uses (UTL_ScopedName
*n
,
381 AST_Publishes
*create_publishes (UTL_ScopedName
*n
,
382 AST_Type
*publishes_type
);
385 AST_Emits
*create_emits (UTL_ScopedName
*n
,
386 AST_Type
*emits_type
);
389 AST_Consumes
*create_consumes (UTL_ScopedName
*n
,
390 AST_Type
*consumes_type
);
393 AST_Extended_Port
*create_extended_port (
395 AST_PortType
*porttype_ref
);
398 AST_Mirror_Port
*create_mirror_port (
400 AST_PortType
*porttype_ref
);
403 AST_Connector
*create_connector (
405 AST_Connector
*base_connector
);
408 AST_Template_Module
*create_template_module (
410 FE_Utils::T_PARAMLIST_INFO
*template_params
);
413 AST_Template_Module_Inst
*create_template_module_inst (
415 AST_Template_Module
*ref
,
416 FE_Utils::T_ARGLIST
*template_args
);
419 AST_Template_Module_Ref
*create_template_module_ref (
421 AST_Template_Module
*ref
,
422 UTL_StrList
*param_refs
);
425 AST_Param_Holder
*create_param_holder (
426 UTL_ScopedName
*parameter_name
,
427 FE_Utils::T_Param_Info
*info
);
429 virtual AST_Annotation_Decl
* create_annotation_decl (
430 UTL_ScopedName
*name
);
432 virtual AST_Annotation_Member
* create_annotation_member (
433 AST_Expression::ExprType expr_type
,
435 UTL_ScopedName
*name
);
437 virtual AST_Annotation_Appl
* create_annotation_appl (
438 UTL_ScopedName
*name
,
439 AST_Annotation_Appl::Params
*params
);
442 #endif // _AST_GENERATOR_AST_GENERATOR_HH