3 //=============================================================================
5 * @file ast_visitor_reifying.h
7 * This visitor visits an AST_Param_Holder, finds the corresponding
8 * template argument, looks up or creates the type, and stores
9 * it for retrieval and use in the template module
10 * instantiation visitor
12 * @author Jeff Parsons
14 //=============================================================================
17 #ifndef TAO_AST_VISITOR_REIFYING_H
18 #define TAO_AST_VISITOR_REIFYING_H
20 #include "ast_visitor.h"
22 #include "utl_scoped_name.h"
25 class AST_Param_Holder
;
26 class ast_visitor_context
;
29 * @class ast_visitor_reifying
31 * @brief ast_visitor_reifying
33 * Reifies a template argument that has been substituted for
34 * a template parameter reference. Complete reification may
35 * include further reification, for example of array
36 * dimensions, sequence bound or (w)string bound
37 * for addition to the scope of the template module
40 class ast_visitor_reifying
: public ast_visitor
43 ast_visitor_reifying (ast_visitor_context
*ctx
);
45 virtual ~ast_visitor_reifying (void);
47 AST_Decl
*reified_node (void) const;
49 virtual int visit_decl (AST_Decl
*d
);
50 virtual int visit_scope (UTL_Scope
*node
);
51 virtual int visit_type (AST_Type
*node
);
52 virtual int visit_module (AST_Module
*node
);
53 virtual int visit_interface_fwd (AST_InterfaceFwd
*node
);
54 virtual int visit_valuetype_fwd (AST_ValueTypeFwd
*node
);
55 virtual int visit_home (AST_Home
*node
);
56 virtual int visit_component_fwd (AST_ComponentFwd
*node
);
57 virtual int visit_template_module (AST_Template_Module
*node
);
58 virtual int visit_template_module_inst (AST_Template_Module_Inst
*node
);
59 virtual int visit_template_module_ref (AST_Template_Module_Ref
*node
);
60 virtual int visit_porttype (AST_PortType
*node
);
61 virtual int visit_provides (AST_Provides
*node
);
62 virtual int visit_uses (AST_Uses
*node
);
63 virtual int visit_publishes (AST_Publishes
*node
);
64 virtual int visit_emits (AST_Emits
*node
);
65 virtual int visit_consumes (AST_Consumes
*node
);
66 virtual int visit_extended_port (AST_Extended_Port
*node
);
67 virtual int visit_mirror_port (AST_Mirror_Port
*node
);
68 virtual int visit_connector (AST_Connector
*node
);
69 virtual int visit_eventtype_fwd (AST_EventTypeFwd
*node
);
70 virtual int visit_factory (AST_Factory
*node
);
71 virtual int visit_finder (AST_Finder
*node
);
72 virtual int visit_structure (AST_Structure
*node
);
73 virtual int visit_structure_fwd (AST_StructureFwd
*node
);
74 virtual int visit_expression (AST_Expression
*node
);
75 virtual int visit_enum (AST_Enum
*node
);
76 virtual int visit_operation (AST_Operation
*node
);
77 virtual int visit_field (AST_Field
*node
);
78 virtual int visit_argument (AST_Argument
*node
);
79 virtual int visit_attribute (AST_Attribute
*node
);
80 virtual int visit_union (AST_Union
*node
);
81 virtual int visit_union_fwd (AST_UnionFwd
*node
);
82 virtual int visit_union_branch (AST_UnionBranch
*node
);
83 virtual int visit_union_label (AST_UnionLabel
*node
);
84 virtual int visit_enum_val (AST_EnumVal
*node
);
85 virtual int visit_root (AST_Root
*node
);
86 virtual int visit_native (AST_Native
*node
);
87 virtual int visit_valuebox (AST_ValueBox
*node
);
88 virtual int visit_interface (AST_Interface
*node
);
89 virtual int visit_valuetype (AST_ValueType
*node
);
90 virtual int visit_eventtype (AST_EventType
*node
);
91 virtual int visit_component (AST_Component
*node
);
92 virtual int visit_exception (AST_Exception
*node
);
93 virtual int visit_typedef (AST_Typedef
*node
);
94 virtual int visit_array (AST_Array
*node
);
95 virtual int visit_sequence (AST_Sequence
*node
);
96 virtual int visit_predefined_type (AST_PredefinedType
*node
);
97 virtual int visit_string (AST_String
*node
);
98 virtual int visit_constant (AST_Constant
*node
);
99 virtual int visit_param_holder (AST_Param_Holder
*node
);
102 // Check if arg is declared at some level in the scope of a
103 // template module. If so, look up the corresponding node in
104 // the corresponding instantiation, and store that instead.
105 void check_and_store (AST_Decl
*node
);
107 // Returns a relative scoped name allocated on the heap if the
108 // arg is declared inside a template module, otherwise 0.
109 UTL_ScopedName
*template_module_rel_name (AST_Decl
*d
);
112 ast_visitor_context
*ctx_
;
113 AST_Decl
*reified_node_
;
116 #endif // TAO_AST_VISITOR_REIFYING_H